Skip to content

ljlm0402/typescript-express-starter

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Project Logo

TypeScript Express Starter

πŸš€ Express RESTful API Boilerplate Using TypeScript

npm Info

npm Version npm Release Version npm Downloads npm Package License

github Stars github Forks github Contributors github Issues




πŸ“ Introduction

TypeScript Express Starter provides a robust starting point for building secure, scalable, and maintainable RESTful APIs.

It blends the flexibility and simplicity of Express with TypeScript’s type safety, supporting rapid development without compromising code quality or maintainability.

  • Clean architecture and modular structure

  • Built-in security, logging, validation, and developer tooling

  • Instantly ready for both prototyping and production

πŸ’Ž Features

  • ⚑ TypeScript + Express β€” Modern JS with full type safety

  • πŸ“œ API Docs β€” Swagger/OpenAPI ready out-of-the-box

  • πŸ›‘ Security β€” Helmet, CORS, HPP, rate limiting

  • 🧩 Validation β€” Zod schema-based runtime validation

  • πŸ”— Dependency Injection β€” Lightweight DI with tsyringe

  • πŸ—„ Database Integrations β€” Sequelize, Prisma, Mongoose, TypeORM, Knex, Drizzle, etc.

  • πŸ›  Developer Tools β€” ESLint, Prettier, Jest, Docker, PM2, NGINX, Makefile

  • 🧱 Modular Architecture β€” Easily extendable and maintainable

  • πŸš€ Production Ready β€” Docker, PM2, NGINX support

⚑️ Quick Start

# Install globally
npm install -g typescript-express-starter

# Scaffold a new project
typescript-express-starter
cd my-app

# Run in development mode
npm run dev

Example

πŸ“‚ Project Structure

src/
 β”œβ”€β”€ config/           # Configuration files, environment settings
 β”œβ”€β”€ controllers/      # Request handling & response logic
 β”œβ”€β”€ dtos/             # Data Transfer Objects for request/response
 β”œβ”€β”€ exceptions/       # Custom exception classes
 β”œβ”€β”€ interfaces/       # TypeScript interfaces and type definitions
 β”œβ”€β”€ middlewares/      # Middlewares (logging, auth, error handling, etc.)
 β”œβ”€β”€ repositories/     # Database access logic
 β”œβ”€β”€ routes/           # API route definitions
 β”œβ”€β”€ services/         # Business logic
 β”œβ”€β”€ utils/            # Utility/helper functions
 β”œβ”€β”€ app.ts            # Express app initialization
 └── server.ts         # Server entry point

.env                   # Default environment variables
.env.development.local # Development-specific variables
.env.production.local  # Production-specific variables
.env.test.local        # Test-specific variables
nodemon.json           # Nodemon variables
swagger.yaml           # Swagger API documentation
tsconfig.jsnon         # TypeScript variables

πŸ›  Devtools Types

Category Tools / Configs Description
Code Formatter / Linter biome, prettier, eslint Code formatting & linting rules
Build / Bundler swc, tsup Build & bundling configuration
Testing jest, vitest Unit & integration testing frameworks
Process Manager pm2 Manage and monitor Node.js processes
CI/CD github GitHub Actions workflow settings
Git Hooks husky Pre-commit / pre-push hooks for lint/test
Containerization docker Docker & docker-compose setup for deployment

This categorization helps developers quickly understand what each tool is used for without checking every folder.

🧩 Template Choices

Choose your preferred stack during setup! Support for major databases and patterns via CLI:

Template Stack / Integration
Default Express + TypeScript
Sequelize Sequelize ORM
Mongoose MongoDB ODM (Mongoose)
TypeORM TypeORM
Prisma Prisma ORM
Knex SQL Query Builder
GraphQL GraphQL support
Typegoose TS-friendly Mongoose
Mikro ORM Data Mapper ORM (multi-DB)
Node Postgres PostgreSQL driver (pg)
Drizzle Drizzle

More templates are regularly added and updated.

πŸ€” Positioning: When to Use Each

Criteria TypeScript Express Starter NestJS
Learning Curve βœ… Low β€” easy for anyone familiar with Express Higher β€” requires OOP/DI/Decorators
Flexibility βœ… Maximum β€” customize any part of the stack Convention-based, opinionated structure
Modularity Middleware & modular pattern 🌟 Strong built-in module system
Type Safety Full TypeScript support Full TypeScript support
Testing βœ… Supports Jest & Vitest β€” flexible choice Built-in Jest E2E setup
Scale βœ… Fast prototyping β†’ mid-size apps 🌟 Large-scale enterprise apps
DI Framework Lightweight tsyringe β€” minimal overhead 🌟 Full-featured DI container
Best Fit βœ… Microservices, quick MVPs, developer agility 🌟 Complex, enterprise-grade applications

πŸ“‘ Recommended Commit Message

When Commit Message
Add Feature ✨ Add Feature
Fix Bug 🐞 Fix Bug
Refactor Code πŸ›  Refactor Code
Install Package πŸ“¦ Install Package
Fix Readme πŸ“š Fix Readme
Update Version 🌼 Update Version
New Template πŸŽ‰ New Template

πŸ“„ License

MIT(LICENSE) Β© AGUMON (ljlm0402)

⭐️ Stargazers

Stargazers repo roster for @ljlm0402/typescript-express-starter

🍴 Forkers

Forkers repo roster for @ljlm0402/typescript-express-starter

🀝 Contributors

Contributors repo roster for @ljlm0402/typescript-express-starter