UCenter for Meta Network.
# create your env file
$ touch .env
$ yarn install
First you have to setup the config files, include following:
config
|____config.production.yaml # for production mode
|____config.biz.production.yaml # as well as above
|____config.development.yaml # for development mode
|____config.biz.development.yaml # as well as above
|____rds-ca-2019-root.pem
|____JWT_PUBLIC_KEY.pub
|____JWT_PRIVATE_KEY.pem
If you're running in docker-compose, you need to setup these files within docker config path, default as:
/var/docker/meta-ucenter/config
Here's how to generate JWT key files:
# Generate RSA Key for JWT signing and get RSA Public Key from the private key
$ yarn run keygen
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
You can build a Docker image with docker build
command as following:
yarn build # or npm run build
docker build -t metaio/ucenter:latest .
Then to start up the image, you can use Docker compose, with simply:
docker-compose up
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
This project is following commitlint rules and checks the commit message with husky. You can also follow the Local setup installation guide to install this lint in your project, like following:
# Install and configure if needed
npm install --save-dev @commitlint/{cli,config-conventional}
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
# Install Husky v6
npm install husky --save-dev
# or
yarn add husky --dev
# Active hooks
npx husky install
# or
yarn husky install
# Add hook
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'
# or
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'