Skip to content

ljlm0402/typescript-express-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

570 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

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 is an interactive CLI tool that generates production-ready TypeScript Express projects with your preferred stack configuration.

Instead of starting from scratch, this CLI provides a comprehensive project generator with multiple database integrations, development tools, and deployment configurations. Choose from 10+ templates and customize your development workflow in minutes.

  • Interactive Setup: Choose database, ORM, linter, testing framework, and more
  • Production Ready: Docker, PM2, NGINX configurations included
  • Developer Experience: Hot reload, testing, linting, and formatting pre-configured
  • Multiple Stacks: Support for 10+ database/ORM combinations

๐Ÿ’Ž CLI Features

  • ๐ŸŽฏ Interactive Setup โ€” Smart CLI with guided project configuration

  • ๐Ÿš€ Quick or Custom Mode โ€” Start fast with presets or choose tools category by category

  • ๐Ÿ—„๏ธ Multiple Database Options โ€” Prisma, Sequelize, TypeORM, Mongoose, Knex, and more

  • ๐Ÿ› ๏ธ Development Tools โ€” Choose from ESLint, Biome, Jest, Vitest, Docker, PM2

  • ๐Ÿ“ฑ Template Selection โ€” 10+ pre-configured project templates

  • โšก Auto Configuration โ€” Dependencies, scripts, and configs automatically setup

  • ๐Ÿ”ง Smart Dependencies โ€” Tool compatibility and requirement resolution

  • ๐Ÿ“ฆ Package Manager Agnostic โ€” Works with npm, pnpm, or yarn

  • ๐Ÿš€ Zero Config Start โ€” Generated projects work immediately

  • ๐ŸŽจ Customizable โ€” Add your own templates and development tools

โšก๏ธ Quick Start

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

# Run the interactive CLI
typescript-express-starter

โ”Œ  ๐Ÿ“˜ TypeScript Express Starter
โ”‚
โ—‡  Choose setup mode:
โ”‚  โ— ๐Ÿš€ Quick start (recommended preset) (Automatically selects a sensible toolset)
โ”‚  โ—‹ ๐Ÿ›  Custom (step-by-step) (Pick tools category by category)
โ”‚
โ—‡  Which package manager do you want to use?
โ”‚  โ— npm
โ”‚  โ—‹ pnpm
โ”‚  โ—‹ yarn
โ”‚
โ—‡  Choose a template:
โ”‚  โ— Express TypeScript (Basic Express + TypeScript starter ยท beginner ยท stable)
โ”‚  โ—‹ Drizzle PostgreSQL (Modern SQL toolkit with type safety + full devtools ยท intermediate ยท stable)
โ”‚
โ—‡  Enter your project name:
โ”‚  your-project-name
โ”‚
โ—‡  Choose quick profile:
โ”‚  โ—‹ Minimal (Template only (no additional devtools))
โ”‚  โ— Recommended (Balanced default toolchain)
โ”‚  โ—‹ Full (One tool from each category)
โ”‚
โ—‡  Preset โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                                     โ”‚
โ”‚  Quick profile selected: recommended (biome, tsup, vitest, docker)  โ”‚
โ”‚                                                                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ”‚
โ—‡  Configuration summary โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                โ”‚
โ”‚  Setup mode     : quick                        โ”‚
โ”‚  Package manager: pnpm                         โ”‚
โ”‚  Template       : Express TypeScript           โ”‚
โ”‚  Project name   : your-project-name            โ”‚
โ”‚  Devtools       : Biome, tsup, Vitest, Docker  โ”‚
โ”‚                                                โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ”‚
โ—†  Proceed with project generation?
โ”‚  โ— Yes / โ—‹ No
โ”‚
โœ” ๐Ÿ“ฆ Base dependencies installed!
โ”‚
โ”” ๐ŸŽ‰ Project setup complete!

# Navigate to your project
cd your-project-name

# Start development server
npm run dev

Generated Project Features:

  • ๐ŸŒ Express server: http://localhost:3000/
  • ๐Ÿ”„ Hot reload with nodemon

๐Ÿ“‚ Generated Project Structure

When you create a new project, the CLI generates this structure:

