Backend API for BloodMatters.
Node.js and npm must be installed on system. PostgreSQL is the recommended database to use.
- Install dependencies:
npm i
- Generate RSA Keypair for JWT tokens:
npm run genkeypair
- Set the necessary environment variables:
An example .env file is as follows:
PORT=8000 # port for server
DB_URI=postgres://<DB-USERNAME>:<PASSWORD>@<DB-HOST>:<DB-PORT>/<DB_NAME> # DB URI
ACCESS_TOKEN_EXPIRE_MINUTES=15 # no. of minutes until access token expiry
REFRESH_TOKEN_EXPIRE_DAYS=10 # no. of days until refresh token expiryThe .env file should exist at the root of the project and must set all specified variables above.
Note that this project has been developed and tested exclusively with PostgreSQL
although other databases compatible with Sequelize may be used.
- Start application with:
npm start