- Next.js 15.4.5 - React framework with App Router
- React 19.1.0 - UI library with latest features
- TypeScript - Type-safe development
- Prisma 6.14.0 - Database ORM with type generation
- MySQL - Production database
- SQLite - Development database (
prisma/dev.db)
- NextAuth.js 4.24.7 - Authentication with JWT strategy
- React Query - Server state management and caching
- Zustand - Client-side state management
- Tailwind CSS 4 - Utility-first CSS framework
- Headless UI - Unstyled accessible components
- Heroicons - Icon library
- Framer Motion - Animation library
- Jest - Unit testing framework
- Playwright - End-to-end testing
- ESLint - Code linting
- TypeScript - Static type checking
The application is configured for server-side rendering with dynamic features:
// next.config.ts - Current configuration
const nextConfig: NextConfig = {
// Static export disabled due to NextAuth incompatibility
// output: 'export',
images: { unoptimized: true },
basePath: process.env.NODE_ENV === 'production' ? '' : '',
};output: 'export') is disabled because:
- NextAuth.js Incompatibility: Requires server-side session handling
- API Routes: Admin dashboard needs server-side API endpoints
- Database Operations: Dynamic RSVP processing requires server runtime
If dynamic features are not required, static export could be enabled by:
- Removing NextAuth.js authentication
- Converting API routes to client-side operations
- Using external services for form processing
- Enabling
output: 'export'in Next.js config
However, this would eliminate admin functionality and database integration.
client/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (admin)/ # Protected admin routes
│ │ ├── api/ # Server-side API endpoints
│ │ ├── auth/ # Authentication pages
│ │ ├── events/ # Wedding events pages
│ │ ├── gallery/ # Photo gallery
│ │ ├── rsvp/ # RSVP functionality
│ │ ├── layout.tsx # Root layout
│ │ └── page.tsx # Homepage
│ ├── components/ # Reusable React components
│ │ ├── ui/ # Basic UI components
│ │ ├── forms/ # Form components
│ │ └── layout/ # Layout components
│ ├── lib/ # Utilities and configurations
│ │ ├── auth.ts # NextAuth configuration
│ │ ├── prisma.ts # Database client
│ │ ├── validations.ts # Zod schemas
│ │ └── utils.ts # Helper functions
│ └── types/ # TypeScript type definitions
├── prisma/ # Database schema and migrations
│ ├── schema.prisma # Database schema
│ ├── seed.ts # Sample data seeding
│ └── migrations/ # Database migrations
├── public/ # Static assets
├── e2e/ # End-to-end tests
└── src/__tests__/ # Unit tests
- RSVP submissions and responses
- Guest information and dietary preferences
- Wedding event details and schedules
- Photo gallery content
- Admin dashboard data
// Example: RSVP data fetching
const { data: rsvpData, isLoading } = useQuery({
queryKey: ['rsvp', rsvpCode],
queryFn: () => fetchRSVPData(rsvpCode),
});- Form input states and validation
- Modal and overlay visibility
- Navigation and menu states
- User preferences and settings
// Example: UI state store
interface UIStore {
isMenuOpen: boolean;
activeModal: string | null;
toggleMenu: () => void;
openModal: (modal: string) => void;
}- Admin authentication status
- User session data
- Protected route access
User Interaction → Component State → React Query → API Route → Database
↓
Component Re-render ← State Update ← Response Processing ← Database Response
Login Request → NextAuth.js → JWT Token → Session Storage → Protected Routes
Guest Input → Form Validation → API Submission → Database Update → Confirmation
GET/POST /api/rsvp- RSVP managementGET/POST /api/guests- Guest informationGET/POST /api/events- Wedding eventsGET/POST /api/gallery- Photo galleryPOST /api/auth/[...nextauth]- Authentication
// Consistent API response format
interface APIResponse<T> {
data?: T;
error?: string;
status: number;
}- Zod schemas for type-safe validation
- Server-side validation before database operations
- Client-side validation for better UX
- Guests - Visitor information and contact details
- RSVPs - Response tracking and dietary preferences
- Events - Wedding ceremony and reception details
- Photos - Gallery content with metadata
- Admin - Authentication and management users
model Guest {
id String @id @default(cuid())
name String
email String?
rsvps RSVP[]
createdAt DateTime @default(now())
}
model RSVP {
id String @id @default(cuid())
guestId String
guest Guest @relation(fields: [guestId], references: [id])
attending Boolean
dietary String?
createdAt DateTime @default(now())
}- Next.js automatic code splitting
- Image optimization with
next/image - Bundle analysis with
ANALYZE=1 npm run build - Tree shaking for unused code elimination
- Server-side rendering for fast initial loads
- React Query caching for reduced API calls
- Lazy loading for non-critical components
- Optimized images and assets
- Prisma query optimization
- Connection pooling in production
- Indexed fields for common queries
- Efficient data fetching patterns
- JWT tokens with secure secrets
- Session-based admin protection
- CSRF protection via NextAuth.js
- Secure cookie configuration
- Environment variable isolation
- Database connection encryption
- Input validation and sanitization
- XSS prevention with React's built-in escaping
- HTTPS enforcement
- Security headers configuration
- Regular dependency updates
- Vulnerability scanning with
npm audit
- Client-side error boundaries
- Server-side error logging
- Database operation monitoring
- Performance metrics collection
- TypeScript for compile-time checks
- ESLint for code quality
- Playwright for E2E testing
- Jest for unit testing
- Single MySQL database instance
- Server-side rendering bottlenecks
- File-based session storage
- Database replication for read operations
- CDN integration for static assets
- Redis for session and query caching
- Horizontal scaling with load balancers
- Cloudinary - Image upload and optimization
- Resend - Email delivery service
- Google Maps - Venue location integration
- Calendar APIs - Event scheduling
- Tailwind for styling consistency
- Framer Motion for smooth animations
- React Hook Form for form management
- Date-fns for date manipulation
- SQLite database for quick setup
- Hot reload with Turbopack
- Environment variable isolation
- Mock services for external APIs
- Jest for unit testing
- Playwright for integration tests
- Test database isolation
- Mocked external services
- MySQL database with proper credentials
- PM2 process management
- Nginx reverse proxy
- SSL/TLS termination
This architecture ensures a robust, scalable, and maintainable wedding website that can handle the special requirements of Incia & Arvin's celebration while providing excellent user experience for all wedding guests.