https://github.com/ahmadjoya/typescript-express-mongoose-starter
The TypeScript Express Mongoose Starter is a powerful boilerplate for TypeScript web applications. It combines Express.js, TypeScript, and Mongoose to create robust and scalable projects. With its best practices and solid foundation, it makes starting TypeScript-based Express projects a breeze.
https://github.com/ahmadjoya/typescript-express-mongoose-starter
boilerplate boilerplate-template docker eslint express jest mongoose nginx-reverse-proxy pm2 prettier starter swagger-ui swc typescript user-authentication
Last synced: 5 days ago
JSON representation
The TypeScript Express Mongoose Starter is a powerful boilerplate for TypeScript web applications. It combines Express.js, TypeScript, and Mongoose to create robust and scalable projects. With its best practices and solid foundation, it makes starting TypeScript-based Express projects a breeze.
- Host: GitHub
- URL: https://github.com/ahmadjoya/typescript-express-mongoose-starter
- Owner: ahmadjoya
- Created: 2023-05-21T12:45:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-16T06:13:52.000Z (over 1 year ago)
- Last Synced: 2025-05-31T10:59:58.557Z (20 days ago)
- Topics: boilerplate, boilerplate-template, docker, eslint, express, jest, mongoose, nginx-reverse-proxy, pm2, prettier, starter, swagger-ui, swc, typescript, user-authentication
- Language: TypeScript
- Homepage:
- Size: 189 KB
- Stars: 87
- Watchers: 1
- Forks: 28
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
TypeScript Express Mongoose Starter
🚀 Express RESTful API Boilerplate with TypeScript and Mongoose
## 😎 Introduction
The TypeScript Express Mongoose Starter is a comprehensive boilerplate for building robust and scalable web applications using the TypeScript programming language, Express.js framework, and Mongoose ORM for MongoDB. It provides a solid foundation and a set of best practices to kickstart your TypeScript-based Express projects with ease.
## Features
- **TypeScript:** Enjoy the benefits of static typing, enhanced code maintainability, and better developer tooling with TypeScript.
- **Express.js:** Build powerful and flexible web APIs using the popular Express.js framework.
- **Mongoose:** Utilize the elegant MongoDB object modeling library Mongoose for seamless integration with MongoDB databases.
- **User Authentication:** Includes a pre-configured user authentication system with password hashing using bcrypt and JWT-based authentication.
- **API Documentation:** Generate API documentation effortlessly with Swagger and Swagger UI integration.
- **Error Handling:** Implement centralized error handling and consistent error responses across your application.
- **Environment Configuration:** Manage your application's configuration using environment variables with the help of the dotenv library.
- **Linting and Formatting:** Maintain clean and consistent code with ESLint and Prettier pre-configured.
- **Testing with Jest:** Write unit tests and run them using the Jest testing framework.
- **Docker Integration:** Easily containerize your application using Docker for simplified deployment and scalability.
- **Nginx Reverse Proxy:** Set up Nginx as a reverse proxy to enhance performance, security, and load balancing capabilities.
- **Process Management:** Utilize PM2 or Nodemon for process management and automatic application restarts during development and production.
- **SWC Compiler:** Utilize the SWC compiler for faster TypeScript compilation and improved performance.## ⚒ How to Install
To create a new project using this starter template, you can use `npx` to quickly scaffold the project. if you don't write the project name yourself, default name typescript-express-mongoose-starter will be used.
```bash
$ npx typescript-express-mongoose-starter
```
Alternatively, you can clone the repository and install the dependencies:```bash
$ git clone https://github.com/ahmadjoya/typescript-express-mongoose-starter.git
$ cd typescript-express-mongoose-starter
$ npm install
```
## ConfigurationBefore starting the project, make sure to set up your database credentials in the `.env.development.local` file. This file is used for local development and should not be committed to version control. Here's an example of how the `.env.development.local` file should be structured:
### Database Configuration
- **DB_HOST=** 127.0.0.1
- **DB_PORT=** 27017
- **DB_DATABASE=** dev
- **LOG_FORMAT=** dev
- **LOG_DIR=** ../logs## ⭐️ Stargazers
[](https://github.com/ahmadjoya/typescript-express-mongoose-starter/stargazers)
## 🍴 Forkers
[](https://github.com/ahmadjoya/typescript-express-mongoose-starter/network/members)
## ContributionsContributions, bug reports, and feature requests are always welcome! If you encounter any issues or have ideas to improve the starter template, please feel free to open an issue or submit a pull request on the [GitHub repository](https://github.com/ahmadjoya/typescript-express-mongoose-starter).