All Projects → shadowhijackers → node-js-starter-kit

shadowhijackers / node-js-starter-kit

Licence: GPL-3.0 license
This is the starter kit project for node js REST API development with express js, mongodb, typescript, webpack specially designed for REST API projects.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to node-js-starter-kit

Webpack React Boilerplate
Minimal React 16 and Webpack 4 boilerplate with babel 7, using the new webpack-dev-server, react-hot-loader, CSS-Modules
Stars: ✭ 358 (+2457.14%)
Mutual labels:  jest, webpack4
Nodejs Backend Architecture Typescript
Node.js Backend Architecture Typescript - Learn to build a backend server for Blogging platform like Medium, FreeCodeCamp, MindOrks, AfterAcademy - Learn to write unit and integration tests - Learn to use Docker image - Open-Source Project By AfterAcademy
Stars: ✭ 1,292 (+9128.57%)
Mutual labels:  jest, expressjs
Js Stack From Scratch
🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
Stars: ✭ 18,814 (+134285.71%)
Mutual labels:  jest, pm2
React Redux Boilerplate
Awesome React Redux Workflow Boilerplate with Webpack 4
Stars: ✭ 307 (+2092.86%)
Mutual labels:  jest, webpack4
Express Typescript Boilerplate
A delightful way to building a RESTful API with NodeJs & TypeScript by @w3tecch
Stars: ✭ 2,293 (+16278.57%)
Mutual labels:  jest, expressjs
Pwa
An opinionated progressive web app boilerplate
Stars: ✭ 353 (+2421.43%)
Mutual labels:  jest, pm2
Push Starter
React Redux Starter with SSR 🤖
Stars: ✭ 43 (+207.14%)
Mutual labels:  jest, webpack4
Splain
small parser to create more interesting language/sentences
Stars: ✭ 15 (+7.14%)
Mutual labels:  jest, webpack4
Js Stack Boilerplate
Final boilerplate code of the JavaScript Stack from Scratch tutorial –
Stars: ✭ 145 (+935.71%)
Mutual labels:  jest, pm2
React Redux Bootstrap Webpack Starter
React 16.9 + Typescript + React-Router 4 + Redux + Bootstrap 4 + Hot Reload + redux-devtools-extension + Webpack 4 + styled-components STARTER
Stars: ✭ 133 (+850%)
Mutual labels:  jest, webpack4
ahobsu-node-backend
🌈 MOTI ! Make Own True Identity ⭐️ 유니큐와 유초코파이 노드로 탈주하다😎
Stars: ✭ 16 (+14.29%)
Mutual labels:  jest, pm2
GoBarber
💈 Aplicação de agendamento para serviços de beleza, entre provedores e clientes.
Stars: ✭ 84 (+500%)
Mutual labels:  expressjs, solid-principles
fullstack-template
This is a template repository to get up and running quickly with Vite, React, Jest, Express Docker, and Github Actions for CI/CD.
Stars: ✭ 14 (+0%)
Mutual labels:  jest, supertest
coconat
🍥 StarterKit Builder for rocket-speed App creation on 🚀 React 17 + 📙 Redux 4 + 🚠 Router 5 + 📪 Webpack 5 + 🎳 Babel 7 + 📜 TypeScript 4 + 🚔 Linters 23 + 🔥 HMR 3
Stars: ✭ 95 (+578.57%)
Mutual labels:  jest, webpack4
rr-boilerplate
A lightweight React&Redux boilerplate
Stars: ✭ 35 (+150%)
Mutual labels:  jest, webpack4
Express Babel
Express starter kit with ES2017+ support, testing, linting, and code coverage
Stars: ✭ 621 (+4335.71%)
Mutual labels:  jest, expressjs
React Express Webpack
React boilerplate with ES2015, Express.js, and Webpack 4
Stars: ✭ 84 (+500%)
Mutual labels:  expressjs, webpack4
React Pwa
An upgradable boilerplate for Progressive web applications (PWA) with server side rendering, build with SEO in mind and achieving max page speed and optimized user experience.
Stars: ✭ 2,433 (+17278.57%)
Mutual labels:  expressjs, webpack4
React Bootstrap Webpack Starter
ReactJS 16.4 + new React Context API +react Router 4 + webpack 4 + babel 7+ hot Reload + Bootstrap 4 + styled-components
Stars: ✭ 103 (+635.71%)
Mutual labels:  jest, webpack4
Nodebestpractices
✅ The Node.js best practices list (December 2021)
Stars: ✭ 72,734 (+519428.57%)
Mutual labels:  jest, expressjs

