This is the backend architecture of AgreeWe software.
- Docker (https://docs.docker.com/install)
- NodeJS find version in
.nvmrc
file (prefer install with https://github.com/nvm-sh/nvm) - IDE (prefer https://www.jetbrains.com/webstorm/download)
- Install node dependencies
yarn install
- Unit tests
yarn test:unit
- Integration tests with docker
yarn test:integration
-
Integration tests outside docker
- start postgres and mongodb
docker-compose -f docker-compose.test.yml up --build postgres mongodb
- Run db migration
yarn postgres:migrate up
-
copy the content of test/test.env to .env
-
Run services
yarn service:api
- Note: do not forget to clean the .env before running the unit test. To restart the integration test you need to
stop everything and restart from scratch, include the database data(make a
docker-compose down
)
All test suit can be run in docker by prefixing all npm command by docker:
(eg: yarn docker:test:unit
)
- Start all the dependencies
yarn docker:dependencies
- Run the database migration
yarn postgres:migrate up
- Destroy database and create from scratch
yarn postgres:create
- Start all services (not recommended)
yarn service:main
- Start separate services
yarn service:api
docker-compose down
You can set environment variables in the .env
file, you can find examples in .env.sample