- Docker
- Docker-compose
- NodeJS
- npm or yarn
- Postgres Instance
1 - Install dependencies with yarn or npm i.
2 - Rename files with .example extension, as .env.example and ormconfig.example.js.
3 - Change environment variables of .env file for your use.
4 - Configure ormconfig.yml to connect with your postgres instance. Help
5 - Run migrations.
6 - Run locally using yarn dev or yarn start.
Warning: yarn start just works after build!
-
To start containers use command
docker-compose up -d. -
To stop containers use command
docker-compose down. -
To restart containers use command
docker-compose restart. -
To access postgres cli use
docker exec -it postgres psql -U database_user -W database_name. -
To access node container logs use
docker logs -f server.
To build project, use command yarn build, it will create dist directory that have javascript code.
Remember to reconfigure paths in conf files.
To run tests use yarn test.
If you want to create a coverage report use yarn test:coverage.
-
To run migrations use
yarn typeorm <connection_name> migration:run. -
To revert migrations use
yarn typeorm <connection_name> migration:revert.