This is backend module of secret_tech ICO dashboard: https://demo.icodashboard.space.
It was implemented to provide following functionality:
- ICO investors #.
- Generation of Ethereum address upon user activation.
- KYC verification using Jumio Netverify service (https://www.jumio.com/trusted-identity/netverify) and Sufti Pro service (https://shuftipro.com).
- Token purchase.
- Displaying Investor's transaction history.
- All important actions are protected with 2FA (email or google authenticator) by integration with secret_tech Backend Verify service (https://github.com/JincorTech/backend-verify)
- For more info check API docs: https://secret-tech.github.io/backend-ico-dashboard
- Typescript, Express, InversifyJS (DI), TypeORM (MongoDB interaction).
- Web3JS - interaction with Ethereum client. ICO backend supports any JSON-RPC compliant client.
- Mocha/chai - unit/functional tests.
- Docker.
- Clone this repo.
- Run
docker-compose build --no-cache
. - Run
docker-compose up -d
. - Run
cp .env.test .env
. - To install dependencies run
docker-compose exec ico yarn
. - Run tests
docker-compose exec ico yarn test
.
- Install aglio
npm install -g aglio
. - Run
mkdir /usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio/cache
. - Generate
aglio --theme-variables cyborg --theme-template triple -i apiary.apib -o ./docs/index.html
.
- Clone the repo.
- Write the necessary environment variables in
.env
. For a basis it is possible to take.env.stage
or.env.prod
. - Build services
docker-compose build --no-cache
- 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.
- Install dependencies and build the project
docker-compose exec ico npm i && docker-compose exec ico npm run build
- 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/#'
Note: If you start it in ico service, you must install
curl
. This can be done with theapk add curl
command.
- Specify the received token in
.env
AUTH_JWT
. - Copy the certificates to the
dist/certs
directory. - Rename or delete the
src
directory.
Note: If the test environment is deployed and
.env.test
is used, files fromsrc
will be used.
- Run ico service:
npm run serve
Note: If the dev environment, will run
npm run start
command.