The :cloud: Kloud Platform
To begin using this project in a local development environment please follow the steps below.
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.
Install Docker and Docker Compose from the the here. Currently, the Platform depends on the following services to run:
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
Install the latest version of NodeJS 12.x from the Node website or by using your platform's Node version manager.
Install the latest stable version of yarn for your platform from the yarn website
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
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
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:
docker build --build-arg PLATFORM_APP=identity -t identity .
To spin up the container:
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
docker pull kloudio/platform-identity:latest