A minimal and well-structured Node.js project template to speed up development.
Node.js-Starter-Template/
|
โโโ README.md # Project documentation
โโโ src/ # Main application source code
โโโ api/ # API-related files
โ โโโ controllers/ # Controllers (handling requests)
โ โโโ routes/ # Route definitions
โโโ app.js # Main app entry point
โโโ config/ # Configuration files
โ โโโ index.js # Environment variables and configurations
โ โโโ init.js # Middleware and error handling setup
โโโ middleware/ # Middleware functions
โโโ models/ # Database models
โโโ package.json # Project metadata & dependencies
โโโ package-lock.json # Lockfile for dependencies
โโโ server.js # Server setup
โโโ services/ # Business logic services
โโโ tests/ # Unit and integration tests
โโโ utils/ # Utility functions
โโโ asyncErrorHandler.js # Async error handling utility
โโโ CustomError.js # Custom error handling class
-
Clone the repository
git clone https://github.com/OsamaRab3/Node.js-Starter-Template.git cd Node.js-Starter-Template -
Install dependencies
cd src npm install -
Run the application
npm start
If you want to create a new project from this template without cloning the Git history, use degit:
-
For JavaScript version:
npx degit OsamaRab3/Node.js-Starter-Template#master my-new-project cd my-new-project/src npm install -
For TypeScript version:
npx degit OsamaRab3/Node.js-Starter-Template#ts my-new-project cd my-new-project/src npm install npx ts-node server.ts
โ
Predefined project structure
โ
Organized folders for maintainability
โ
Ready for Express.js backend development
โ
Simple and easy-to-use starter template
โ
Built-in error handling and middleware support