A modern, type-safe full-stack application template featuring React, Hono, and PostgreSQL with end-to-end type safety.
- React 19 with TypeScript
- TanStack Router for file-based routing with type safety
- TanStack Query for server state management
- Tailwind CSS with shadcn/ui components
- React Hook Form with Zod validation
- Vite for fast development
- Hono web framework for lightweight, fast APIs
- tRPC for type-safe client-server communication
- Better-Auth for authentication
- Drizzle ORM with PostgreSQL
- Bun runtime
- PostgreSQL 17 with Drizzle ORM
- Auto-migration on server startup
- Type-safe database operations
- Bun (latest version)
- PostgreSQL database
- Install dependencies:
bun install- Set up your database connection:
export DATABASE_URL="postgresql://username:password@localhost:5432/database_name"- Generate and apply database migrations:
bun db:generate- Start development servers:
bun devThis will start:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
bun install # Install all dependencies
bun dev # Start both client and server
bun dev:client # Start only frontend (port 5173)
bun dev:server # Start only backend (port 3000)
bun typecheck # Type check all packages
bun typecheck:client # Type check frontend only
bun typecheck:server # Type check backend only
bun db:generate # Generate migration files
bun db:migrate # Apply database migrations
bun clean # Clean all node_modules and lock filesClient (packages/client/)
cd packages/client
bun dev # Start development server
bun build # Build for production
bun typecheck # Type checkServer (packages/server/)
cd packages/server
bun dev # Start with hot reload
bun db:generate # Generate migrations
bun db:migrate # Apply migrations
bun typecheck # Type check- End-to-end type safety with tRPC
- Shared Zod schemas for validation
- TypeScript strict mode enabled
- Auto-generated route types with TanStack Router
- Better-Auth integration
- Secure session management
- Ready-to-use auth components
- PostgreSQL with Drizzle ORM
- Auto-migration on development startup
- Type-safe queries and schemas
- Migration versioning
- shadcn/ui component system
- Radix UI primitives
- Tailwind CSS styling
- Dark mode support with next-themes
- Responsive design
-
Edit schema in
packages/server/src/db/schema.ts -
Generate migration:
bun db:generate
-
Apply migration:
bun dev # Auto-applies on startup # OR manually: bun db:migrate
Configure your database connection in your environment:
# Development
DATABASE_URL="postgresql://username:password@localhost:5432/your_db"# Build client
cd packages/client && bun run build
# The server runs directly from TypeScript in productionRequired environment variables:
DATABASE_URL- PostgreSQL connection string- Additional auth configuration as needed
- Follow the existing code style and conventions
- Run type checking before committing:
bun typecheck - Ensure all migrations are properly generated and tested
- Use the existing component patterns and utilities
This is a template project. Customize the license as needed for your project.