Boilerplate by Gede Dewo Wahyu M.W
This monorepo is a fullstack starter kit based on Turborepo, consisting of:
- π₯οΈ
apps/next: frontend application using Next.js - βοΈ
apps/elysia: REST API using Elysia.js + Prisma
This boilerplate provides common foundations often needed in production projects such as JWT authentication, form validation, state management, theme management, file uploads, and Storybook for UI development.
This project also supports request/audit log compression using zstd on the Elysia.js backend.
- ποΈ Monorepo architecture with Turborepo + pnpm workspace
- π¨ Frontend with Next.js + Tailwind CSS
- π§ Backend with Elysia.js + Prisma + PostgreSQL
- β‘ Redis for token blocklist/session support
- ποΈ
zstdcompression for archived request/audit logs and database backups - π JWT authentication
- π Form handling (
react-hook-form+zod) - π Storybook for UI components
- π§Ή Linting, formatting, and type-checking
- Monorepo: Turborepo, pnpm
- Frontend: Next.js, Tailwind CSS, Jotai, React Hook Form, Zod
- Backend: Elysia.js, Prisma, PostgreSQL, JWT, zstd (log and DB backup compression)
- Tooling: ESLint, Prettier, Husky, Commitizen
Make sure the following are installed:
- π’ Node.js
>= 22.22.1 - π¦ pnpm
>= 11 - β‘ Bun
>= 1.3.6(for running the Elysia API) - π PostgreSQL
- π§° PostgreSQL client tools (
pg_dump,pg_restore) - π΄ Redis
- ποΈ zstd (required for compression/decompression)
- Clone repository
git clone https://github.com/gdwmw/Fullstack-Boilerplate.git
cd Fullstack-Boilerplate- Install dependencies
pnpm install- Setup environment variables
pnpm cpenv- Configure
.env
Update at least:
apps/elysia/.env: database connection, JWT secret, and API configurationapps/next/.env: API/backend URL and other frontend configurations
- Ensure services are running
- π PostgreSQL must be active (
DATABASE_URL) - π΄ Redis must be active (
REDIS_URL)
- Generate Prisma Client and run migrations
pnpm generate
pnpm migrate- Run development mode
pnpm dev- Access the application
- π Frontend: http://localhost:3000
- π API: http://localhost:1337
- π Swagger: http://localhost:1337/swagger
.
βββ apps
β βββ next # Next.js frontend
β βββ elysia # Elysia.js backend + Prisma
βββ packages # Shared packages/config across apps
βββ turbo.json # Turborepo configuration
βΆοΈ pnpm dev- run all apps in development mode- ποΈ
pnpm build- build all apps/packages - π§Ή
pnpm lint- lint the entire workspace - π
pnpm check-types- TypeScript type-check - βοΈ
pnpm generate- generate Prisma client - ποΈ
pnpm migrate- run Prisma migrations - π¨
pnpm prettier- format codebase
This project uses Commitizen (pnpm commit).
- Fork repository
- Create branch (
feat/your-feature) - Run checks
- Commit & PR
Include:
- Context
- Error message
- Reproduction steps
MIT License