your-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ config/           # Configuration files, environment settings
โ”‚   โ”œโ”€โ”€ controllers/      # Request handling & response logic
โ”‚   โ”œโ”€โ”€ dtos/             # Data Transfer Objects for request/response
โ”‚   โ”œโ”€โ”€ entities/         # Database entities (if using ORM)
โ”‚   โ”œโ”€โ”€ exceptions/       # Custom exception classes
โ”‚   โ”œโ”€โ”€ interfaces/       # TypeScript interfaces and type definitions
โ”‚   โ”œโ”€โ”€ middlewares/      # Middlewares (logging, auth, error handling)
โ”‚   โ”œโ”€โ”€ 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                   # Environment variables file
โ”œโ”€โ”€ .env.development.local # Development environment variables
โ”œโ”€โ”€ .env.production.local  # Production environment variables
โ”œโ”€โ”€ .env.test.local        # Test environment variables
โ”œโ”€โ”€ nodemon.json           # Nodemon configuration
โ”œโ”€โ”€ package.json           # Project dependencies and scripts
โ””โ”€โ”€ tsconfig.json          # TypeScript configuration

๐Ÿ›  Development Tools Available

Choose from these categories during project setup:

Category Available Tools Description
Linter biome, eslint, oxlint Code formatting & linting (Biome is all-in-one)
Bundler swc, tsup Fast TypeScript compilation and bundling
Testing jest, vitest Unit & integration testing frameworks
Container docker Docker & docker-compose configuration

To be added later (currently in progress):

Category Available Tools Description
Process pm2 Production process management
CI/CD github GitHub Actions workflows
Git Hooks husky Pre-commit hooks for quality control
API Docs swagger OpenAPI/Swagger documentation

Smart Selection: The CLI automatically resolves tool dependencies and compatibility.

๐Ÿงฉ Available Templates

Current template status with comprehensive compatibility tested:

โœ… Production Ready & Fully Tested

Template Description Status Compatibility
default Express + TypeScript starter โœ… Active ๐ŸŽฏ Baseline
drizzle-postgresql Drizzle ORM + PostgreSQL (Type-safe, Zero overhead) โœ… Active ๐ŸŒŸ 100% (8/8)

๐Ÿ”ง Enhanced Development Tools Support

drizzle-postgresql template is fully compatible with:

Linters

  • โœ… Biome - Modern unified tool (linter + formatter)
  • โœ… ESLint + Prettier - Traditional reliable combination
  • โœ… Oxlint - Rust-based high-performance linter (18ms!)

Compilers

  • โœ… tsup - esbuild-based bundler (193ms build!)
  • โœ… SWC - Rust-based native performance compiler

Test Runners

  • โœ… Jest - Mature test framework with full E2E support
  • โœ… Vitest - Modern Vite-based test runner

๐ŸŽฏ All 8 combinations tested and verified - Choose your preferred development experience!

๐Ÿšง Coming Soon

ORM/Database Integration

Template Description Priority
prisma Type-safe database client with auto-generated types ๐Ÿ”ฅ Next
mongoose Elegant MongoDB ODM for Node.js ๐Ÿ”ฅ Next
typeorm Decorator-based Active Record ORM ๐Ÿšง Planned
sequelize Mature Promise-based SQL ORM ๐Ÿšง Planned
mikro-orm Data Mapper ORM pattern for TypeScript ๐Ÿšง Planned
typegoose TypeScript-friendly Mongoose alternative ๐Ÿšง Planned
node-postgres High-performance PostgreSQL native driver ๐Ÿšง Planned
knex Flexible SQL query builder & migrations ๐Ÿšง Planned

Architecture/Controller Style

Template Description Priority
graphql GraphQL API schema with Apollo Server ๐Ÿšง Knowledge

๐Ÿค” Why Use This CLI?

vs. Manual Setup

Aspect Manual Setup TypeScript Express Starter CLI
Time ๐Ÿ”ด Hours of configuration โœ… 2-3 minutes interactive setup
Configuration ๐Ÿ”ด Manual dependency management โœ… Auto-resolved, compatible versions
Best Practices ๐Ÿ”ด Research required โœ… Pre-configured industry standards
Consistency ๐Ÿ”ด Varies by developer โœ… Standardized project structure
Updates ๐Ÿ”ด Manual maintenance โœ… CLI updates bring new features

vs. Other Generators

Feature TypeScript Express Starter Other Generators
Database Choice โœ… 10+ options planned Limited options
Tool Selection โœ… Mix & match dev tools Fixed stack
TypeScript First โœ… Built for TypeScript Often JS-first
Production Ready โœ… Docker, PM2 included Basic setup

โญ๏ธ 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

๐Ÿ’ณ License

MIT


Made with โค๏ธ by AGUMON ๐Ÿฆ–