项目作者: zextis

项目描述 :
A ward inventory system for health facilities
高级语言: JavaScript
项目地址: git://github.com/zextis/wardinv.git
创建时间: 2018-05-22T16:52:11Z
项目社区:https://github.com/zextis/wardinv

开源协议:MIT License

下载


Ward Inventory System

A system to manage the supplies on a ward at a health facility

Features

  • Product Management
  • Product Dispensation
  • Keypad Hardware Integration

Technologies

Getting started

  1. # Clone the project
  2. git clone https://github.com/zextis/wardinv.git
  3. cd wardinv
  4. # Make it your own
  5. rm -rf .git && git init && npm init
  6. # Install dependencies
  7. npm i
  8. # or if you're using Yarn
  9. yarn

Then you can begin development:

  1. # yarn
  2. yarn run dev
  3. # npm
  4. npm run dev

This will launch a nodemon process for automatic server restarts when your code changes.

Testing

Testing is powered by Jest. This project also uses supertest for demonstrating a simple routing smoke test suite. Feel free to remove supertest entirely if you don’t wish to use it.
Start the test runner in watch mode with:

  1. # yarn
  2. yarn test
  3. # npm
  4. npm test

You can also generate coverage with:

  1. # yarn
  2. yarn test --coverage
  3. # npm
  4. npm test -- --coverage

Linting

Linting is set up using ESLint. It uses ESLint’s default eslint:recommended rules. Feel free to use your own rules and/or extend another popular linting config (e.g. airbnb’s or standard).s

Begin linting in watch mode with:

  1. # yarn
  2. yarn run lint
  3. # npm
  4. npm run lint

To begin linting and start the server simultaneously, edit the package.json like this:

  1. "dev": "nodemon src/index.js --exec \"node -r dotenv/config -r babel-register\" | npm run lint"

Environmental variables in development

The project uses dotenv for setting environmental variables during development. Simply copy .env.example, rename it to .env and add your env vars as you see fit.

It is strongly recommended never to check in your .env file to version control. It should only include environment-specific values such as database passwords or API keys used in development. Your production env variables should be different and be set differently depending on your hosting solution. dotenv is only for development.

Deployment

Deployment is specific to hosting platform/provider but generally:

  1. # yarn
  2. yarn run build
  3. # npm
  4. npm run build

will compile your src into /dist, and

  1. # yarn
  2. yarn start
  3. # npm
  4. npm start

will run build (via the prestart hook) and start the compiled application from the /dist folder.

The last command is generally what most hosting providers use to start your application when deployed, so it should take care of everything.

You can find small guides for Heroku, App Engine and AWS in the deployment document.

FAQ

Where is all the configuration for ESLint, Jest and Babel?

In package.json. Feel free to extract them in separate respective config files if you like.

License

MIT License. See the LICENSE file.