A boilerplate project to get you started with building scalable and maintainable Node.js applications using Express.js, TypeScript, and MongoDB.
- 🚀 Quick Setup: Get your backend project up and running in no time.
- 📚 Learn by Example: A well-structured codebase to help beginners understand best practices.
- ⚡ TypeScript Ready: Modern JavaScript with static typing for better code quality.
- 🗄️ MongoDB Integration: Preconfigured connection and basic CRUD operations.
- 🧩 Modular Architecture: Clean, scalable project structure.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/rawbinn/Express.js-TypeScript-MongoDB-Starter.git cd express-typescript-mongodb-starter -
Install dependencies:
npm install # or yarn install -
Create a .env file in the root directory and add your configuration:
PORT=3000 MONGO_PATH=mongodb://localhost:27017/your-database-name -
Start the development server:
npm run dev # or yarn dev
To edit environment variables, create a file with name .env and copy the contents from .env.sample to start with.
| Var Name | Type | Default | Description |
|---|---|---|---|
| NODE_ENV | string | development |
API runtime environment. eg: production |
| PORT | number | 3000 |
Port to run the API server on |
| MONGO_PATH | string | mongodb://localhost:27017/your-databse-name |
URL for MongoDB |
| ACCESS_TOKEN_SECRET | string | secret |
JWT Token's Secret Key |
If you come across any issues please report them here.
Contributions are welcome! If you’d like to improve the project or add features please feel free to make any pull requests.
This project is licensed under the MIT License.