• Stars
    star
    403
  • Rank 107,140 (Top 3 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Node Typescript Boilerplate for Microservices. Skeleton for Node.js Apps written in TypeScript (with Setup Instructions for ESLint, Prettier, and Husky)

Node-Typescript-Boilerplate Quality Gate Status

Skeleton for Node.js applications written in TypeScript

Purpose

Our main purpose with this Skeleton is to start server application with node js and typescript.

Try it!! I am happy to hear your feedback or any kind of new features.

Common Features

  • Quick start
  • Integrated eslint, prettier and husky
  • Global Error & Response Handler
  • Simple and Standard scaffolding
  • Based on Typescript Syntax
  • Simple & Global Enviroment Configuration
  • Request/Response Encryption & Decryption Implementation
  • Easily Add new feature
  • Integrated winston Logger
  • Production Ready Skeleton
  • Follwed Production Ready Best Practices: Security
  • Added only used npm modules
  • Swagger Documentation Support
  • Unit & Integration Test Cases

Core NPM Module

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

Start the application

Workflow

Start The application in Development Mode

  • Clone the Application git clone https://github.com/santoshshinde2012/node-boilerplate.git
  • Install the dependencies npm install
  • Start the application npm run start:local

Start The application in Production Mode

  • Install the dependencies npm install
  • Create the build npm run build
  • Start the application npm run start:production
  • Before starting make sure to creat prod environment .env.prod file

Project Structure

Name Description
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/environments Application Environments Handling utility
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

Workflow

Workflow

Encryption

Set the APPLY_ENCRYPTION environment variable to true to enable encryption.

Global Environment Object

You can directly access the environment attributes in any component/file using global environment object. For more details please check file src/global.ts.

Example

To access the applyEncryption attribute from Envionment class to Response Handler, write environment.applyEncryption;

Swagger API Documentation

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

http://localhost:3146/docs

Default System Health Status API

  • ${host}/api/status/system - Return the system information in response
  • ${host}/api/status/time - Return the current time in response
  • ${host}/api/status/usage - Return the process and system memory usage in response
  • ${host}/api/status/process - Return the process details in response
  • ${host}/api/status/error - Return the error generated object in response

Swagger API Documentation

Refrences

Notes

1. Why is my git pre-commit hook not executable by default?

  • Because files are not executable by default; they must be set to be executable.
chmod ug+x .husky/*
chmod ug+x .git/hooks/*

2. Production Best Practices: Security

  • Don’t use deprecated or vulnerable versions of Express
  • Use TLS
  • Use Helmet
  • Use cookies securely
  • Prevent brute-force attacks against authorization
  • Ensure your dependencies are secure
  • Avoid other known vulnerabilities
  • Additional considerations

3. Tutorials


Please connect with me on Twitter @shindesan2012 & https://blog.santoshshinde.com

More Repositories

1

micro-frontends-mindmaps

A mindmap summarising micro-frontends concepts
39
star
2

reactjs-jointjs-example

This is basic demo application, to combining react.js with JointJS.
CSS
31
star
3

nestjs-mindmaps

A mindmap summarising nestjs concepts
26
star
4

react-redux-typescript-boilerplate

Skeleton for React & Redux Apps written in TypeScript (with integrated SASS, ESLint, Prettier, and Husky)
TypeScript
14
star
5

ng-keycloak

ng-keycloak
TypeScript
6
star
6

FullscreenVideo

Display Fullscreen Video in Landscape Mode in Ionic App
JavaScript
5
star
7

node-braintree-integration

Node-Typescript-Braintree-Integration
TypeScript
5
star
8

multi-factor-authentication

2FA TOTP implementation using Node.js, TypeScript, and React.js
TypeScript
5
star
9

node-ts-sequelize-pg-boilerplate

NodeSeQ - Node Typescript Sequelize PostgreSQL Boilerplate
TypeScript
5
star
10

braintree-react-typescript

Braintree React Typescript
TypeScript
4
star
11

tyk-keycloak-demo

Basic demoto integrate tyk gateway open source with keycloak
4
star
12

architecture-learning-path

4
star
13

tyk-keycloak-middleware

This is the starter for keycloak and tyk middleware using Javascript
JavaScript
3
star
14

FileTransfer_Upload

This is Ionic and Cordova Based project to File Transfer and Upload from application with server side code in php
JavaScript
3
star
15

Android-Malware-Detection

Java
2
star
16

MEA2N

This is basic mean application. The MEA2N stack includes MongoDB, Express, Angular2 and Node.js.
JavaScript
2
star
17

JWTWithNodeSampleDemo

JavaScript
2
star
18

santoshshinde2012

Github profile with blog feeds and github statistics
2
star
19

sonarqube-node-typescript-demo

Demo to run SonarQube locally for Node TypeScript Project
TypeScript
2
star
20

extension

A simple Chrome extension built with React.js to search bookmarks
TypeScript
2
star
21

my-learnings

1
star
22

streamlit-crop-disease-risk-prediction

This application predicts the risk of crop disease based on the entered crop details.
Python
1
star
23

forum

HTML
1
star
24

nestjs-micro

1
star
25

Angular2ImageCropper

Angular image cropper sample demo
TypeScript
1
star
26

react-typescript-flight-search

react-typescript-flight-search
TypeScript
1
star
27

microfrontend-example

JavaScript
1
star
28

ShareInIonic

Share images, text, messages via Facebook, Twitter, Email, SMS, WhatsApp, etc With ng-cordova in Ionic Framework
JavaScript
1
star
29

vue-boilerplate

A boilerplate for medium to large Vue JS single page applications
JavaScript
1
star
30

portfolio

portfolio app
JavaScript
1
star
31

jest-to-sonar

Convert the Jest test case report to a Sonar generic test execution report. 
TypeScript
1
star
32

weather-app

A React web app to get a five-day forecast in your favorite cities.
JavaScript
1
star
33

node-ts-sequelize-boilerplate

Node Typescript Sequelize Boilerplate
TypeScript
1
star
34

node-ts-knex-boilerplate

Node-Typescript-Knex-Boilerplate
TypeScript
1
star