Skip to content

gdwmw/Fullstack-Boilerplate

Repository files navigation

Next.js - Home Next.js - Login Next.js - Register Next.js - Audit Logs Next.js - Audit Detail Elysia.js - Register Elysia.js - Response

πŸš€ Fullstack Boilerplate (Turborepo + Next.js + Elysia.js)

Boilerplate by Gede Dewo Wahyu M.W

Turborepo Next.js Elysia.js Prisma PostgreSQL Redis License

Quality gate


πŸ“– Description

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.


✨ Main Features

  • πŸ—οΈ Monorepo architecture with Turborepo + pnpm workspace
  • 🎨 Frontend with Next.js + Tailwind CSS
  • πŸ”§ Backend with Elysia.js + Prisma + PostgreSQL
  • ⚑ Redis for token blocklist/session support
  • πŸ—œοΈ zstd compression 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

🧰 Tech Stack

  • 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

βš™οΈ Prerequisites

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)

πŸš€ Quick Start

  1. Clone repository
git clone https://github.com/gdwmw/Fullstack-Boilerplate.git
cd Fullstack-Boilerplate
  1. Install dependencies
pnpm install
  1. Setup environment variables
pnpm cpenv
  1. Configure .env

Update at least:

  • apps/elysia/.env: database connection, JWT secret, and API configuration
  • apps/next/.env: API/backend URL and other frontend configurations
  1. Ensure services are running
  • 🐘 PostgreSQL must be active (DATABASE_URL)
  • πŸ”΄ Redis must be active (REDIS_URL)
  1. Generate Prisma Client and run migrations
pnpm generate
pnpm migrate
  1. Run development mode
pnpm dev
  1. Access the application

πŸ“ Folder Structure

.
β”œβ”€β”€ apps
β”‚   β”œβ”€β”€ next        # Next.js frontend
β”‚   └── elysia      # Elysia.js backend + Prisma
β”œβ”€β”€ packages        # Shared packages/config across apps
└── turbo.json      # Turborepo configuration

πŸ“œ Important Scripts

  • ▢️ 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

🧾 Commit Guideline

This project uses Commitizen (pnpm commit).


🀝 Contribution

  1. Fork repository
  2. Create branch (feat/your-feature)
  3. Run checks
  4. Commit & PR

❓ Q&A / Help

Include:

  • Context
  • Error message
  • Reproduction steps

βš–οΈ License

MIT License

Releases

No releases published

Packages

 
 
 

Contributors