π CLI tool to generate production-ready Fastify-based fullstack projects with multiple frontend framework options
A flexible project generator that creates modern, scalable fullstack applications with Fastify APIs and your choice of frontend framework. Built with TypeScript, modern tooling, and industry best practices.
# Create a React Router project (default)
npx create-fastify-project my-app
cd my-app
pnpm devThat's it! Your fullstack application is running:
- π Frontend: http://localhost:5173
- π API: http://localhost:3000
- ποΈ Database Studio:
pnpm db:studio
| Template | Description | Status |
|---|---|---|
react-router |
React Router 7 + SSR + File-based routing | β Stable |
nextjs |
Next.js + App Router + Server Components | π§ Coming Soon |
solidjs |
SolidJS + SolidStart + Islands Architecture | π§ Coming Soon |
svelte |
Svelte + SvelteKit + Server-side rendering | π§ Coming Soon |
# Currently only React Router is available
npx create-fastify-project my-app
npx create-fastify-project my-app --template react-router
# Coming soon:
# npx create-fastify-project my-app --template nextjs
# npx create-fastify-project my-app --template solidjsAll templates support these customization options:
# Database options
npx create-fastify-project my-app --db postgres
npx create-fastify-project my-app --db mysql
npx create-fastify-project my-app --db sqlite # default
# Development options
npx create-fastify-project my-app --lint eslint
npx create-fastify-project my-app --no-install
npx create-fastify-project my-app --no-git
# Combine options
npx create-fastify-project my-app --template react-router --db postgres --lint eslintEvery generated project includes:
- TypeScript-first with full type safety
- 65k+ requests/sec capability (2x faster than Express)
- Built-in CORS, error handling, and validation
- Hot reload development experience
- React Router: SSR, file-based routing, optimistic UI
- Next.js: App Router, Server Components, streaming
- SolidJS: Fine-grained reactivity, minimal runtime
- Svelte: Compiled components, optimal performance
- SQLite for development, PostgreSQL/MySQL for production
- Type-safe queries with auto-generated types
- Visual database browser with Prisma Studio
- Migration system for schema evolution
- Shared packages for code reuse across apps
- Optimized build caching and parallelization
- Independent scaling and deployment strategies
my-app/
βββ apps/
β βββ api/ # Fastify API server
β βββ web/ # React Router 7 frontend
βββ packages/
β βββ database/ # Shared Prisma database
β βββ shared-utils/ # Shared utilities
β βββ typescript-config/ # Shared TypeScript configs
β βββ ui/ # Shared UI components
βββ .env.example # Environment variables template
βββ package.json # Root workspace config
βββ turbo.json # Monorepo build system
npx create-fastify-project my-app
cd my-appIf using PostgreSQL or MySQL:
# Copy environment template
cp .env.example .env
# Add your database URL
echo 'DATABASE_URL="postgresql://user:pass@host:5432/dbname"' >> .env# Install dependencies (if you used --no-install)
pnpm install
# Set up database
pnpm db:push
# Start all development servers
pnpm dev# Development
pnpm dev # Start all development servers
pnpm build # Build all packages for production
pnpm typecheck # Run TypeScript checks
# Database
pnpm db:generate # Generate Prisma client
pnpm db:push # Push schema to database
pnpm db:studio # Open database browser
pnpm db:migrate # Create and run migrations
# Code Quality
pnpm format # Format code with Biome/ESLint
pnpm lint # Lint code- β Zero setup required - works out of the box
- β Perfect for development and small applications
- π Database file:
data/dev.db
- π Production-ready with ACID compliance
- π Advanced features - JSON columns, full-text search
- π Hosted options: Railway, Supabase, Neon, Vercel Postgres
- π Production-ready with wide ecosystem support
- β‘ High performance for read-heavy workloads
- π Hosted options: PlanetScale, AWS RDS, DigitalOcean
npm i -g vercel
vercel
# Add DATABASE_URL in Vercel dashboardnpm i -g @railway/cli
railway login && railway init && railway updocker build -t my-app .
docker run -p 3000:3000 my-app- π’ Business Applications - CRM, admin panels, dashboards
- π° SaaS Products - User authentication, billing, multi-tenancy ready
- π E-commerce - Product catalogs, shopping carts, order management
- π± Social Apps - User profiles, feeds, real-time features
- π Analytics Dashboards - Data visualization, reporting tools
If you see database connection errors:
# 1. Ensure your database is running
# 2. Check your DATABASE_URL in .env
# 3. Try manual setup:
cd packages/database
cp .env.example .env
# Edit .env with your DATABASE_URL
pnpm prisma generate
pnpm prisma db pushIf dependencies fail to install:
# Clear package manager cache
pnpm store prune
rm -rf node_modules
pnpm install- Fastify - Web framework for Node.js
- React Router - Modern React routing
- Prisma - Next-generation TypeScript ORM
- Turborepo - High-performance build system
- Roadmap - Project direction and upcoming features
- Contributing Guide - How to contribute templates and improvements
- Release Process - How to publish new versions (maintainers)
- π Report Issues
- π¬ Discussions
MIT License - see LICENSE for details.
Ready to build something amazing? π
npx create-fastify-project my-app
cd my-app
pnpm dev