How locastic/next-web3-hybrid-starter works
Main Components
Frontend Layer:
• Next.js Application (App Router)
• RainbowKit Web3 Components
• UI Components (shadcn/ui)
• Client-side Authentication State
Backend Layer:
• Next.js Server Components & Server Actions
• Authentication Middleware
• Database Layer (PostgreSQL/Supabase)
• Web3 Integration Layer
┌─ Client Layer ─────────────────────┐
• ┌─ Next.js App Router ───────────┐ │
• Root Layout │ │
• Dashboard │ │
• Security │ │
• ┘ │
• ┌─ Web3 Components ──────────────┐ │
• RainbowKit Provider │ │
• Wallet Connection │ │
• ┘ │
• ┘
┌─ Server Layer ──────────────────────┐
• ┌─ Authentication ───────────────┐ │
• JWT Cookies │ │
• Middleware Protection │ │
• ┘ │
• ┌─ Server Actions ──────────────┐ │
• Auth Actions │ │
• User Actions │ │
• ┘ │
• ┘
┌─ Data Layer ───────────────────────┐
• ┌─ Supabase ──────────────────┐ │
• Auth Users │ │
• Public Profiles │ │
• RLS Policies │ │
• ┘ │
• ┌─ Web3 Integration ────────────┐ │
• Client Operations │ │
• Server Operations │ │
• ┘ │
• ┘
Important Flows to Highlight
Authentication Flow:
User → RainbowKit → JWT Cookies → Server Middleware → Protected Routes
Data Flow:
Client → Server Actions → RLS Wrapper → Database
Technical Details
• DrizzleORM integration with Supabase
• Next.js App Router structure
• Server Actions middleware stack
• Web3 client/server separation