- Install Node v19.5+
In the project directory, perform the following steps:
npm installAdd the following envs:
GITHUB_APP_INSTALLATION_ID
GITHUB_APP_IDENTIFIER
PRIVATE_KEY
CLIENT_ID
GITHUB_CLIENT_SECRET
ORG_NAME
jwtPrivateKey
DB_PORT
DB_NAME
DB_USER
DB_PASSWORD
DB_HOST- Install PostgresSQL server locally by following the instructions here.
- Start the local PostgreSQL server using the following command
pg_ctl -D /usr/local/var/postgres start - Create the database using the following command
createdb <DATABASE_NAME> - As mentioned in the Environment Variable configuration section, update the environment variables values with relevant database user, password, and username.
- Run the migrations using the following command
$ npm migrate:up
# development
$ npm start
# watch mode
$ npm start:dev-
Create a new migration
$ npm --name <migration_name>
-
Run the migrations
$ npm migrate:up
-
Revert the last executed migration
$ npm migrate:down
-
Create a new seeder
$ npm seed:create --name <migration_name>
-
Seed the data
$ npm seed:up
-
Revert the most recent seed
$ npm seed:down
# unit tests
$ npm test
# test coverage
$ npm test:coverage| Feature | Package |
|---|---|
| Package Manager | npm |
| NodeJs | 19.5.x |
| PostgreSQL | 13 |
| Linting | Eslint-Recommended |
| Unit Test | Jest |
| Code Analysis | SonarQube |
| ORM | Sequelize |
- Singular form for naming tables and columns.
- snake_case for table names.
- Lowercase for database table and column names and camelCase for model/entity name.
- camelCase for naming keys in response.
- joi schema for requests with payloads.
- API/Swagger specification and description for every route.
./.env.sampleto be updated when adding new environment variables.- fk*
table_name__<key1>*<key2>template to create foreign keys - pk*
table_name__<key1>*<key2>template to create compound primary keys
- NodeJS (v19.5.x)
- PostgresSQL (v13.x), a open-source relational database management system.
- Sequelize