A full-stack implementation of the RealWorld spec (Conduit clone) built with Next.js and Supabase. This project serves as both a production-ready application and a comprehensive training reference for the Supabase + Next.js stack.
- π Table of Contents
- π― Overview
- β¨ Features
- π οΈ Tech Stack
- π¦ Prerequisites
- π Getting Started
- π Project Structure
- π» Development
- π Documentation
- π€ Contributing
- π License
- π₯ Team
This project implements the RealWorld application specification, providing a complete social blogging platform with user authentication, article management, comments, favorites, and tags. Built with modern web technologies, it demonstrates best practices for full-stack development using Next.js App Router and Supabase.
Key Goals:
- Deliver the canonical RealWorld feature set (authentication, profiles, articles, tags, favorites, comments)
- Serve as a Supabase + Next.js starter template and training reference
- Demonstrate server-first architecture with React Server Components
- Showcase Row-Level Security (RLS) for authorization
- Provide comprehensive documentation for onboarding new developers
- β User authentication (register, login, JWT/session)
- β User profiles and settings
- β Articles (CRUD operations)
- β Comments on articles
- β Favorites/bookmarks
- β Tags and tag filtering
- β Global and personal feeds
- β Pagination
- π Authentication flows via Supabase Auth with SSR session injection
- π‘οΈ Authorization via Row-Level Security (RLS) policies
- π Realtime updates for selected domains
- π¦ Storage with signed URLs
- β° Batch jobs via Cron and Edge Functions
- π¬ Queue support (pgmq) for async processing
- π CI/CD with Supabase CLI and GitHub Actions
- Next.js 16 - React framework with App Router
- React 19 - UI library
- TypeScript 5 - Type-safe JavaScript (strict mode)
- Tailwind CSS v4 - Utility-first CSS framework
- Supabase - Backend-as-a-Service (Auth, Postgres, Storage, Realtime)
- pnpm - Fast, disk space efficient package manager
- ESLint 9 - Code linting with
eslint-config-next - Husky - Git hooks
- Commitlint - Conventional commits
- VitePress - Documentation site
- Supabase CLI - Local development and deployment
- Supabase Cron (
pg_cron) and Scheduled Edge Functions - Supabase Queues (pgmq)
Before you begin, ensure you have the following installed:
- Node.js β₯ 18
- pnpm (recommended) or npm
- Supabase CLI - Installation Guide
- Docker Desktop or Podman (for local Supabase)
- Git
- Supabase (by Supabase)
- SQLTools
- ESLint
- Prettier
git clone https://github.com/vndevteam/realworld-nextjs-supabase.git
cd realworld-nextjs-supabasepnpm install# Start Supabase locally
cd supabase
supabase start
# Copy environment variables
cp .env.example .env.local- Create a project at supabase.com/dashboard
- Copy your project URL and anon key
- Create
.env.localin thenextjsdirectory:
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key# From project root
cd nextjs
pnpm devOpen http://localhost:3000 in your browser.
# From project root
pnpm docs:devOpen http://localhost:5173 to view the documentation.
realworld-nextjs-supabase/
βββ nextjs/ # Next.js application
β βββ app/ # App Router pages and layouts
β βββ public/ # Static assets
β βββ package.json
βββ supabase/ # Supabase configuration
β βββ migrations/ # Database migrations
β βββ functions/ # Edge Functions
β βββ config.toml # Supabase config
βββ docs/ # Documentation site
β βββ onboarding-guide/ # Training documentation
β βββ .vitepress/ # VitePress config
βββ openspec/ # OpenSpec change management
β βββ specs/ # Project specifications
β βββ changes/ # Change proposals
βββ package.json # Root workspace config
pnpm docs:dev # Start documentation dev server
pnpm docs:build # Build documentation
pnpm docs:preview # Preview built documentationcd nextjs
pnpm dev # Start development server
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint- TypeScript: Strict mode enabled, explicit types on exports
- React: Server Components by default, Client Components only when needed
- Styling: Tailwind CSS utility-first, co-locate theme tokens in
globals.css - Naming:
- Functions:
verb/verb-phrase(e.g.,getUserProfile,createArticle) - Components:
PascalCase(e.g.,ArticleList,ProfileCard) - Files:
kebab-casefor modules,PascalCasefor React components
- Functions:
- Imports: Use path alias
@/*as configured intsconfig.json
- Server-First: Prefer Server Components and Server Actions
- RLS as Primary Authorization: Encode access control in PostgreSQL policies
- Clear Client Separation: Server-side Supabase client for SSR, client-side only for interactive auth/realtime
- Route Protection: At server layer (RSC/middleware) using Supabase session
- Modular by Domain: Keep features separated (auth, articles, profiles)
- Branching: Feature branches
feat/<topic>, fix branchesfix/<topic> - Commits: Conventional Commits (e.g.,
feat: add article editor,fix: correct tag filter) - Pull Requests: Required for merges, must pass CI checks
Comprehensive documentation is available in the docs/ directory, covering:
- Introduction - Overview of Supabase and the stack
- Setup - Environment preparation and project creation
- Authentication - User auth flows and SSR session handling
- Authorization - Row-Level Security (RLS) policies
- Integration - Supabase + Next.js integration patterns
- Advanced - Edge Functions, Cron, Queues
- Performance - Optimization strategies
- Security - Best practices and guidelines
- CI/CD - Deployment and DevOps
- Observability - Debugging and monitoring
View the documentation locally:
pnpm docs:devOr access the online version (when deployed).
Contributions are welcome! Please follow these guidelines:
- OpenSpec Workflow: For planning or proposals, check
openspec/AGENTS.md - Conventional Commits: Use the commit message format
- Code Quality: Ensure linting passes and types are correct
- Documentation: Update docs when adding features
- Pull Requests: Provide clear descriptions and ensure CI passes
- Code follows project conventions
- TypeScript types are explicit and correct
- ESLint passes without errors
- Server-first patterns are followed
- RLS policies are tested
- Documentation is updated (if needed)
This project is licensed under the MIT License - see the LICENSE file for details.
VNDevTeam - Internal training and development team