/node-ts-sequelize-pg-boilerplate

NodeSeQ - Node Typescript Sequelize PostgreSQL Boilerplate

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Node boilerplate with secure code analysis and quality checks: NodeSeQ is a boilerplate for building Node.js apps using TypeScript and the Sequelize ORM.

Introductions

Common Features

  • Quick start

    • Simple and Standard scaffolding
    • Based on Typescript Syntax
    • Simple & Global Enviroment Configuration
    • Global Error & Response Handler
    • Easily Add new feature
  • Contiuous Integration

  • Documentation Standards

    • Swagger Documentation Support
    • Postman Collections
    • Readme with instructions
  • Test Coverage Maintenance

    • Integrated eslint, prettier and husky
    • Added Unit Test cases and Intgration Test Cases
    • 80% + Code Coverage
  • Codeclimate Integration with Github action workflow

  • Prodcution Ready Setup

    • Follwed Production Ready Best Practices: Security
    • Integrated winston Logger
    • Added only used npm modules

Core NPM Module

  • express, @types/express
  • @types/node
  • typescript
  • dotenv
  • cors
  • helmet
  • http-status-codes
  • winston, @types/winston
  • sequelize, pg, pg-hstore

Start The application in Development Mode

  • Clone the Application git clone https://github.com/santoshshinde2012/node-ts-sequelize-pg-boilerplate.git
  • Install the dependencies npm install
  • Start the application npm run dev
  • To run the test cases npm run test

Pre requisite

  • To run this app on a local machine, make sure the PostgreSQL database is set up and running. If not, you can use Docker and execute the following command to run the database: npm run db:up

Start The application in Production Mode

  • Install the dependencies npm install
  • Create the build npm run build
  • Start the application npm run start
  • Before starting make sure to update your .env values for your refrence just check .env.example

Project Structure

Project Structure

Name Description
docker/ Docker related config for postgresql db
wiki/ You can add project documentation and insructions file here
src/ Source files
src/abstractions Abstarct classes and Interfaces
src/components REST API Components & Controllers
src/database Database config and models
src/lib Reusable utilises and library source code like a logger
src/middleware/ Express Middlewares like error handler feature
build/ Compiled source files will be placed here
tests/ Test cases will be placed here
tests/helpers/ Helpers for test cases will be placed here
tests/unit-tests/ Unit Test cases will be placed here
tests/integration-tests/ API routes (Integration) Test cases will be placed here

Postman Collections

The Postman Collections is available in wiki/postman folder.

Swagger API Documentation

The swagger documentation is available at the following url ${host}/docs:

http://localhost:8080/docs

Refrences


Connect with me on