This is the backend architecture of AMON software.
- Docker (https://docs.docker.com/install)
- NodeJS find version in
.nvmrcfile (prefer install with https://github.com/nvm-sh/nvm) - Postgres client (Osx:
brew install postgres) - IDE (prefer https://www.jetbrains.com/webstorm/download)
- Clone repository
git clone https://github.com/amontech/amon-backend.git- Install node dependencies
npm i- Unit tests
npm run test:unit- Unit tests with dependencies
npm run test:unit-dep- Integration tests with docker
npm run test:integration-
Integration tests outside docker
- start db and redis
docker-compose -f docker-compose.test.yml up --build db redis
- Run db migration
npm run db:migrate up
-
copy the content of test/test.env to .env
-
Run services
npm run service:api npm run service:wallet npm run service:oracle
- Run the test process
npm run test:integration
- 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)
- Start/stop - restart dependencies
docker-compose down && docker-compose -f docker-compose.test.yml up --build db redisAll test suit can be run in docker by prefixing all npm command by docker: (eg: npm run docker:test:unit)
- Start all the dependencies
npm run docker:dependencies- Run the database migration
npm run db:migrate up- Destroy database and create from scratch
npm run db:create- create database migration file
npm run db:migrate:create file_name_you_need- Start all services (not recommended)
npm run service:main- Start separate services
npm run service:api
npm run service:balancer
npm run service:wallet
npm run service:wallet-tank
npm run service:watchers
npm run service:oracle
npm run service:exchange
npm run service:investment
npm run service:monitoring
npm run service:kycdocker-compose downYou can set environment variables in the .env file, you can find examples in .env.sample
heroku ps:scale web=0 card=0 balancer=0 wallet=0 wallet-tank=0 watchers=0 oracle=0 exchange=0 investment=0 kyc=0 monitoring=0 migrate=0 tool=0 fixer=0 --app=amon-dev
heroku ps:scale web=2 card=1 balancer=1 wallet=1 wallet-tank=1 watchers=1 oracle=1 exchange=1 investment=1 kyc=1 monitoring=1 migrate=0 tool=0 fixer=0 --app=amon-dev