-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Closes #71. Add /docs. CI. Fill readme. * Closes #71. Add /docs. CI. Fill readme. * Closes #73. Move KYC api credentials to .env. * Closes #71. Travis. * Closes #71. Travis. Add storage folder to .dockerignore. * Closes #71. Fix travis.yml. * Closes #71. Optimize prod image size. * Closes #71. Optimize prod image size. Fix Dockerfile.prod.
- Loading branch information
1 parent
8fa6f16
commit 7ff617f
Showing
18 changed files
with
842 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ coverage | |
.nyc_output | ||
dist | ||
.env | ||
storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
MONGO_URL='mongodb://mongo:27017/ico-dashboard' | ||
ORM_ENTITIES_DIR="src/entities/**/*.ts" | ||
ORM_SUBSCRIBER_DIR="src/subscriber/**/*.ts" | ||
ORM_MIGRATIONS_DIR="src/migrations/**/*.ts" | ||
API_URL="https://stage-ico-back.jincor.com" | ||
FRONTEND_URL="https://invest.jincor.com" | ||
AUTH_JWT='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNlNTc1NWZmLTQ1ZDItNGZjZi1iZjk0LTZmZGE2YWUxYzVlOCIsImxvZ2luIjoidGVuYW50OnRlc3RAdGVzdC5jb20iLCJqdGkiOiJjZTU3NTVmZi00NWQyLTRmY2YtYmY5NC02ZmRhNmFlMWM1ZTgxNTExODk1MDM3MjQzIiwiaWF0IjoxNTExODk1MDM3MjQzLCJhdWQiOiJqaW5jb3IuY29tIiwiaXNUZW5hbnQiOnRydWV9.fzV8htVMypwYV50mrPtp-0Xe4C-sDYXWL_YyOyZ1e3M' | ||
AUTH_BASE_URL="http://auth:3000" | ||
VERIFY_BASE_URL="http://verify:3000" | ||
REDIS_URL="redis://redis:6379" | ||
ICO_SC_ADDRESS='0x7672210729e053B2462D39CF3746A5d19B405aAD' | ||
WHITELIST_SC_ADDRESS='0x3c97c521cc60e3c6bb8b568d36d7d2f7fa2435fb' | ||
JCR_TOKEN_ADDRESS='0x1a164bd1a4bd6f26726dba43972a91b20e7d93be' | ||
RPC_TYPE='http' | ||
RPC_ADDRESS='https://ropsten.infura.io/ujGcHij7xZIyz2afx4h2' | ||
WEB3_RESTORE_START_BLOCK=2015593 | ||
HTTP_SERVER=enabled | ||
ENVIRONMENT=test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
sudo: required | ||
services: | ||
- docker | ||
before_install: | ||
- docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
- chmod ugo+x ./build.sh | ||
script: | ||
- cp -r .env.test .env | ||
- docker-compose build | ||
- docker-compose up -d | ||
- docker-compose exec ico npm i | ||
- docker-compose exec ico npm test | ||
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "production"; elif [ "$TRAVIS_BRANCH" | ||
== "develop" ]; then echo "stage"; else echo "dev-$(git rev-parse --short HEAD)" | ||
; fi` | ||
- "./build.sh $TAG" | ||
env: | ||
global: | ||
- secure: 37DSPYwReJU811Bj/f8Dsn9JrD/tZ1dz7rOiE9N6wAefJ1iHCzV91Ot8mxUx7er6FP8KYe4tk3XBETqgorcLpVteU0a2UjWY/Hp8LGGlO4fsGQ+GZxj4lwx9vtj8TEhnPI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YKXrmtYhegpHcIMo9uY87HdhmBMDusNvWoxd9w++IH1YIjO5V4vhm9zuSfNRoNhwdaQrUBIT8yQUjLur3jMSXRfrQxhpk/AWniCoVqFy152IwfM4mV6Nqfu7mzEep2g0USXTLnGtM5HrdRsiDMk4a3KCLM= | ||
notifications: | ||
slack: | ||
secure: "38IJFcYZc+5X/yPX1uBOrY0j0Xqtunry/ufERlrgfpGwnkuljH+klVlE8hp5RdwqZJKBj+5C5TksK0TLbz/CiRFag6UuCWCUdpjIsaIytObhfmHnkccgAQcSmXVN+2AGva2caWNA8mA6UD3GOiv/+xzi3nW85t6wYOwNvYmCJjU1pRcA1BnCxkzvkHAxCv0xmWKGcdcSvhG1PBV2VPmPC2pEv3WDKlyEuxXDD1UrED/dXJVnMGifx+o4qp2vSQtpgIKbXk+5tH8xmQjT0BfXjP2u+ppFUKVLJQIMWxP4p9/kTxhrpiQpeQjVa5jzdUwJWzDnrIVdQNJfBXJ3euK05A/lQSBZBc+8UZBAWGKIYIHtw+I+QUTT/wFIej5no9qmCMArNP/zXIp9kt4OuvqyYB4xVLcMW9uWTqFNHs6pkk6LGpJ20RSl0MV+Hx7nP2k13MTnZFKyQK1dmS3Vkv4wLC5fJLC7Lrgk6vnqXJ502m5NHAPGpvRvQnvvBzJ0bnZkb/0YRRecXJDslQNDx7sawOdV0nACEtO997euvvKQTUSw+fVzoMUfpF7QjlT4QhnLqLK1745tqKF82JVgeZ2BQUCiZMJ6P4UBjpgDQaCXAuMVRemcn70b+dS66L39ZwjHgPI8P7/VwwwqM9egDqEIGXCGtPevT6CY7r+rP3J282U=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
FROM mhart/alpine-node:8.6 | ||
|
||
RUN apk update && apk upgrade && apk add git && apk add python && apk add make && apk add g++ | ||
|
||
RUN mkdir -p /usr/src/app | ||
ADD . /usr/src/app | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN npm i | ||
RUN npm run build | ||
RUN cp -r src/certs dist/ | ||
|
||
RUN apk add --update --no-cache git python make g++ && \ | ||
npm install && \ | ||
npm run build && \ | ||
npm prune --production && \ | ||
apk del --purge git python make g++ && \ | ||
rm -rf ./src | ||
|
||
CMD npm run serve |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# backend-ico-dashboard | ||
This is backend module for Jincor ICO dashboard. | ||
![](https://habrastorage.org/webt/59/d5/42/59d542206afbe280817420.png) | ||
|
||
# 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. | ||
1. Generation of Ethereum address upon user activation. | ||
1. KYC verification using Jumio Netverify service (https://www.jumio.com/trusted-identity/netverify). | ||
1. Token purchase. | ||
1. Displaying Investor's transaction history. | ||
1. All important actions are protected with 2FA (email or google authenticator) by integration with Jincor Backend Verify service (https://github.com/JincorTech/backend-verify) | ||
1. For more info check API docs: https://jincortech.github.io/backend-ico-dashboard | ||
|
||
## Technology stack | ||
|
||
1. Typescript, Express, InversifyJS (DI), TypeORM (MongoDB interaction). | ||
1. Web3JS - interaction with Ethereum client. ICO backend supports any JSON-RPC compliant client. | ||
1. Mocha/chai - unit/functional tests. | ||
1. Docker. | ||
|
||
## How to start development and run tests? | ||
|
||
1. Clone this repo. | ||
1. Run `docker-compose build --no-cache`. | ||
1. Run `docker-compose up -d`. | ||
1. Run `cp .env.test .env`. | ||
1. To install dependencies run `docker-compose exec ico npm i`. | ||
1. Run tests `docker-compose exec ico npm test`. | ||
|
||
## How to generate docs? | ||
|
||
1. Install aglio `npm install -g aglio`. | ||
1. Run `mkdir /usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio/cache`. | ||
1. Generate `aglio --theme-variables cyborg --theme-template triple -i apiary.apib -o ./docs/index.html`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
IMAGE_NAME="jincort/backend-ico-dashboard" | ||
TAG="${1}" | ||
docker build -t ${IMAGE_NAME}:${TAG} -f Dockerfile.prod . | ||
docker push ${IMAGE_NAME}:${TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM parity/parity:v1.8.3 | ||
ENTRYPOINT /parity/parity --no-ui --config dev --ws-origins=all --ws-interface=all | ||
EXPOSE 8546 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
FROM parity/parity:v1.8.3 | ||
VOLUME /passwords | ||
ENTRYPOINT /parity/parity --no-ui --ws-origins=all --ws-interface=all | ||
EXPOSE 8546 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
FROM parity/parity:v1.8.3 | ||
VOLUME /passwords | ||
ENTRYPOINT /parity/parity --no-ui --chain=ropsten --ws-origins=all --ws-interface=all | ||
EXPOSE 8546 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters