How akshaynstack/reactai works
Main Components
A. Frontend Layer:
• Next.js Application (App Router)
• Main UI Components (/components)
• Authentication Pages (sign-in, sign-up)
• Component Sharing Feature (/share)
• Sandpack Code Viewer Integration
B. Backend Layer:
• API Routes (/app/api)
• Claude AI Integration
• Authentication System
• Database Layer (Prisma + PostgreSQL)
┌─ Client Browser ─────────────────────┐
• ┌─ Next.js Frontend ──────────────┐ │
• Main App Interface │ │
• Component Preview (Sandpack) │ │
• Authentication UI │ │
• ┘ │
• ┘
┌─ API Layer ──────────────────────────┐
• ┌─ Next.js API Routes ─────────────┐ │
• /api/generateCode │ │
• /api/generateNextjsCode │ │
• /api/og (OpenGraph) │ │
• ┘ │
• ┌─ External Services ─────────────┐ │
• Claude AI Integration │ │
• ┘ │
• ┘
┌─ Data Persistence ──────────────────┐
• ┌─ Prisma ORM ──────────────────┐ │
• ┬───────────────────┘ │
• ┌───────────▼───────────────────┐ │
• PostgreSQL Database │ │
• ┘ │
• ┘
Additional Elements
Specific project elements:
• Shadcn UI Components integration
• Authentication middleware
• File structure organization
• Shared utilities and hooks
Technical Details to Note
Annotations for:
• Next.js App Router architecture
• Prisma schema and migrations
• API route implementations
• Authentication flow with [...sign-in] catch-all routes
• Component sharing functionality