https://github.com/dev-relax/express-template-quickstart
A lightweight, ready-to-use boilerplate for building TypeScript + Express backends with security and modular structure β clone, configure, and start coding your API features right away.
https://github.com/dev-relax/express-template-quickstart
authentication boilerplate csrf express jsonwebtoken mongodb mongoose nodejs rest-api security typescript
Last synced: 3 months ago
JSON representation
A lightweight, ready-to-use boilerplate for building TypeScript + Express backends with security and modular structure β clone, configure, and start coding your API features right away.
- Host: GitHub
- URL: https://github.com/dev-relax/express-template-quickstart
- Owner: Dev-Relax
- License: mit
- Created: 2025-10-27T11:23:52.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-27T14:16:53.000Z (8 months ago)
- Last Synced: 2025-10-27T14:36:44.566Z (8 months ago)
- Topics: authentication, boilerplate, csrf, express, jsonwebtoken, mongodb, mongoose, nodejs, rest-api, security, typescript
- Language: TypeScript
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π Express Template Quickstart
*A lightweight, ready-to-use boilerplate to jumpstart your Express.js + TypeScript + auth + security backend projects.*
[](https://www.typescriptlang.org/)
[](https://nodejs.org/)
[](https://expressjs.com/)
[](https://www.mongodb.com/)
[](LICENSE)
## π§ Table of Contents |
- [About](#-about)
- [Features](#-features)
- [Quickstart](#-quickstart)
- [Structure](#-structure)
- [Contributing](#-contributing)
- [Feedback and Contributions](#-feedback-and-contributions)
- [License](#-license)
## π§ About the Project
As a web developer, I got tired of retyping the same Express boilerplate for every new project.
**So I decided to build my own clean, modular, and secure template** β a solid foundation to **quickstart any backend** without wasting time reinventing setup, structure, or config.
This template comes ready with TypeScript, Express, security middlewares, logging, and best practices.
Clone it, configure it, and start coding your features immediately.
## β¨ Features
* **π§© TypeScript support** β modern syntax, type safety, and scalability
* **β‘ Express 4.18** β minimal and fast web framework for Node.js
* **π‘οΈ Security ready** β Helmet, CORS, CSRF protection, rate limiting, and bcrypt
* **π§± Clean structure** β controllers, routes, services, middleware, config
* **π§° Centralized config** β manage everything via `.env`
* **π Logging** β organized and centralized logs
* **π Ready to deploy** β easily adaptable for production environments
## βοΈ Requirements
Make sure you have the following installed:
* **Node.js** β₯ 16
* **npm** or **yarn**
* **MongoDB** β₯ 5 (local or remote instance)
## πͺ Quickstart
### 1. Clone the Repository
```bash
git clone https://github.com/Dev-Relax/express-template-quickstart.git
cd express-template-quickstart
```
### 2. Install Dependencies
```bash
npm install
```
### 3. Configure Environment Variables
Copy `.env.example` to `.env` and fill it with your own values:
```bash
cp .env.example .env
```
Example `.env`:
```
PORT=5000
MONGODB_URI=mongodb://localhost:27017/your_database_name
JWT_SECRET=your_jwt_secret
JWT_REFRESH_SECRET=your_refresh_secret
CSRF_SECRET=your_csrf_secret
```
### 4. Start the Development Server
```bash
npm run dev
```
Your API is now running at **[http://localhost:5000](http://localhost:3000)** π
### 5. Build for Production
```bash
npm run build
npm start
```
## π Structure
```
.
βββ src/
β βββ config/ # Configuration (env, db)
β βββ controllers/ # Request handlers
β βββ middleware/ # Auth, error handling, logging
β βββ routes/ # API routes
β βββ services/ # Business logic and data access
β βββ index.ts # App entry point
βββ .env.example
βββ package.json
βββ tsconfig.json
βββ nodemon.json
```
## π€ Contributing
Contributions are welcome!
If you have improvements, bug fixes, or feature ideas:
1. Fork the repo
2. Create a new branch (`feature/your-feature-name`)
3. Make your changes
4. Submit a pull request
Please follow the existing coding style and keep commits clean and descriptive.
## π License
This project is licensed under the [MIT License](LICENSE).
---
> *βStart once, build faster every time.β*
> Made with β€οΈ by [Dev-Relax](https://github.com/Dev-Relax)