Skip to content

AlekNS/backend-ico-dashboard

 
 

Repository files navigation

Jincor ICO Dashboard Backend

This is backend module of Jincor ICO dashboard: https://contribute.jincor.com.

It was implemented to provide following functionality:

  1. ICO investors sign up.
  2. Generation of Ethereum address upon user activation.
  3. KYC verification using Jumio Netverify service (https://www.jumio.com/trusted-identity/netverify).
  4. Token purchase.
  5. Displaying Investor's transaction history.
  6. All important actions are protected with 2FA (email or google authenticator) by integration with Jincor Backend Verify service (https://github.com/JincorTech/backend-verify)
  7. For more info check API docs: https://jincortech.github.io/backend-ico-dashboard

Technology stack

  1. Typescript, Express, InversifyJS (DI), TypeORM (MongoDB interaction).
  2. Web3JS - interaction with Ethereum client. ICO backend supports any JSON-RPC compliant client.
  3. Mocha/chai - unit/functional tests.
  4. Docker.

How to start development and run tests?

  1. Clone this repo.
  2. Run docker-compose build --no-cache.
  3. Run docker-compose up -d.
  4. Run cp .env.test .env.
  5. To install dependencies run docker-compose exec ico npm i.
  6. Run tests docker-compose exec ico npm test.

How to generate docs?

  1. Install aglio npm install -g aglio.
  2. Run mkdir /usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio/cache.
  3. Generate aglio --theme-variables cyborg --theme-template triple -i apiary.apib -o ./docs/index.html.

How to launch the project?

Getting Started

  1. Clone the repo.
  2. Write the necessary environment variables in .env. For a basis it is possible to take .env.stage or .env.prod.
  3. Build services docker-compose build -no-cache
  4. Run the services docker-compose up -d

Note: The auth and verify services should be accessible from the outside. More in detail with the configuration of these services can be found in their readme.

Building the Application

  1. Install dependencies and build the project docker-compose exec ico npm i && docker-compose exec ico npm run build
  2. Generate a token for a tenant:
curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Accept: application/json" \
     --data-binary "{
    \"email\": \"test@test.com\",
    \"password\": \"Password1\"
}" \
'http://auth:3000/tenant'
curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Accept: application/json" \
     --data-binary "{
    \"email\": \"test@test.com\",
    \"password\": \"Password1\"
}" \
'http://auth:3000/tenant/login'

Note: If you start it in ico service, you must install curl. This can be done with the apk add curl command.

  1. Specify the received token in .env AUTH_JWT.
  2. Copy the certificates to the dist/certs directory.
  3. Rename or delete the src directory.

Note: If the test environment is deployed and .env.test is used, files from src will be used.

  1. Run ico service:

npm run serve

Note: If the dev environment, will run npm run start command.

About

This is backend module for Jincor ICO dashboard.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 52.7%
  • HTML 42.3%
  • API Blueprint 5.0%