Main API built with NestJS + TypeOrm, requires a running Postgres Database + Redis
$ npm install
# development
$ npm run alcs:start
# watch mode
$ npm run {env}:start:dev
# production mode
$ npm run {env}:start:prod
Create test.json (you could copy values from default.json and tweak them as needed)
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
# create empty migration file:
npm run alcs:migration:create --name=<file_name>
# generate migrations:
npm run alcs:migration:generate --name=<file_name>
# apply migration:
npm run alcs:migration:run
# revert migration
npm run alcs:typeorm migration:revert
Postgres unit tests are implemented using pgTap.
# run tests
docker-compose up --build pgtap
nestjs Bull use this link for validating/generating cron expressions crontab.cronhub.io
npm run graph
Paste console output into https://mermaid-js.github.io/mermaid-live-editor and configure
NOTE: ALL DATES ON API MUST BE OF TYPE DATE IN UTC
NOTE: ALL DATES IN DB MUST BE TIMESTAMPTZ IN UTC
Server communication between ALCS server and Portal server is performed using gRPC. gRPC uses protocol buffers (*.proto) as both its Interface Definition Language (IDL) and as its underlying message interchange format.
ALCS and Portal support mutual TLS to ensure secure communication. TLS also enabled for local environment using the self-signed certificates included in the source code. If you need to generate new set of certificates or learn more about the process refer to certstrap
TS implementation of *.proto files can be provided manually or generated using ts-proto tool
- Install & add open shift to path
- Login to with token from silver cluster
- Set preferred project
oc project NAMESPACE
- Forward port, usually 5432
oc port-forward service/alcs-patroni 5432:5432
- Add new connection to app with preferred DB tool (DBeaver, TablePlus)
- Backup DB & save dump file. ensure postgresql 12.x is selected
- Stop port forwarding
- Connect to local DB
- In DB tool select restore for app DB
- Select file to restore from
- Ensure postgresql 12.x being used
- If databse does not exist, example app, select create option
Navigate to this README on how to access API Logs