🚀 Express API Template

A modern Express.js API with TypeScript, Zod validation, and beautiful Scalar documentation

🎯 Quick Start

📖

API Documentation

Explore our interactive API documentation powered by Scalar. Test endpoints, view schemas, and see examples.

View API Docs
📋

OpenAPI Spec

Download the complete OpenAPI 3.0 specification for integration with other tools and services.

Download Spec
💚

Health Check

Monitor the API status and uptime with our health check endpoint.

Check Health

🛠 Installation

Get started with this API template in minutes:

# Clone the repository
git clone <your-repo-url>
cd express-api-template

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your database URL and other settings

# Run database migrations
npx prisma migrate dev

# Start development server
npm run dev

📡 Available Endpoints

Current API endpoints available in this template:

GET/api/products - List all products
POST/api/products - Create a new product
GET/api/products/:id - Get a specific product
PATCH/api/products/:id - Update a product
DELETE/api/products/:id - Delete a product

✨ Features

TypeScript

Full type safety with TypeScript and Zod schema validation

📚

Auto Docs

Automatically generated OpenAPI documentation with Scalar

🛡️

Security

Built-in security with Helmet, CORS, and rate limiting

🗄️

Database

Prisma ORM for type-safe database operations

🔄

Validation

Request/response validation with detailed error messages

🚀

Production Ready

Logging, error handling, and performance optimizations

🔧 Tech Stack

Backend

  • Express.js - Fast, unopinionated web framework
  • TypeScript - Type-safe JavaScript development
  • Zod - Runtime type validation and parsing

Documentation

  • OpenAPI 3.0 - Industry standard API specification
  • Scalar - Beautiful, interactive documentation
  • Auto-generation - Docs generated from code

Database & Security

  • Prisma - Type-safe database client
  • Helmet - Security middleware
  • Rate Limiting - API protection

📝 Next Steps

Ready to extend this API? Check out the README.md for detailed guides on:

  • Adding new endpoints (e.g., Categories)
  • Creating middleware
  • Database schema changes
  • Authentication setup
  • Deployment strategies

Built with ❤️ using Express.js, TypeScript, and Scalar • View on GitHub