Skip to content

Nexus is a production-ready, full-stack monorepo starter kit that provides everything you need to build modern web applications. It combines the power of Next.js 15, Supabase authentication, Prisma ORM, and a beautiful UI powered by Tailwind CSS v4 and shadcn/ui.

License

Notifications You must be signed in to change notification settings

youming-ai/Nexus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Nexus

Next.js Authentication Overview

Full-stack starter kit with authentication, database, and modern UI

Features β€’ Tech Stack β€’ Getting Started β€’ Structure β€’ Deployment


πŸ“‹ Overview

Nexus is a production-ready, full-stack monorepo starter kit that provides everything you need to build modern web applications. It combines the power of Next.js, Supabase authentication, Prisma ORM, and a beautiful UI powered by Tailwind CSS v4 and shadcn/ui.

Key Highlights

  • πŸ” Complete Authentication System - Email/password auth with Supabase
  • 🎨 Modern UI Components - Pre-configured shadcn/ui with Tailwind CSS v4
  • πŸ“¦ Monorepo Architecture - Organized with Turborepo for scalability
  • πŸ—„οΈ Type-safe Database - Prisma ORM with PostgreSQL (Supabase)
  • πŸŒ™ Dark Mode - Built-in theme switching
  • πŸ›‘οΈ Security First - Row Level Security (RLS) policies configured
  • πŸš€ Production Ready - TypeScript, Biome (linting & formatting) pre-configured

✨ Features

Authentication & Authorization

  • βœ… Email/password authentication
  • βœ… Forgot password flow
  • βœ… Email confirmation
  • βœ… Protected routes with middleware
  • βœ… Session management
  • βœ… Supabase Row Level Security (RLS)

Developer Experience

  • βœ… TypeScript throughout
  • βœ… Hot Module Replacement
  • βœ… Shared component library
  • βœ… Consistent code style (Biome)
  • βœ… Git hooks with Husky
  • βœ… Turborepo for fast builds

UI/UX

  • βœ… Responsive design
  • βœ… Dark/light mode
  • βœ… Loading states
  • βœ… Error boundaries
  • βœ… Modern landing page
  • βœ… Form validation with Zod

πŸ›  Tech Stack

Category Technology
Framework Next.js (App Router)
Language TypeScript
Styling Tailwind CSS v4
UI Library shadcn/ui
Database PostgreSQL via Supabase
ORM Prisma
Authentication Supabase Auth
Package Manager pnpm
Monorepo Tool Turborepo
Deployment Vercel

⚑ Getting Started

Prerequisites

1. Clone & Install

# Clone the repository
git clone https://github.com/youming-ai/nexus.git
cd nexus

# Install dependencies
pnpm install

2. Set up Supabase

  1. Create a new Supabase project at supabase.com

  2. Run the SQL scripts in your Supabase SQL editor in this order:

    -- 1. First, run all files in packages/db/supabase/functions/
    -- 2. Then, run all files in packages/db/supabase/rls/
    -- 3. Finally, run all files in packages/db/supabase/triggers/
  3. Configure email templates:

    • Go to Auth templates in your dashboard
    • In the Confirm signup template, change:
      {{ .ConfirmationURL }}
      
      to:
      {{ .SiteURL }}/api/auth/confirm?token_hash={{ .TokenHash }}&type=email
      

3. Environment Variables

Create .env.local in the apps/web directory:

cd apps/web
cp .env.example .env.local

Add your environment variables:

# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# Database (for Prisma)
DATABASE_URL=your_supabase_database_url
DIRECT_URL=your_supabase_direct_url

πŸ’‘ Find these values in your Supabase project settings under Settings > API and Settings > Database

4. Set up the database

# Generate Prisma client
pnpm --filter @workspace/db db:generate

# Run migrations (if any)
pnpm --filter @workspace/db db:push

5. Start development

# Start all apps and packages
pnpm dev

# Or start specific workspace
pnpm --filter web dev

Your app will be available at:


πŸ— Project Structure

nexus/
β”œβ”€β”€ apps/
β”‚   └── web/                    # Next.js web application
β”‚       β”œβ”€β”€ app/                # App router pages and API routes
β”‚       β”œβ”€β”€ components/         # App-specific components
β”‚       β”œβ”€β”€ config/            # App configuration
β”‚       β”œβ”€β”€ lib/               # Utilities and libraries
β”‚       β”œβ”€β”€ modules/           # Feature modules
β”‚       β”œβ”€β”€ public/            # Static assets
β”‚       └── utils/             # Helper functions
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ db/                    # Database package
β”‚   β”‚   β”œβ”€β”€ prisma/            # Prisma schema and migrations
β”‚   β”‚   └── supabase/          # Supabase SQL scripts
β”‚   β”œβ”€β”€ ui/                    # Shared UI component library
β”‚   β”‚   └── src/components/    # Reusable components
β”‚   └── typescript-config/     # Shared TypeScript configuration
β”œβ”€β”€ turbo.json                 # Turborepo configuration
└── pnpm-workspace.yaml        # pnpm workspace configuration

Key Directories

  • apps/web - Main Next.js application with authentication flows
  • packages/db - Database schema, migrations, and RLS policies
  • packages/ui - Shared component library using shadcn/ui
  • apps/web/modules - Feature-based modules (landing, users)
  • apps/web/lib/dal - Data Access Layer for database operations

πŸ“ Available Scripts

Root level commands

# Development
pnpm dev          # Start all packages in development mode
pnpm build        # Build all packages
pnpm lint         # Lint all packages
pnpm format       # Format code with Biome

# Database
pnpm --filter @workspace/db db:generate  # Generate Prisma client
pnpm --filter @workspace/db db:push      # Push schema changes
pnpm --filter @workspace/db db:studio    # Open Prisma Studio

# Add UI components
pnpm --filter web dlx shadcn@latest add [component-name]

Web app specific

cd apps/web
pnpm dev          # Start development server with Turbopack
pnpm build        # Create production build
pnpm start        # Start production server
pnpm lint         # Run Biome linter
pnpm typecheck    # Run TypeScript compiler check

πŸ” Authentication Flow

Nexus implements a complete authentication system:

  1. Sign Up β†’ Email confirmation β†’ Redirect to login
  2. Sign In β†’ Session created β†’ Redirect to dashboard
  3. Protected Routes β†’ Middleware checks β†’ Access granted/denied
  4. Password Reset β†’ Email sent β†’ Reset form β†’ Success

The authentication is handled by Supabase Auth with custom middleware for session management.


πŸš€ Deployment

Deploy to Vercel

  1. Push your code to GitHub

  2. Import your repository on Vercel

  3. Configure environment variables:

    NEXT_PUBLIC_SUPABASE_URL
    NEXT_PUBLIC_SUPABASE_ANON_KEY
    DATABASE_URL
    DIRECT_URL
    
  4. Deploy! πŸŽ‰

Deploy to other platforms

The project can be deployed to any platform that supports Node.js:

# Build the application
pnpm build

# Start production server
pnpm start

🀝 Contributing

We welcome contributions! Please see our contributing guidelines before submitting PRs.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Next.js team for the amazing framework
  • Supabase for the authentication and database
  • shadcn for the beautiful UI components
  • Vercel for hosting and deployment

Built with ❀️ by youming-ai

About

Nexus is a production-ready, full-stack monorepo starter kit that provides everything you need to build modern web applications. It combines the power of Next.js 15, Supabase authentication, Prisma ORM, and a beautiful UI powered by Tailwind CSS v4 and shadcn/ui.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published