iGEM.org API
Tools
- Nest framework
Contributing
Before commiting make sure you have husky
installed:
npm run prepare
It will automatically perform static analysis and show lint errors.
Deployments
- Production:
- Preproduction:
- Development:
Deploying with Docker
The easiest way to run the server is using docker. You first need to install:
Install the packages and create the environment variables:
npm install
cp .env-example .env-local
Running the server
npm run docker:go
It will be available on http://localhost:5000.
Bare deployment
If you prefer, you can also run the server as a local bare service. In this case, you need to provide a database and a redis instance.
npm install
cp .env-example .env
You now must modify .env
to target your database and redis instances. If you prefer, you can run them on docker:
docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
docker run -p 6379:6379 -d redis
or
npm run docker:bare:up
Watch out: make sure ports 5432 and 6379 are available, otherwise you have to use different ones and adapt .env
file.
Running the server
# development
npm run start
# watch mode
npm run start:dev
# production mode
npm run start:prod
Test
# unit tests
npm run test
# e2e tests
npm run test:e2e
# test coverage
npm run test:cov
# in docker
npm run docker:test
# e2e in docker
npm run docker:e2e
Email Service
To run locally with the email service complete functional, you should add in .env the following fields:
EMAILER_USERNAME= #insert hushmail email address
EMAILER_PASSWORD= #email password