A minimal and scalable Express + TypeScript starter project. This template helps you quickly spin up a REST API or microservice with clean architecture and modern tooling.
-
Express 5 — modern middleware and routing
-
TypeScript — strong typing out of the box
-
Mongoose — ODM for MongoDB
-
Modular structure —
controllers,routes,middlewares,schemas,utils -
.env support — via
tsxandnode --env-file -
Tsc Alias — clean, short import paths
src/
├── app.ts # Express app configuration
├── index.ts # Entry point (server starts here)
├── config/ # Configurations
├── controllers/ # Controllers
├── middlewares/ # Middlewares
├── routes/ # Routes
├── schemas/ # Mongoose schemas
└── utils/ # Helpers and types# Clone the repository
git clone https://github.com/xteam-uz/express-starter.git
cd express-starter
# Install dependencies (recommended PNPM)
pnpm installCreate a .env file in the project root:
SERVER_HOST=localhost
SERVER_PORT=3000
DB_URI=mongodb://localhost:27017/Development:
pnpm devRuns with hot-reload using tsx.
pnpm buildpnpm startsrc/routes/user.ts defines routes handled by UserController:
GET /users
POST /usersThe Mongoose schema is defined in src/schemas/user.schema.ts.
Feel free to open an issue or submit a pull request to improve this project.