Chat up.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them
Node@v12.x.x
PostgreSql@11.x
Variable | Description | Example |
---|---|---|
SERVER_PORT | Set this variable to run your app on this port | 3002 |
DB_CONNECTION_STRING | This variable is used to connect with database | dialect://username:password@host:port/database_name |
A step by step series that will tell you how to get a development env running
$ cd server
$ npm ci
A step by step series to run application via using docker-compose command
-
Use the following link to setup
docker-compose
on different operating system click here to check docker-compose installation commands for your operating system -
Run the following command to build a docker image for application
#!/bin/bash
cd ops/local
sudo chmod a+x build.sh
./build.sh
Use the following commands to check/start/stop running docker containers/images on your local machine
#!/bin/bash
docker ps -aq
#!/bin/bash
docker stop $(docker ps -aq)
docker stop <container-id> --- stop single running container
#!/bin/bash
docker rm $(docker ps -aq)
docker rm <container-id> --- remove single stopped container
#!/bin/bash
docker rmi $(docker images -q)
docker rmi <image-id> --- remove single docker image
#!/bin/bash
docker-compose ps
#!/bin/bash
docker-compose ps -q <service_name>
#!/bin/bash
docker-compose kill
Create Database:
$ node_modules/.bin/sequelize db:create --url 'dialect://username:password@host:port/database_name'
keyword | Example | Description |
---|---|---|
dialect | postgres | Database we are using |
username | root | Username for the database |
password | postgres | Password for the database |
host | localhost/IP | Host on which database is running |
port | 5432 | Port for the database |
database_name | sample_database | Database name for the microservice |
Create Migrations:
$ node_modules/.bin/sequelize migration:create --name migration_name
Run Migrations:
$ node_modules/.bin/sequelize db:migrate --url 'dialect://username:password@host:port/database_name'
keyword | Example | Description |
---|---|---|
dialect | postgres | Database we are using |
username | root | Username for the database |
password | postgres | Password for the database |
host | localhost/IP | Host on which database is running |
port | 5432 | Port for the database |
database_name | sample_database | Database name from which migrations will happen |
- For Development
$ npm run start:dev
- For Production
$ npm run start
$ npm run test
$ npm run test-nsp
$ npm run test-lint