Production-ready monorepo starter kit with Next.js 16, Elysia.js, and Prisma. Built for speed and simplicity.
- 🚀 Next.js 16 - React 19 with App Router & Turbopack
- ⚡ Elysia.js - Fast Bun-powered backend API
- 🗄️ Prisma - Type-safe database ORM with PostgreSQL
- 🔐 Better Auth - Modern authentication with OAuth support
- 📧 Resend - Transactional emails with React Email
- 🎨 Tailwind CSS v4 - Modern styling with shadcn/ui
- 📦 Turborepo - High-performance monorepo build system
- 💳 Polar.sh - Integrated payment processing
- 📁 UploadThing - File uploads made simple
TurboStack Lite includes intelligent development guidelines and automated code quality enforcement:
- Auto-formatting - Prettier integration with custom rules
- ESLint Configuration - Strict TypeScript and React rules
- Import Organization - Automatic import sorting and optimization
- Unused Code Detection - Identify and remove dead code automatically
- Type Safety - Comprehensive Zod schema validation
- API Contract Validation - Automatic request/response validation
- Database Schema Sync - Prisma type-safe database operations
- Environment Variable Validation - Runtime env var checking
- Authentication Guards - Route-level security enforcement
- Input Sanitization - XSS and injection prevention
- Secret Management - Environment-based configuration
- Rate Limiting - Built-in API protection
- Bundle Analysis - Webpack bundle optimization
- Image Optimization - Automatic Next.js image processing
- Database Indexing - Query performance monitoring
- Caching Strategy - Multi-layer caching implementation
- Git Hooks - Pre-commit quality checks
- Automated Testing - Unit and integration test enforcement
- Build Validation - Type-checking before deployment
- Documentation Generation - Auto-generated API docs
💎 Pro Tip: These AI rules ensure your codebase maintains enterprise-grade quality standards automatically.
# Clone the repository
git clone https://github.com/codelifynet/turbostack-lite.git
cd turbostack-lite
# Install dependencies
bun install
# Setup environment variables
cp .env.example .env
# Edit .env and add your configuration
# Setup database
bun run db:push
bun run db:seed
# Start development servers
bun run devThe app will be available at:
- Frontend: http://localhost:4100
- Backend API: http://localhost:4101
- API Docs: http://localhost:4101/openapi
turbostack-lite/
├── apps/
│ ├── web/ # Next.js 16 frontend (port 4100)
│ ├── api/ # Elysia.js backend (port 4101)
│ └── docs/ # Documentation app (Fumadocs)
├── packages/
│ ├── database/ # Prisma schema & client
│ ├── types/ # Shared TypeScript types
│ ├── validations/ # Zod validation schemas
│ └── ui/ # Shared UI components (shadcn/ui)
├── turbo.json # Turborepo configuration
└── package.json # Root workspace config
| Command | Description |
|---|---|
bun run dev |
Start all apps in development mode |
bun run dev:web |
Start only the web app |
bun run dev:api |
Start only the API server |
bun run dev:docs |
Start only the docs app |
bun run build |
Build all apps for production |
bun run start |
Start all apps in production mode |
bun run db:generate |
Generate Prisma client |
bun run db:push |
Push Prisma schema to database |
bun run db:migrate |
Create a new migration |
bun run db:seed |
Seed the database with sample data |
bun run db:studio |
Open Prisma Studio |
bun run db:start |
Reset, push, and seed database |
bun run lint |
Lint all packages |
bun run check-types |
Type-check all packages |
bun run format |
Format code with Prettier |
bun run clean |
Clean build artifacts |
Required environment variables are documented in .env.example. Key variables:
Backend (apps/api/.env):
DATABASE_URL- PostgreSQL connection stringJWT_SECRET- JWT signing secretBETTER_AUTH_SECRET- Better Auth secret keyRESEND_API_KEY- Resend email API keyPOLAR_ACCESS_TOKEN- Polar.sh payment access token
Frontend (apps/web/.env.local):
NEXT_PUBLIC_API_URL- Backend API URLNEXT_PUBLIC_POLAR_*_PRICE_ID- Polar.sh price IDs
See .env.example for the complete list.
Deploy the Next.js app to Vercel:
Manual deployment:
cd apps/web
vercelThe Elysia.js API requires a platform that supports Bun runtime:
- Railway - Recommended, easy Bun support
- Render - Supports Bun runtime
- Fly.io - Global edge deployment
Deployment steps:
- Set environment variables in your hosting platform
- Point to
apps/apias the root directory - Use
bun run startas the start command
Choose a PostgreSQL provider:
- Supabase - Managed PostgreSQL with free tier
- Neon - Serverless PostgreSQL
- Railway - Database + Backend in one place
- Online Docs: turbostack-docs.vercel.app
- Local Docs: Run
bun run dev:docsand visit http://localhost:4102
| Layer | Technology | Version |
|---|---|---|
| Monorepo | Turborepo | 2.x |
| Runtime | Bun | 1.1.x |
| Frontend | Next.js | 16.x |
| UI Framework | React | 19.x |
| Styling | Tailwind CSS | 4.x |
| UI Components | shadcn/ui | Latest |
| Backend | Elysia.js | 1.4.x |
| Database | Prisma + PostgreSQL | 6.x |
| Validation | Zod | 3.x |
| Auth | Better Auth | 1.4.x |
| Resend | Latest | |
| Payments | Polar.sh | Latest |
MIT License - see LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you find this project useful, please consider giving it a star ⭐
