How laribright/hotel-management works
Main Components
A. Frontend Layer:
• Next.js App Router Structure
• Web Routes ((web) directory)
• CMS Routes ((cms) directory)
• Component Library
• Theme Provider System
• Authentication Provider
B. Backend Layer:
• API Routes
• Authentication System (NextAuth.js)
• Middleware
• External Services Integration
C. Database & CMS:
• Sanity CMS
• Database Models (User, Room, Booking, Review)
D. External Services:
• Stripe Payment Integration
• Image Storage
┌─ Client Layer ─────────────────────┐
• Next.js Frontend │
• React Components │
• Theme System │
• ┬───────────────────┘
• ↓
┌─ Application Layer ─────────────────┐
• API Routes │
• Authentication │
• Business Logic │
• ┬───────────────────┘
• ↓
┌─ Data & Services Layer ─────────────┐
• Sanity CMS │
• Stripe Integration │
• Storage │
• ┘
Specific Implementation Details
A. Frontend Components (Blue):
• Route structure (/rooms, /auth, /users)
• Components (Header, Footer, BookRoomCta)
• Theme and Auth providers
B. API Layer (Green):
• API routes (/api/auth, /api/room-reviews, /api/stripe)
• Middleware connections
• Authentication flow
C. Data & Services (Purple/Orange):
• Sanity CMS integration
• Stripe payment processing
• User data flow
• Booking system
Important Flows to Highlight
• Authentication Flow:
• User → Auth Provider → NextAuth → Sanity
• Booking Flow:
• User → Room Selection → Stripe → Booking Confirmation
• Review System:
• User → Room Review → API → Sanity CMS
Technical Stack Callouts
• Next.js 13+ with App Router
• Sanity CMS
• NextAuth.js
• Stripe Payment
• TypeScript
• Tailwind CSS
Remember to include:
• Component dependencies
• Data flow directions
• Security boundaries
• Integration points
• State management
• Error handling paths
This will provide a complete picture of the application's architecture while remaining accessible to other developers.