Skip to content

Latest commit

 

History

History
74 lines (48 loc) · 1.63 KB

01-code-setup.md

File metadata and controls

74 lines (48 loc) · 1.63 KB

Procedure for Code Setup and Installation

Pull the code

Clone the Github repository to your local filesystem

git clone https://github.com/ChakshuGautam/cQube-POCs.git

Start Docker Instances

Change your current directory to the cloned repository

cd cQube-POCs

Start the Docker Network and the Instances

docker-compose up -d

This creates the cqube-pocs network and instances of timescaledb, graphql-engine and pgbool images.

Install dependencies

Once this is done change your current directory to impl/c-qube

cd impl/c-qube

Create the environment (.env) file for connecting to the timescaledb docker instance.

touch .env
echo "DATABASE_URL="postgres://timescaledb:postgrespassword@localhost:5432/postgres?sslmode=disable"" > .env

Install all the necessary yarn dependencies (while staying within the impl/c-qube folder)

yarn install

You can use the build command in case you would like to build the Nest project.

yarn build

Run Migrations and Set Up Database Schemas

Now that we have our yarn dependencies installed we can go ahead and run migrations to migrate our schemas to our locally running docker database instance (while staying within the impl/c-qube folder).

npx prisma migrate dev

Testing and Coverage

Tests can be run in order to check for breaking or unintentional changes in the code by running the following command.

yarn test

Similarly the developer can also test the percentage of code coverage that the current testing suite provides via the following command.

yarn test:cov