HUB
Sign inSign up

kloudio/platform-identity

By kloudio

•Updated almost 6 years ago

Image
0

1.9K

kloudio/platform-identity repository overview

⁠platform Develop

The :cloud: Kloud Platform

⁠Development and Contribution

⁠Setup

To begin using this project in a local development environment please follow the steps below.

⁠Environment Variables

This api utilizes this package⁠ for configuration variables. Take a look at config/default.ts for an example of configuration variables. You can overwrite any variable inside config/local.ts file. Or by supplying the NODE_CONFIG variable as a JSON object.

⁠Docker

Install Docker and Docker Compose from the the here⁠. Currently, the Platform depends on the following services to run:

  • Postgres
  • Redis

The Platform comes with a docker-compose.yaml which allows you to spin up the necessary required containers to run. To spin up the stack, run:

docker-compose up   # add -d flag to run detached

To tear down the stack, run:

docker-compose down
⁠Node

Install the latest version of NodeJS 12.x from the Node website⁠ or by using your platform's Node version manager⁠.

⁠Yarn

Install the latest stable version of yarn for your platform from the yarn website⁠

⁠Building and Running

In order to build the project, do the following:

yarn
yarn build identity      # to build the identity service

A successful build is required for any pull request to get merged.

In order to run the project, do the following

yarn start identity      # to run identity in development mode
⁠Linting

This project uses eslint⁠ and prettier⁠ for linting and code quality checks. A successful lint is required for any pull request to get merged.

yarn lint
yarn lint:fix       # to fix what the tool can
⁠Docker Image

To build the image of a microservice, you can pass the PLATFORM_APP as a build arg. For example, to build the identity image, run:

⁠Building
 docker build --build-arg PLATFORM_APP=identity -t identity .

To spin up the container:

⁠Running
docker run -it --rm \
    --env NODE_ENV=development \
    --NODE_CONFIG='{"authentication":{"cookie":"X-Kloudio-Authentication","crypto":{"algorithm":"sha256","key":"defaultKey"},"jwt":{"secret":"defaultKey","signOptions":{"expiresIn":"86400s"}},"sso":{"clientRedirect":"http://localhost:4200/dashboards","serverCallback":"http://localhost:3000/v1/users/login","okta":{"serverUrl":"https://dev-642472.okta.com/oauth2/default"}}},"database":{"type":"postgres","host":"localhost","port":5432,"username":"kloud","password":"password","database":"kloudio"},"port":3000,"redis":{"database":"platform","host":"localhost","port":6379,"cacheConfig":{"session:default":{"expiresIn":86400},"state:okta":{"expiresIn":60}}}}' \
    --name identity -p 3000:80 identity:latest
Tag summary
Recent tags
Content type
Image
Digest
Size
95.4 MB
Last updated
about 6 years ago
docker pull kloudio/platform-identity:latest