Skip to content

Latest commit

 

History

History
91 lines (66 loc) · 2.6 KB

README.md

File metadata and controls

91 lines (66 loc) · 2.6 KB

Node.js Fastify TypeScript Starter

Fastify Logo

A modern Node.js backend starter template with Fastify, TypeScript, and best practices setup.

Quick Start

# Clone the repository
git clone <repository-url>

# Install dependencies
pnpm install

# Setup environment variables
cp .env.example .env

# Generate Prisma clients
pnpm db:migration

# Run database migrations
pnpm db:migrate

# Start development server
pnpm dev

Visit http://localhost:3000 to see your server running.

Core Features

  • 🚀 Fastify - High performance web framework
  • 📘 TypeScript - Type safety and better DX
  • 🗄️ Prisma - Modern database ORM with migrations
  • 🔄 Hot Reload - Fast development with Vite HMR
  • Testing - Ready-to-use test setup with Vitest
  • 📝 Logging - Structured logging with Pino
  • 📚 API Documentation - Swagger/OpenAPI integration
  • 🔒 Security - Helmet, CORS, and rate limiting
  • 🎯 Validation - Request/Response validation with Zod

Available Scripts

# Development
pnpm dev          # Start development server
pnpm build        # Build for production
pnpm start        # Start production server

# Testing
pnpm test         # Run tests
pnpm test:ui      # Run tests with UI
pnpm coverage     # Generate test coverage

# Database
pnpm db:writer:migration  # Generate writer database client
pnpm db:writer:migrate    # Run writer database migrations
pnpm db:reader:migration  # Generate reader database client
pnpm db:reader:migrate    # Run reader database migrations
pnpm db:migration        # Generate both database clients
pnpm db:migrate         # Run all database migrations
pnpm db:studio         # Open Prisma Studio

# Code Quality
pnpm format       # Format code with Prettier

Documentation

Contributing

Contributions are welcome! Please read our Contributing Guide.

License

MIT License - see LICENSE for details.

Support

Create an issue in this repository for any questions or problems.