Skip to content

amontech/amon-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,951 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMON

This is the backend architecture of AMON software.

Prerequisites

Setup for development:

  • Clone repository
git clone https://github.com/amontech/amon-backend.git
  • Install node dependencies
npm i

Test

  • 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

    1. start db and redis
    docker-compose -f docker-compose.test.yml up --build db redis
    1. Run db migration
    npm run db:migrate up
    1. copy the content of test/test.env to .env

    2. Run services

    npm run service:api
    npm run service:wallet
    npm run service:oracle
    1. Run the test process
    npm run test:integration
    1. 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)

Useful commands

  • Start/stop - restart dependencies
docker-compose down && docker-compose -f docker-compose.test.yml up --build db redis

Note

All test suit can be run in docker by prefixing all npm command by docker: (eg: npm run docker:test:unit)

Run locally

  • 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:kyc

Stop

docker-compose down

Environment

You can set environment variables in the .env file, you can find examples in .env.sample

Heroku

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

About

Cryptocurrencies at your fingertip - Backend

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors