A lightweight and extensible Express.js + TypeScript template to kickstart your Node.js projects faster and cleaner. Stop repeating boilerplate code every time you start a new project.
- ✅ TypeScript support
- ✅ Project structure with clear separation of concerns
- ✅ Environment variables support with
dotenv
- ✅ Logging via
winston
- ✅ Security best practices using
helmet
andcompression
- ✅ Alias support (
@/
forsrc/
) - ✅ Ready to scale and extend
src/
├── common/ # common module
└── enums # constants app
└── exception # error handling
└── middlewares # custom middleware
└── typeDefinitions # suggestion for developer env
└── utils # utility function for app
├── config/ # Configuration files and Database
└── databases # configuration database
└── config.ts # configuration environment variables
├── middlewares/ # Custom middlewares
|── modules/ # app module
└── app.ts # Express app setup
└── index.ts # Server bootstrap
- Clone the repository:
git clone git clone https://github.com/Hossein-Falah/express-templete.git your-project-name
cd your-project-name
- Install dependencies:
./bash.sh
or
npm install
- Set up environment variables:
- Create a .env file in the root directory.
- Add the following variables:
APP_URL=http://localhost:
PORT=3000
MONGO_URL=mongodb://localhost:27017/mydatabase
NODE_ENV=development
- Run the server:
npm run dev:ts
npm run dev
Contributions are welcome! To contribute, follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
- Make your changes.
- Commit your changes:
git commit -m 'Add some feature'
- Push your changes:
git push origin feature/YourFeature
- Open a pull request. After your pull request is reviewed and approved, it will be merged into the main branch.
This project is licensed under the MIT License. See the LICENSE file for more information.