Skip to content

goldk3y/neo-starter

Repository files navigation

πŸš€ Neo

The ultimate Next.js starter template β€” Modern, fast, and production-ready with cutting-edge technologies.

Next.js 15 React TypeScript Supabase Tailwind CSS Bun

✨ Features

  • πŸ—οΈ Next.js 15 β€” Latest React framework with App Router and Turbopack
  • βš›οΈ React 19 β€” Latest React with improved performance and concurrent features
  • 🎨 Tailwind CSS v4 β€” Cutting-edge styling with CSS variables and dark mode
  • πŸŒ“ Dark Mode β€” Built-in theme switching with next-themes (defaults to dark)
  • πŸ” Authentication β€” Complete Supabase auth with SSR, OAuth, and role-based access
  • πŸ—ƒοΈ Database β€” Type-safe Supabase + Drizzle ORM with auto-generated types
  • πŸ›‘οΈ Security β€” Route protection, middleware guards, and RLS policies
  • 🎭 UI Components β€” 11 pre-installed shadcn/ui components with Lucide icons
  • ✨ Animations β€” Motion library for smooth, performant interactions
  • πŸ”’ Type Safety β€” Full TypeScript with Zod validation and T3 Env
  • ⚑ Performance β€” Optimized fonts, images, and server-side rendering
  • πŸ› οΈ Developer Experience β€” Biome linting, comprehensive docs, and examples

πŸš€ Quick Start

Prerequisites

  • Bun (recommended) or Node.js 18+
  • Supabase account (optional)

Installation

# Clone the repository
git clone <your-repo-url> my-app
cd my-app

# Install dependencies
bun install

# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your values

# Run the development server
bun dev

Open http://localhost:3000 to see your application.

πŸ—οΈ Tech Stack

Core

  • Next.js 15.5.2 β€” React framework with App Router and Turbopack
  • React 19 β€” Latest React with improved performance
  • TypeScript 5 β€” Type safety and developer experience
  • Bun β€” Fast JavaScript runtime and package manager

Styling & UI

  • Tailwind CSS v4 β€” Utility-first CSS framework with CSS variables
  • next-themes β€” Perfect dark mode with system detection
  • shadcn/ui β€” Beautifully designed accessible components
  • Lucide Icons β€” Beautiful & consistent icon library
  • Motion β€” Production-ready animation library
  • Geist Font β€” Optimized typography from Vercel

Database & Backend

Developer Tools

  • Biome β€” Fast linter and formatter
  • T3 Env β€” Type-safe environment variables
  • Zod β€” TypeScript-first schema validation

πŸ“ Project Structure

neo/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ favicon.ico        # App favicon
β”‚   β”œβ”€β”€ globals.css        # Global styles and Tailwind imports
β”‚   β”œβ”€β”€ layout.tsx         # Root layout component
β”‚   └── page.tsx           # Home page
β”œβ”€β”€ components/            # Reusable UI components
β”‚   β”œβ”€β”€ ui/               # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ alert.tsx     # Alert component
β”‚   β”‚   β”œβ”€β”€ avatar.tsx    # Avatar component
β”‚   β”‚   β”œβ”€β”€ badge.tsx     # Badge component
β”‚   β”‚   β”œβ”€β”€ button.tsx    # Button component
β”‚   β”‚   β”œβ”€β”€ card.tsx      # Card component
β”‚   β”‚   β”œβ”€β”€ dialog.tsx    # Dialog/Modal component
β”‚   β”‚   β”œβ”€β”€ dropdown-menu.tsx # Dropdown menu component
β”‚   β”‚   β”œβ”€β”€ input.tsx     # Input component
β”‚   β”‚   β”œβ”€β”€ sonner.tsx    # Toast notification component
β”‚   β”‚   β”œβ”€β”€ switch.tsx    # Switch/Toggle component
β”‚   β”‚   └── tabs.tsx      # Tabs component
β”‚   β”œβ”€β”€ mode-toggle.tsx   # Theme toggle component
β”‚   └── theme-provider.tsx # Theme provider wrapper
β”œβ”€β”€ hooks/                # Custom React hooks (ready for use)
β”œβ”€β”€ lib/                  # Utility functions and configurations
β”‚   β”œβ”€β”€ db/               # Database configuration
β”‚   β”‚   β”œβ”€β”€ index.ts      # Database connection
β”‚   β”‚   └── schema.ts     # Database schema definitions
β”‚   β”œβ”€β”€ supabase/         # Supabase client configuration
β”‚   β”‚   β”œβ”€β”€ client.ts     # Client-side Supabase client
β”‚   β”‚   └── server.ts     # Server-side Supabase client
β”‚   β”œβ”€β”€ auth.ts           # Authentication utilities
β”‚   β”œβ”€β”€ env.ts            # Environment variable validation
β”‚   └── utils.ts          # Shared utilities
β”œβ”€β”€ types/                # TypeScript type definitions
β”‚   └── supabase.ts       # Database types (auto-generated)
β”œβ”€β”€ drizzle/              # Database migrations (auto-generated)
β”œβ”€β”€ public/               # Static assets
β”œβ”€β”€ .env.example          # Environment variables template
β”œβ”€β”€ middleware.ts         # Next.js auth middleware
β”œβ”€β”€ biome.json           # Biome configuration
β”œβ”€β”€ components.json      # shadcn/ui configuration
β”œβ”€β”€ drizzle.config.ts    # Drizzle ORM configuration
β”œβ”€β”€ next.config.ts       # Next.js configuration
└── tsconfig.json        # TypeScript configuration