Node JS Starter kit in SOLID Architecture.

Introduction

This is the starter kit project for node js with typescript programming. This project is with express js and mongoose frameworks to build a Rest APIs. This project structure also support with multiple API protocalls also we build the project with unit testing for end points and logic codes by supertest and jest.

This project also example for best practice node js application

Project structure explanations:

  1. api - Write api codes like rest, graphql, socket
  2. common - Write common functions to be usable for all the modules 
  3. config - Write App config code
  4. code - Write Application core level code like engine of your 
            your project, service providers 
  5. models - Wirte database collection models
  6. loaders - Write your application modueles and load dependcy of app
  7. services - Write application logics
  8. subscribers - Write Event subscriber code
  9. types - Write application types like interfaces, absracts
  10. __test__  - Write jest unit testing code. 

Core Concepts of this application.

Node Js is run time environment for javascript which built on V8 Javascript engine. Its Single thread non blocking IO programming
environment and its intepreted language. Which uses the javascript to run a servers. javascript is dynamic programming language. There is no type defention and less OOPS features for its programming. So Choosing Typescript for developing node js application which will increase the productivity and easy to write reusable code.

This application is mainly design for develop a secured, low latency swagger friendly (not yet implemented for swagger) and strong implementation.

We everyone know javascript is a single thread application. So Writing perfomable app is very difficult compare than the other multi thread programming. However its offer a non blocking IO So we can able to delivering resources to endpoints is make fast as possible as per writing javascript asynchronus coding styles and event emiters. So Here we are using async and Event dispatchers.

Case Study:
     We are writing api for user registration. In this endpoint logic 
   we are writting the code for user registration if the user data 
   valid the we will send confimation email and return responses. 
   Here we can write send the email confirmation in event emmiter when 
   the user data valid then write the api to return response and emit the
   user data to send the email confirmation in background.  

We can write the async packages to handle the complex asynchronus calls parallely and series

To reduce the latency of an endpoints response we are not added the common middleware like body parser. which added in particularly api calls only. So other API calls can make faster.

Write Test driven development Its an common approach from most of the developers. Writing an unit testing for project it will make you more confident to deployment and do not allow your code run in production if it not tested.
Here we are using jest and supertest for endpoints. Use seperate db for unit testing environment.

We are added the pm2 server cofiguration here to run this application in cluster mode to speed up the api calls. We are setting the environmetn varibales for only in development and testing not added for production. Which added in pm2 server So it give an extra layer security for an app. include the pm2-server file in your cloud instance itself. here we added for example.

Use HTTPS/SSL for security, We added helmet and cors setup for improving the security purpose. Adding the secure level module in the middleware only never going to be make your application more secure its about how you are writing also to be consider. use csurf for prevent the CSRF attack.

   Case Study:
      I have seen one web application there they written one api call for the 
    loginned User details by passing id in http query. Even that  id is in number format
    as 1001 when we changed the 1001 to 1002 it gave the details of another uses
    details. They can get the another user deta. Its became a CSRF loophole. They can get
    the data by any otherways like JWT token or Auth token. So Writing the code is need
    to be secured manner. Poor way of coding become a loophole.

Don't make user ids in readable formats. its will helpful to enumrate the other user. Study more about security improvement in OWSAP

Use Rate Limitter for avoid DDoS , brute force attack and dictionary attack on form datas like signin, OTP cracking. We are already using the Helmet it will prevent some browser level attack.

To imporve the low latency of IO calls we are using the Event emitters, async calls for parallel and series asynchronus process.

This project is refered from the following blog and some documents. Reference

Note : This project still in construction mode

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].