May 2026

Next.js + Fastify + Supabase Monorepo

An open-source npm package I built and published. One command scaffolds a production-ready Next.js, Fastify and Supabase monorepo, pre-wired to deploy the web app to Vercel and the API to Railway.

Next.js + Fastify + Supabase Monorepo

Technology Stack

Next.js
Next.js
Fastify
Fastify
Supabase
Supabase
TypeScript
TypeScript
Turborepo
Turborepo
pnpm
pnpm
Tailwind CSS
Tailwind CSS
Zod
Zod
Docker
Docker
Vercel
Vercel
Railway
Railway

Key Features

1

One command to a working monorepo: npx nextjs-fastify-supabase-vercel-railway-monorepo my-app

2

Fastify 5 API with JWT and refresh-token rotation, role-based access control and scoped, hashed API keys

3

Supabase with Row Level Security on every table, Storage uploads and HMAC-signed webhooks

4

Next.js App Router frontend with auth flows, protected routes, TanStack Query, Zustand, Tailwind CSS and Radix UI

5

Turborepo and pnpm workspaces sharing Zod schemas and TypeScript types between the API and the web app

6

Built-in generators for new API features, pages and components, plus Vitest, Swagger docs and GitHub Actions deploys

Screenshots

Next.js + Fastify + Supabase Monorepo featured screenshot

Technical Implementation

Published to npm under the MIT license. The CLI copies a Turborepo template with three packages: a Fastify 5 REST API organised into feature folders (schema, repository, service, controller and route, each with tests), a Next.js App Router web app, and a shared package of Zod schemas and TypeScript types. Strict TypeScript runs across every package, Turborepo pipelines handle dev, build, test, lint and type-check, and GitHub Actions ship the web app to Vercel and the API to Railway through a multi-stage Dockerfile.

Back to Projects