πŸŒ“ Dark Mode & Theming

Neo comes with a comprehensive dark mode implementation using next-themes, providing seamless theme switching with proper SSR support.

Features

  • πŸŒ™ Dark mode by default β€” Launches in dark theme for better UX
  • πŸ”„ Smooth transitions β€” No flash of unstyled content (FOUC)
  • πŸ–₯️ System preference detection β€” Automatically respects user's OS setting
  • πŸ’Ύ Persistence β€” Remembers user's theme choice across sessions
  • ⚑ SSR compatible β€” No hydration mismatches

Theme Toggle

The theme toggle is located on the homepage below "Hello World" and provides three options:

  • Light β€” Clean, bright interface
  • Dark β€” Easy on the eyes (default)
  • System β€” Follows OS preference

Implementation Details

// Theme provider wraps the entire app
<ThemeProvider
  attribute="class"
  defaultTheme="dark"
  enableSystem
  disableTransitionOnChange
>
  {children}
</ThemeProvider>

The theme system uses CSS classes (.dark) to toggle styles, making it compatible with Tailwind CSS's dark mode utilities.

πŸ”§ Configuration

Environment Variables

Neo includes a comprehensive .env.example file with all necessary environment variables. Copy it to .env.local and configure:

# Copy the environment template
cp .env.example .env.local

Required variables:

# Supabase Configuration (Required)
NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key-here
DATABASE_URL=postgresql://postgres:password@host:5432/postgres
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key-here

# Application Configuration
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000

Optional services (uncomment and configure as needed):

  • OpenAI API for AI features
  • Stripe for payment processing
  • Resend for transactional emails
  • Analytics (Google Analytics, PostHog)
  • Error monitoring (Sentry)

The .env.example file includes detailed documentation for each variable with setup instructions.

Database Setup

Neo comes with a complete Drizzle ORM setup for Supabase. Follow these steps to get your database running:

  1. Create a Supabase project

    • Sign up at supabase.com
    • Create a new project
    • Wait for the project to be ready
  2. Configure environment variables

    # Copy the example file
    cp .env.example .env.local
    
    # Add your Supabase credentials to .env.local:
    NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
    DATABASE_URL=postgresql://postgres:[password]@[host]:5432/postgres
  3. Set up your database schema

    # Generate migration files from your schema
    bunx drizzle-kit generate
    
    # Apply migrations to your database
    bunx drizzle-kit migrate
    
    # Optional: Open Drizzle Studio to view your data
    bunx drizzle-kit studio
  4. Example schema included

    • usersTable - User accounts and profiles
    • postsTable - Content management
    • commentsTable - User comments with threading
    • Full relationships and type inference

πŸ” Authentication & Security

Neo includes a complete Supabase authentication system with advanced features:

Authentication Features

  • Email/Password Authentication β€” Traditional signup and login
  • OAuth Integration β€” Google, GitHub, Discord, Facebook, Twitter
  • Magic Links β€” Passwordless authentication via email
  • Password Reset β€” Secure password recovery flow
  • Email Verification β€” Account verification system
  • Session Management β€” Automatic token refresh and persistence

Security Features

  • Route Protection β€” Next.js middleware with automatic redirects
  • Role-based Access Control β€” Admin, moderator, user roles with hierarchy
  • Row Level Security β€” Database-level access control via Supabase
  • CSRF Protection β€” Built-in security measures with SameSite cookies
  • Type-safe Auth β€” Full TypeScript integration throughout

Server-Side Rendering

  • SSR Compatible β€” Full @supabase/ssr integration with Next.js App Router
  • Cookie-based Sessions β€” Secure session persistence across server/client
  • Automatic Refresh β€” Token refresh without user interaction via middleware
  • Client/Server Sync β€” Consistent auth state everywhere with no hydration issues
  • Multiple Client Types β€” Specialized clients for Server Components, API routes, and Server Actions

Usage Examples

