Comprehensive architectural blueprint integrating feature-based structure, layered architecture, and service patterns.
Reference: CONST-P1 (Modular Architecture), CONST-P8 (API First & Service Layer), CONST-P2 (AI-Driven Development)
Following clean architecture principles with clear separation of concerns:
┌─────────────────────────────────────────┐
│ Presentation Layer │
│ (UI Components, Pages, User Interface) │
├─────────────────────────────────────────┤
│ Application Layer │
│ (Custom Hooks, State Management) │
├─────────────────────────────────────────┤
│ Domain Layer │
│ (Business Logic, Services, Utils) │
├─────────────────────────────────────────┤
│ Infrastructure Layer │
│ (APIs, Database, External Deps) │
└─────────────────────────────────────────┘
Layer Responsibilities:
src/
├── app/ # Next.js App Router ✅
│ ├── admin/ # Admin dashboard pages ✅
│ ├── api/ # API routes ✅
│ ├── rsvp/ # RSVP page ✅
│ ├── story/ # Wedding story ✅
│ ├── moments/ # Photo gallery ✅
│ ├── schedule/ # Wedding schedule ✅
│ ├── globals.css # Global styles ✅
│ ├── layout.tsx # Root layout with fonts ✅
│ └── page.tsx # Homepage ✅
├── features/ # Feature modules 🚧 PHASE 2
│ ├── auth/ # Authentication Feature
│ │ ├── components/ # Login forms, auth UI
│ │ ├── hooks/ # useAuth, useLogin, useLogout
│ │ ├── services/ # Authentication API calls
│ │ ├── types/ # ✅ Auth types with Zod schemas
│ │ └── index.ts # Clean feature exports
│ ├── rsvp/ # RSVP Management Feature
│ │ ├── components/ # RSVP forms, confirmation UI
│ │ ├── hooks/ # useRSVP, useRSVPValidation
│ │ ├── services/ # RSVP API integration
│ │ ├── types/ # ✅ RSVP types with validation
│ │ └── index.ts
│ ├── admin/ # Admin Dashboard Feature
│ │ ├── components/ # Dashboard, tables, analytics
│ │ ├── hooks/ # Admin data management hooks
│ │ ├── services/ # Admin API operations
│ │ ├── types/ # Admin-specific types
│ │ └── index.ts
│ └── content/ # Wedding Content Feature
│ ├── components/ # Story, moments, schedule components
│ ├── hooks/ # Content management hooks
│ ├── services/ # Content API operations
│ ├── types/ # Content types and schemas
│ └── index.ts
├── shared/ # Cross-cutting concerns ✅
│ ├── components/ # ✅ Reusable UI (Button, Card, Input)
│ ├── hooks/ # ✅ Shared React hooks
│ ├── utils/ # ✅ Utility functions
│ ├── types/ # ✅ Global types with Zod validation
│ ├── constants/ # App-wide constants
│ ├── services/ # 🚧 Shared service utilities
│ └── styles/ # ✅ Theme configuration
└── lib/ # 🚧 Core infrastructure
├── api/ # HTTP client, interceptors
├── auth/ # Authentication utilities
├── db/ # Database abstraction
├── validation/ # Validation utilities
└── utils.ts # ✅ Utility functions
│ └── styles/ # Global styles ├── lib/ # Third-party integrations │ ├── database.ts # Database client │ ├── email.ts # Email service │ └── validation.ts # Validation schemas └── tests/ # Test utilities
## Design System
### Colors (Tailwind Config)
```js
colors: {
primary: {
50: '#fdf4ff',
500: '#a855f7',
900: '#581c87',
},
secondary: {
50: '#f0f9ff',
500: '#3b82f6',
900: '#1e3a8a',
},
// ... wedding theme colors
}
GET /api/rsvps
- List RSVPs (admin only)POST /api/rsvps
- Create RSVPPUT /api/rsvps/:id
- Update RSVPDELETE /api/rsvps/:id
- Delete RSVPGET /api/content
- Get wedding contentPOST /api/auth/login
- Admin logininterface RSVP {
id: string;
name: string;
email: string;
attendance: 'yes' | 'no';
dietary: string;
plusOne: boolean;
plusOneName?: string;
createdAt: Date;
updatedAt: Date;
}
interface WeddingContent {
story: string;
schedule: Event[];
registry: RegistryItem[];
// ... other content
}