A modern, production-ready TypeScript monorepo template that combines Next.js, Elysia, tRPC, and more for building full-stack applications with end-to-end type safety.
📝 Using this as a template? Check out the Template Setup Guide for step-by-step customization instructions.
- TypeScript - Full type safety across the entire stack
- Next.js 16 - Latest React framework with App Router
- TailwindCSS - Utility-first CSS for rapid UI development
- shadcn/ui - Beautiful, accessible UI components
- Elysia - Type-safe, high-performance backend framework
- tRPC - End-to-end type-safe APIs with zero runtime overhead
- Drizzle ORM - TypeScript-first database toolkit
- PostgreSQL - Robust, scalable database
- Better-Auth - Modern authentication solution
- Turborepo - High-performance monorepo build system
- pnpm - Fast, disk space efficient package manager
# Clone this template
git clone <your-repo-url>
cd <your-project-name>
# Install dependencies
pnpm installUpdate the site configuration in apps/web/src/lib/site.ts:
export const siteConfig = {
name: 'Your App Name',
url: 'https://your-app.com',
ogImage: 'https://your-app.com/og.png',
description: 'Your app description',
links: {
twitter: 'https://x.com/yourusername',
github: 'https://github.com/yourusername/your-repo',
website: 'https://your-website.com',
},
};Optional but recommended: Update the package namespace from @ciaran to your own:
- Find and replace
@ciaranwith@your-app-nameacross:package.jsonfiles inapps/andpackages/- Import statements in your code
- Update the root
package.jsonname field
This project uses PostgreSQL with Drizzle ORM.
- Make sure you have PostgreSQL installed and running
- Create a
.envfile inapps/server/with your database URL:
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"- Push the schema to your database:
pnpm run db:pushpnpm run dev- Web app: http://localhost:3001
- API server: http://localhost:3000
your-app/
├── apps/
│ ├── web/ # Next.js frontend application
│ └── server/ # Elysia backend with tRPC
├── packages/
│ ├── api/ # tRPC API routers and procedures
│ ├── auth/ # Better-Auth configuration
│ ├── db/ # Drizzle schema and database utilities
│ └── config/ # Shared TypeScript configs
pnpm run dev- Start all apps in development modepnpm run dev:web- Start only the web applicationpnpm run dev:server- Start only the API server
pnpm run build- Build all applications for productionpnpm run check-types- Type-check all packages
pnpm run db:push- Push schema changes to databasepnpm run db:studio- Open Drizzle Studio (database GUI)pnpm run db:generate- Generate migrationspnpm run db:migrate- Run migrations
- Framework: Next.js 16 with App Router
- Styling: TailwindCSS 4 + shadcn/ui components
- State Management: TanStack Query + tRPC
- Forms: React Hook Form + Zod validation
- Auth: Better-Auth client
- Framework: Elysia with tRPC adapter
- API: tRPC for type-safe procedures
- Database: Drizzle ORM + PostgreSQL
- Auth: Better-Auth server
@your-app/api: tRPC router definitions@your-app/auth: Authentication configuration@your-app/db: Database schema and queries@your-app/config: Shared TypeScript configurations
- Push your code to GitHub
- Import project in Vercel
- Set root directory to
apps/web - Add environment variables
- Deploy
- Connect your repository
- Set root directory to
apps/server - Add
DATABASE_URLenvironment variable - Deploy
- Next.js Documentation
- tRPC Documentation
- Drizzle Documentation
- Better-Auth Documentation
- Elysia Documentation
- Turborepo Documentation
Contributions are welcome! Please open an issue or submit a pull request.
MIT