Sign up a new user:

import { signUp } from '@/lib/auth'

const result = await signUp('user@example.com', 'password123', {
  name: 'John Doe'
})

Protect API routes:

import { requireAuth } from '@/lib/auth'

export async function POST() {
  const user = await requireAuth() // Throws if not authenticated
  // Handle authenticated request
}

Check user permissions:

import { checkUserRole } from '@/lib/auth'

const canModerate = await checkUserRole('moderator')

Use in components:

import { getCurrentUser } from '@/lib/supabase/server'

export default async function ProtectedPage() {
  const user = await getCurrentUser()
  if (!user) redirect('/login')
  
  return <div>Welcome, {user.email}!</div>
}

Authentication Utilities

The lib/auth.ts file provides comprehensive authentication utilities:

User Management:

  • signUp() - Register new users with email verification
  • signIn() - Authenticate with email/password
  • signInWithOAuth() - OAuth authentication (Google, GitHub, Discord, etc.)
  • signOut() - Secure sign out
  • resetPassword() - Password recovery
  • updatePassword() - Password updates

Profile Management:

  • getCurrentUserProfile() - Get user profile data
  • createUserProfile() - Create user profiles
  • updateUserProfile() - Update user information

Authorization:

  • requireAuth() - Protect API routes (throws if not authenticated)
  • requireRole() - Role-based protection (admin, moderator, user)
  • checkUserRole() - Check user permissions
  • isUserActive() - Check account status

Admin Functions:

  • banUser() - Deactivate user accounts
  • unbanUser() - Reactivate accounts
  • validatePassword() - Password strength validation

Pre-installed Components

Neo comes with essential shadcn/ui components ready to use:

  • Button β€” All interaction types and variants
  • Input β€” Text inputs and form controls
  • Card β€” Content containers and layouts
  • Dialog β€” Modals, confirmations, and overlays
  • Alert β€” Notifications and status messages
  • Badge β€” Labels and status indicators
  • Tabs β€” Content organization and navigation
  • Avatar β€” User profiles and images
  • Sonner β€” Modern toast notifications
  • Switch β€” Toggle controls and settings
  • Dropdown Menu β€” Context menus and actions

Adding More Components

Add additional shadcn/ui components as needed:

bunx shadcn@latest add table
bunx shadcn@latest add select
bunx shadcn@latest add checkbox

πŸ“œ Available Scripts

# Development
bun dev          # Start development server with Turbopack
bun build        # Build for production
bun start        # Start production server

# Code Quality
bun lint         # Lint code with Biome
bun format       # Format code with Biome

# Database
bunx drizzle-kit generate    # Generate database migrations
bunx drizzle-kit migrate     # Apply database migrations
bunx drizzle-kit studio     # Open Drizzle Studio

🎨 Customization

Theming

Neo includes a comprehensive design system with CSS variables that automatically adapt to light and dark modes. The theme system is built with next-themes and Tailwind CSS v4.

Color System

Customize colors in app/globals.css for both light and dark modes:

/* Light mode (default) */
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  /* ... */
}

/* Dark mode */
.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  /* ... */
}

Using Dark Mode in Components

Apply dark mode styles using Tailwind's dark: prefix:

<div className="bg-white dark:bg-black text-black dark:text-white">
  Content that adapts to theme
</div>

Changing Default Theme

Update the default theme in app/layout.tsx:

<ThemeProvider
  attribute="class"
  defaultTheme="light" // Change to "light", "dark", or "system"
  enableSystem
  disableTransitionOnChange
>

Typography

Fonts are configured in app/layout.tsx. Replace Geist with your preferred fonts:

import { Inter, JetBrains_Mono } from "next/font/google";

const inter = Inter({ subsets: ["latin"] });

πŸš€ Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Connect your repo to Vercel
  3. Add environment variables in Vercel dashboard
  4. Deploy automatically on every push

Manual Deployment

# Build the application
bun build

# Start the production server
bun start

🀝 Contributing

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

πŸ“„ License

This project is licensed under the MIT License. See LICENSE for details.

πŸ™ Acknowledgments

  • Next.js team for the incredible React framework
  • Supabase for the powerful backend-as-a-service platform
  • Tailwind CSS for the utility-first CSS framework
  • shadcn for the beautiful and accessible UI components
  • Drizzle Team for the type-safe ORM
  • T3 Stack for environment variable patterns
  • Vercel for fonts and deployment infrastructure

Built with ❀️ using Neo

Get Started Β· Features Β· Tech Stack

About

Production-ready Next.js 15 starter with React 19, TypeScript, Supabase authentication, Drizzle ORM, Tailwind CSS v4, dark mode, and shadcn/ui components. Modern, type-safe, and optimized for rapid development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors