A modern, production-ready fullstack template built with Next.js, Hono, Better Auth, Prisma, and shadcn/ui. Type-safe, performance-oriented, and designed for fast onboarding.
- Focused stack: Next.js App Router + Hono RPC for typed server communication
- Production-ready auth: Better Auth with RBAC-ready scaffolding
- Database first: PostgreSQL via Prisma, Docker Compose provided
- Polished UI/UX: shadcn/ui + Tailwind with dark mode and accessible patterns
- Developer experience: pnpm, ESLint, Prettier, Husky, and strict TypeScript
- Authentication with Better Auth (GitHub OAuth ready)
- Type-safe API routes with Hono (RPC and REST)
- PostgreSQL with Prisma ORM
- UI components with shadcn/ui and Radix UI
- Beautiful progress bar with bprogress/next
- Dark/light theme via next-themes
- Optional S3 file upload (AWS S3 or MinIO)
- Full TypeScript and strict checks
- Frontend: Next.js 16, React 19, Tailwind CSS 4, shadcn/ui, Lucide Icons, React Icons
- Backend: Hono (RPC ready), Better Auth, Zod validation
- Data: PostgreSQL, Prisma 6
- Tooling: TypeScript 5, pnpm, ESLint 9, Prettier 3, Husky, lint-staged
- Node.js 18+
- pnpm
- Docker & Docker Compose (for database)
- Clone and install
git clone https://github.com/caru-ini/fullstack-template
cd fullstack-template
pnpm install- Environment variables
cp .env.example .env
# Generate a secret for Better Auth
pnpx @better-auth/cli secretFill in .env according to your environment. The keys are validated by src/env.ts (T3 Env).
- Start services
docker compose up -d- Generate Prisma schema from Better Auth
pnpx @better-auth/cli generate- Push database schema
pnpm db db push # or: pnpm dlx prisma db push- Start the dev server
pnpm devVisit http://localhost:3000
| Script | Description |
|---|---|
pnpm dev |
Start development server (Turbo) |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm preview |
Build and start production server |
pnpm lint |
Run ESLint |
pnpm lint:fix |
Fix ESLint issues |
pnpm typecheck |
TypeScript type checking |
pnpm fmt:check |
Check code formatting |
pnpm fmt:write |
Format code with Prettier |
pnpm check |
Linting and type checking |
pnpm db |
Prisma CLI |
- Workflow:
.github/workflows/ci.yaml(view on GitHub) - Triggers:
pushtomain,pull_request - Steps:
- Install dependencies with pnpm
- Prettier format check (
pnpm fmt:check) - ESLint (
pnpm lint) - TypeScript typecheck (
pnpm typecheck) - Build (
pnpm build)
pnpm install &&
pnpm fmt:check &&
pnpm lint &&
pnpm typecheck &&
pnpm buildNotes:
- The CI sets dummy environment variables to satisfy build-time validation. When building locally, copy
.env.exampleto.envand fill required keys.
src/
├── app/ # Next.js App Router
│ ├── (about)/ # Route groups
│ ├── api/ # API routes
│ │ ├── [[...route]]/ # Hono API routes
│ │ └── auth/ # Better Auth endpoints
│ └── globals.css # Global styles
├── components/ # Reusable components
│ ├── auth/ # Authentication components
│ ├── layout/ # Layout components
│ ├── misc/ # Miscellaneous components
│ ├── providers/ # Context providers
│ └── ui/ # shadcn/ui components
├── lib/ # Utilities
│ ├── auth.ts # Better Auth configuration
│ ├── auth-client.ts # Client-side auth utilities
│ ├── db.ts # Database connection
│ ├── hono.ts # Hono client setup
│ ├── s3-client.ts # S3 client setup
│ └── utils.ts # Utility functions
└── env.ts # Environment variable validation
- Push your code to GitHub
- Connect the repository to Vercel
- Set environment variables in the Vercel dashboard
- Deploy on every push
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT — see LICENSE.
If this project helps you, please consider giving it a star.
