Skip to content

Latest commit

 

History

History
152 lines (116 loc) · 7.94 KB

File metadata and controls

152 lines (116 loc) · 7.94 KB

Node boilerplate with secure code analysis and quality checks

Quality Gate Status Github action workflow status maintainability test_coverage

Introductions

Common Features

  • Quick start

    • Simple scaffolding based on Typescript syntax
    • Easy global environment configuration and error handling
    • Flexible for adding new features
  • Continuous Integration

  • Documentation Standards

    • Swagger documentation support and Postman collections
    • Clear instructions in the readme file
  • Test Coverage Maintenance

    • Comprehensive test coverage with eslint, prettier, and husky integration
  • Production Ready Setup

    • Followed best practices for security and efficiency
    • Integrated Winston Logger and included only necessary npm modules

Core NPM Module

  • express, @types/express
  • @types/node
  • typescript
  • dotenv
  • cors
  • helmet
  • http-status-codes
  • 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 public workspace.

Swagger API Documentation

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

http://localhost:8080/docs

Wiki

Refrences


Connect with me on