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.
-
Quick start
- Simple scaffolding based on Typescript syntax
- Easy global environment configuration and error handling
- Flexible for adding new features
-
Contiuous Integration
- Added Github Action Workflow
- sonarcloud.io
- snyk.io
- CodeQL
- njsscan is a static application testing (SAST) tool that can find insecure code patterns in your node.js applications
- Codeclimate
- Added Github Action Workflow
-
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
-
express
,@types/express
-
@types/node
-
typescript
-
dotenv
-
cors
-
helmet
-
http-status-codes
-
winston
- Clone the Application
git clone https://github.com/santoshshinde2012/node-boilerplate.git
- Install the dependencies
npm install
- Start the application
npm run dev
- 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
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/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 |
Set the APPLY_ENCRYPTION
environment variable to true
to enable encryption.
The swagger documentation is available at the following url ${host}/docs
:
${host}/api/system/info
- Return the system information in response${host}/system/time
- Return the current time in response${host}/system/usage
- Return the process and system memory usage in response${host}/system/process
- Return the process details in response${host}/system/error
- Return the error generated object in response
- Skeleton for Node.js Apps written in TypeScript
- Setup Eslint Prettier and Husky in Node JS Typescript Project
- Because files are not executable by default; they must be set to be executable.
chmod ug+x .husky/*
chmod ug+x .git/hooks/*
- 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
- Skeleton for Node.js Apps written in TypeScript (with Setup Instructions for ESLint, Prettier, and Husky)
- Global Error and Response Handler in Node JS with Express and Typescript
- Testing with Jest in TypeScript and Node.js for Beginners
- Static Code Analysis for Node.js and TypeScript Project using SonarQube
- Visualization of Node.js Event Emitter