Project Architecture
This document provides a high-level overview of the wedding website's architecture. The project is a full-stack application built with Next.js, leveraging its capabilities for both client-side rendering and server-side Route Handlers.
Core Components
The application is composed of three main parts:
- Frontend: A React-based user interface built with Next.js App Router.
- Backend: Serverless Route Handlers built with Next.js App Router.
- Database: A PostgreSQL database managed with Prisma ORM.
Deployment Architecture & Single-Site Default
The default supported architecture is one deployment = one wedding site:
- Single Canonical Config: Every deployment loads a single canonical configuration (
id: "global"). - Simplified Setup: No wildcard DNS, tenant concepts, or subdomain routing are required for standard setups.
- Provider-Neutral Host Filtering: Strict host and
X-Forwarded-Hostvalidation prevents host header injection and HTTP host spoofing without binding site data to incoming Host headers. - Optional Multi-Profile Subdomain Routing: Subdomain-based
AppConfigprofile routing (X-Forwarded-Hostchecked beforeHostinsrc/lib/config.ts) can be enabled viaMULTISITE_ENABLED=true.MULTISITE_ENABLEDswitchesAppConfigbranding/profile rows only;prisma/schema.prismashares the other 15 tables across subdomains without tenant row isolation.
Environment Specifications
For detailed runtime requirements, host configuration, environment variable specifications, and lifecycle expectations, see the authoritative Application Runtime Contract.
- Node.js: v22.x
- Next.js: 16.x
- React: 19.x
- Prisma: 7.x
- Zod: 4.x
1. Frontend
The frontend is built using Next.js and React. It is responsible for rendering the user interface that guests and administrators interact with.
- Location:
src/app/ - Key Technologies:
- React: For building UI components.
- Next.js: For App Router, server-side rendering, and client-side navigation.
- Tailwind CSS: For styling.
- Framer Motion: For animations.
- React Query: For managing server state, caching, and data fetching.
- Structure:
- App Router (
src/app/): Uses the Next.js App Router where directories define the routes andpage.tsxrenders the UI. - Components (
src/components/): Reusable UI elements are located here. - Admin UI: A separate set of pages and components under
src/app/admin/provides an interface for managing the website.
- App Router (
2. Backend (API)
The backend is a set of serverless functions implemented as Next.js Route Handlers. These routes handle business logic, data validation, and communication with the database.
- Location:
src/app/api/ - Key Technologies:
- Next.js Route Handlers: For creating serverless API endpoints.
- Prisma: As the ORM for database access.
- Route Groups & Access Tiers: Most API route handlers under
src/app/api/**/route.{ts,tsx}wrap execution withwithApiMiddleware(src/utils/withApiMiddleware.ts), while specialized binary, probe, and webhook endpoints stream responses directly (exact handler and wrapper totals are synchronized automatically in the inventory below). Edge perimeter and role rules are enforced by src/middleware.ts and src/lib/routes.ts:GET /api/og(src/app/metadata.ts),GET /api/admin/me, andPOST /api/admin/logoutbypass the Edge cookie gate asPublicendpoints (retainingwithApiMiddlewarerate limits on/api/og,/api/admin/me, and/api/admin/logout);/api/media(GET,POST),/api/media/[id](PUTandDELETEmetadata mutations only, with noGETasset resolver), and/api/media/export(GET,POST) are strictlyAdmin-onlyroutes gated byisAdminRequest;/api/guest/addressand/api/rsvprequire a personalizedguest_invite_sessioncookie (Invite-only, verified viagetGuestInviteSession);/api/cron/*routes requireAuthorization: Bearer <CRON_SECRET>; and/api/registry/webhook/stripebypasses the Edge cookie gate onPOSTonly while enforcing cryptographicstripe-signatureverification (STRIPE_WEBHOOK_SECRET).
Total API route handlers: 88 across 14 route groups.
- Middleware Wrapper (
withApiMiddleware): 84 wrapped handlers; 4 unwrapped (/api/live,/api/ready,/api/registry/webhook/stripe,/api/uploads/[...path]). - Handler Session & Webhook Gates:
Invite-onlyhandlers (/api/guest/address,/api/rsvp,/api/rsvp/draft) require a verifiedguest_invite_sessioncookie viagetGuestInviteSession;/api/registry/webhook/stripebypasses the Edge cookie gate onPOSTinsrc/middleware.ts(retaining Edge cookie enforcement on other methods) and verifiesstripe-signature(STRIPE_WEBHOOK_SECRET) in the handler.
Admin Routes (/api/admin — 51 handlers)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/admin/[entity] | src/app/api/admin/[entity]/route.ts | GET, POST, PUT | Admin-only |
/api/admin/[entity]/[id] | src/app/api/admin/[entity]/[id]/route.ts | GET, PUT, DELETE | Admin-only |
/api/admin/[entity]/batch | src/app/api/admin/[entity]/batch/route.ts | POST, PUT, PATCH, DELETE | Admin-only |
/api/admin/broadcast/[id] | src/app/api/admin/broadcast/[id]/route.ts | GET | Admin-only |
/api/admin/broadcast/history | src/app/api/admin/broadcast/history/route.ts | GET | Admin-only |
/api/admin/broadcast/preview | src/app/api/admin/broadcast/preview/route.ts | POST | Admin-only |
/api/admin/broadcast/retry | src/app/api/admin/broadcast/retry/route.ts | POST | Admin-only |
/api/admin/broadcast/schedule/[id] | src/app/api/admin/broadcast/schedule/[id]/route.ts | DELETE | Admin-only |
/api/admin/broadcast/send | src/app/api/admin/broadcast/send/route.ts | POST | Admin-only |
/api/admin/broadcast/test-connection | src/app/api/admin/broadcast/test-connection/route.ts | POST | Admin-only |
/api/admin/broadcast/test-send | src/app/api/admin/broadcast/test-send/route.ts | POST | Admin-only |
/api/admin/contributors/[id] | src/app/api/admin/contributors/[id]/route.ts | PATCH, DELETE | Admin-only |
/api/admin/contributors/[id]/action | src/app/api/admin/contributors/[id]/action/route.ts | POST | Admin-only |
/api/admin/features | src/app/api/admin/features/route.ts | GET, PUT | Admin-only |
/api/admin/geocode | src/app/api/admin/geocode/route.ts | GET | Admin-only |
/api/admin/invitation-codes/batch | src/app/api/admin/invitation-codes/batch/route.ts | POST, PUT, PATCH, DELETE | Admin-only |
/api/admin/invitation-codes/batch/validate | src/app/api/admin/invitation-codes/batch/validate/route.ts | POST | Admin-only |
/api/admin/invitation-codes/catalog | src/app/api/admin/invitation-codes/catalog/route.ts | GET | Admin-only |
/api/admin/invitation-codes/export | src/app/api/admin/invitation-codes/export/route.ts | GET | Admin-only |
/api/admin/invitation-codes/merge | src/app/api/admin/invitation-codes/merge/route.ts | POST | Admin-only |
/api/admin/invitation-codes/rsvps | src/app/api/admin/invitation-codes/rsvps/route.ts | GET, PUT | Admin-only |
/api/admin/invitation-codes/validate | src/app/api/admin/invitation-codes/validate/route.ts | POST | Admin-only |
/api/admin/login | src/app/api/admin/login/route.ts | POST | Public |
/api/admin/logout | src/app/api/admin/logout/route.ts | POST | Public |
/api/admin/maintenance/export | src/app/api/admin/maintenance/export/route.ts | GET | Admin-only |
/api/admin/maintenance/import | src/app/api/admin/maintenance/import/route.ts | POST | Admin-only |
/api/admin/me | src/app/api/admin/me/route.ts | GET | Public |
/api/admin/onboarding-milestones | src/app/api/admin/onboarding-milestones/route.ts | GET | Admin-only |
/api/admin/photos/[id] | src/app/api/admin/photos/[id]/route.ts | PATCH | Admin-only |
/api/admin/photos/moderation | src/app/api/admin/photos/moderation/route.ts | GET, PATCH | Admin-only |
/api/admin/photos/moderation/batch | src/app/api/admin/photos/moderation/batch/route.ts | POST | Admin-only |
/api/admin/photos/qr | src/app/api/admin/photos/qr/route.ts | GET, POST | Admin-only |
/api/admin/registry/items/[id]/unclaim | src/app/api/admin/registry/items/[id]/unclaim/route.ts | POST | Admin-only |
/api/admin/sample-data | src/app/api/admin/sample-data/route.ts | GET, POST, DELETE | Admin-only |
/api/admin/seating/assign | src/app/api/admin/seating/assign/route.ts | POST | Admin-only |
/api/admin/seating/auto-assign | src/app/api/admin/seating/auto-assign/route.ts | POST | Admin-only |
/api/admin/seating/export | src/app/api/admin/seating/export/route.ts | GET | Admin-only |
/api/admin/settings | src/app/api/admin/settings/route.ts | GET, POST, PUT | Admin-only |
/api/admin/setup | src/app/api/admin/setup/route.ts | GET, POST | Public |
/api/admin/sub-events/access | src/app/api/admin/sub-events/access/route.ts | GET, PUT | Admin-only |
/api/admin/sub-events/access/batch | src/app/api/admin/sub-events/access/batch/route.ts | POST | Admin-only |
/api/admin/sub-events/rsvp-summary | src/app/api/admin/sub-events/rsvp-summary/route.ts | GET | Admin-only |
/api/admin/thank-you-notes | src/app/api/admin/thank-you-notes/route.ts | GET, POST | Admin-only |
/api/admin/thank-you-notes/[id] | src/app/api/admin/thank-you-notes/[id]/route.ts | PATCH | Admin-only |
/api/admin/thank-you-notes/[id]/send-email | src/app/api/admin/thank-you-notes/[id]/send-email/route.ts | POST | Admin-only |
/api/admin/thank-you-notes/batch | src/app/api/admin/thank-you-notes/batch/route.ts | POST | Admin-only |
/api/admin/thank-you-notes/export | src/app/api/admin/thank-you-notes/export/route.ts | GET | Admin-only |
/api/admin/thank-you-notes/export-labels | src/app/api/admin/thank-you-notes/export-labels/route.ts | GET | Admin-only |
/api/admin/upload | src/app/api/admin/upload/route.ts | POST | Admin-only |
/api/admin/versions | src/app/api/admin/versions/route.ts | GET | Admin-only |
/api/admin/versions/[id]/restore | src/app/api/admin/versions/[id]/restore/route.ts | POST | Admin-only |
Cron Routes (/api/cron — 1 handler)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/cron/broadcasts | src/app/api/cron/broadcasts/route.ts | GET, POST | Bearer (CRON_SECRET) |
Guest Routes (/api/guest — 7 handlers)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/guest/address | src/app/api/guest/address/route.ts | GET, PUT | Invite-only |
/api/guest/address/public | src/app/api/guest/address/public/route.ts | POST | Public |
/api/guest/login | src/app/api/guest/login/route.ts | POST | Public |
/api/guest/lookup | src/app/api/guest/lookup/route.ts | POST | Guest / Admin |
/api/guest/photos/upload | src/app/api/guest/photos/upload/route.ts | POST | Guest / Admin |
/api/guest/recover | src/app/api/guest/recover/route.ts | GET, POST | Public |
/api/guest/session | src/app/api/guest/session/route.ts | GET, DELETE | Public |
Health Check Routes (/api/health — 1 handler)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/health | src/app/api/health/route.ts | GET | Public |
Liveness Probe Routes (/api/live — 1 handler)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/live | src/app/api/live/route.ts | GET | Public |
Media Routes (/api/media — 3 handlers)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/media | src/app/api/media/route.ts | GET, POST | Admin-only |
/api/media/[id] | src/app/api/media/[id]/route.ts | PUT, DELETE | Admin-only |
/api/media/export | src/app/api/media/export/route.ts | GET, POST | Admin-only |
Open Graph Routes (/api/og — 1 handler)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/og | src/app/api/og/route.tsx | GET | Public |
Photos Routes (/api/photos — 2 handlers)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/photos | src/app/api/photos/route.ts | GET | Guest / Admin |
/api/photos/upload | src/app/api/photos/upload/route.ts | POST | Guest / Admin |
Readiness Probe Routes (/api/ready — 1 handler)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/ready | src/app/api/ready/route.ts | GET | Public |
Registry Routes (/api/registry — 14 handlers)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/registry/capabilities | src/app/api/registry/capabilities/route.ts | GET | Guest / Admin |
/api/registry/claim | src/app/api/registry/claim/route.ts | GET, POST | Public |
/api/registry/contribute | src/app/api/registry/contribute/route.ts | POST | Guest / Admin |
/api/registry/items | src/app/api/registry/items/route.ts | GET, POST | Guest / Admin (GET); Admin-only (POST) |
/api/registry/items/[id] | src/app/api/registry/items/[id]/route.ts | GET, PUT, DELETE | Guest / Admin (GET); Admin-only (PUT, DELETE) |
/api/registry/items/batch | src/app/api/registry/items/batch/route.ts | POST | Admin-only |
/api/registry/payment-intent | src/app/api/registry/payment-intent/route.ts | POST | Guest / Admin |
/api/registry/payment-intent/reconcile | src/app/api/registry/payment-intent/reconcile/route.ts | POST | Guest / Admin |
/api/registry/scrape | src/app/api/registry/scrape/route.ts | POST | Admin-only |
/api/registry/scrape/batch | src/app/api/registry/scrape/batch/route.ts | POST | Admin-only |
/api/registry/session | src/app/api/registry/session/route.ts | GET, DELETE | Guest / Admin |
/api/registry/stores | src/app/api/registry/stores/route.ts | GET, POST | Guest / Admin (GET); Admin-only (POST) |
/api/registry/validate-code | src/app/api/registry/validate-code/route.ts | GET, POST | Public |
/api/registry/webhook/stripe | src/app/api/registry/webhook/stripe/route.ts | POST | stripeSignature (STRIPE_WEBHOOK_SECRET) |
RSVP Routes (/api/rsvp — 2 handlers)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/rsvp | src/app/api/rsvp/route.ts | POST | Invite-only |
/api/rsvp/draft | src/app/api/rsvp/draft/route.ts | GET, PATCH | Invite-only |
Schedule Routes (/api/schedule — 2 handlers)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/schedule | src/app/api/schedule/route.ts | GET | Guest / Admin |
/api/schedule/[id]/ics | src/app/api/schedule/[id]/ics/route.ts | GET | Guest / Admin |
Uploads Routes (/api/uploads — 1 handler)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/uploads/[...path] | src/app/api/uploads/[...path]/route.ts | GET, HEAD | Guest / Admin |
Weather Routes (/api/weather — 1 handler)
| Route | Handler | Methods | Access Tier |
|---|---|---|---|
/api/weather | src/app/api/weather/route.ts | GET | Guest / Admin |
3. Database
The database stores all application data using PostgreSQL managed via Prisma ORM.
- Location: The schema is defined in prisma/schema.prisma.
- Key Technologies:
- PostgreSQL: Relational database implementing the project's standard database contract (compatible with local PostgreSQL, Neon, Supabase, Railway, AWS RDS, GCP Cloud SQL, etc. as labeled host examples).
- Prisma: The ORM used to define the schema and interact with the database in a type-safe way.
- Data Models:
AppConfig: Stores global site settings, partner details, wedding date and venue parameters, visual theme tokens, feature toggles, and email/SMS broadcast provider credentials.Media: Stores uploaded media metadata (URLs, alt text, decorative/sample flags) referenced by wedding party members, attractions, and registry items.WeddingPartyMember: Represents members of the wedding party with name, role, bio, side (BRIDE,GROOM,JOINT), display order, and optional media relationship.Attraction: Represents local attraction and accommodation recommendations, including categories, map coordinates, booking URLs, promo codes, and shuttle information.RegistryItem: Represents gift registry items with item type, price, display order, quantity, group gift / most wanted flags, purchase status, and total contributed amount.ExternalRegistry: Stores linked external partner store registries (name,provider,url, optional guestnote,displayOrder,isVisible, andisSample) in prisma/schema.prisma for the public/registrystore directory without automated product scraping.Contributor: Stores guest financial contributions towards registry items, including contributor contact info, contribution amounts, custom messages, and thank-you note status.InvitationCode: Stores unique guest invitation passes, guest names, mailing addresses, dietary notes, plus-one allocations, party tags, assigned table and inline seat references (tableId,seatNumber,plusOneSeatNumbers), and projected aggregate RSVP state (used,usedAt,plusOneFirstName,plusOneLastName,dietaryNotes, and JSONextraFields).HouseholdMember: Stores normalized per-person party member profiles (fullName,firstName,lastName,role,email,phone, standingdietaryNotes,tags,displayOrder, andseatNumber) in prisma/schema.prisma linked toInvitationCodewith cascading deletes.SeatingTable: Stores reception seating tables with table name, shape, seat capacity, and floor plan coordinate attributes (x,y,width,height,rotation).ContentNode: Provides dynamic CMS content storage for site copy, FAQ entries, announcements, and key-value JSON attributes tagged by domain (including legacy or lightweightScheduleandLogisticsentries that coexist as read-only schedule fallbacks when noSubEventrows match).SnapshotVersion: Stores audit logs and JSON entity snapshot history for change tracking and point-in-time state restoration.SubEvent: Represents individual wedding schedule items (e.g., rehearsal dinner, ceremony, reception) in prisma/schema.prisma with start/end times, venue details, privacy settings (isPrivate), and structured JSONB configuration columns (mealOptionsandcustomQuestions).SubEventAccess: Junction table defining explicit access permissions for private sub-events mapped to guest invitation codes.SubEventRsvp: Canonical per-event RSVP table in prisma/schema.prisma storing attendancestatus,plusOneCount,dietaryNotes, and structured JSONB response columns (mealSelections,customAnswers, andplusOneNames).SubEventMemberRsvp: Stores relational per-member event response rows (status,mealOptionId, and event-specificdietaryNotes) in prisma/schema.prisma linked toSubEventRsvpandHouseholdMember.BroadcastMessage: Stores outbound email and SMS communication broadcasts, tracking target filters, delivery status, send timestamps, and dispatch counts.BroadcastRecipient: Stores individual delivery logs for broadcast messages, recording destination addresses, delivery status, and error details.AuthLockout: Stores HMAC-SHA256 hashed IP rate-limit and authentication lockout counters (keyHash,count,resetAt) in prisma/schema.prisma to synchronize brute-force lockouts across application instances.
- Canonical
SubEventRsvpProjection &ContentNodeCoexistence:- Canonical
SubEventRsvp->InvitationCodeSynchronization: Guest submissions (POST /api/rsvp) and administrative RSVP overrides inSubEventService(src/features/sub-events/service.ts) transactionally project aggregate RSVP state fromSubEventRsvpontoInvitationCode(used,usedAt,plusOneFirstName,plusOneLastName,dietaryNotes, andextraFieldskeysattendanceStatus,plusOneCount,plusOneNames,dietaryTags,mealSelections,mealSummary,customAnswers,customAnswersSummary, andeventRsvps). Downstream seating and roster helpers—specificallygetGuestAttendanceStatus,isGuestEligibleForSeating, andgetDietaryBadgesin src/features/seating/utils/seatingHelpers.ts—consume those projectedInvitationCodefields.SubEventRsvpremains authoritative for attendance, meal, and custom-question responses (batchInvitationCodeedits strip reserved RSVP projection keys rather than back-populatingSubEventRsvpattendance), whileInvitationCodeAdminService.update(src/features/registry/invitation-code.admin.service.ts) synchronizes updated guest/plus-one names onto attendingSubEventRsvprecords and recomputes projectedInvitationCode.extraFieldssummaries. - Read-Only
ContentNodeSchedule Fallbacks: When a requested schedule item has noSubEventrecord,SubEventService(src/features/sub-events/service.ts) falls back toScheduleorLogisticsContentNoderecords withisReadOnly: true(enforcingisPrivateContentNodeaccess checks and rejecting RSVP submissions against read-only fallback nodes with HTTP400). On the homepage,HomePageClient(src/components/home/HomePageClient.tsx) rendersInteractiveTimelinewhenever structuredScheduleorstartTimeentries exist incontentNodesand falls back toLogisticsceremony/reception summary cards (ceremonyTitle,receptionTitle) otherwise.
- Canonical
The use of Prisma allows for easy schema management through migrations and provides a type-safe client for querying the database from the backend API. The project uses PostgreSQL as the sole active database layer for both local development and production.
4. Core Framework Infrastructure
To establish consistent data access, transaction management, state auditing, and session security across all application features, the codebase utilizes a centralized core framework layer located in src/core/.
Infrastructure Data Access Layer (src/core/infrastructure/)
BaseRepository(src/core/infrastructure/repository.ts): The foundation for database interactions. It encapsulates standard Prisma CRUD queries (findMany,findUnique,create,update,delete), supports transactional execution viatransaction(), and allows client context swapping withwithClient(). Deletion operations automatically callcreateAuditSnapshotto record deletion audit logs.BaseService(src/core/infrastructure/service.ts): The foundation for business logic services. It wrapsBaseRepositoryinstances, provides default query argument merging for sorting and relations, and enforces transactional mutation lifecycles. It includes extensibility hooks (validate,preSave) and manages point-in-time audit snapshot creation (createSnapshot) whenever records are created or updated. It also provides a built-in utility for record reordering (reorder).
Authentication Modules (src/core/auth/)
- Shared Token & Cookie Primitives (src/core/auth/tokenCookieHelpers.ts): Centralizes compact token signing (
signCompactTokenproducingbase64url(payload).base64url(signature)via HMAC-SHA256), constant-time signature verification (verifyCompactTokenusingtimingSafeEqualJS), and request cookie extraction (readRequestCookiereading fromNextRequest.cookies, rawcookieheaders, or Next.js Server Componentcookies()). - Multisite Tenant Claims (src/core/auth/tenantClaims.ts, src/core/auth/tenantClaims.node.ts): Provides Edge-compatible subdomain claim helpers (
isMultisiteAuthEnabled,resolveEdgeRequestSubdomain,verifyEdgeTenantClaims) alongside Node/PrismaAppConfigclaim resolution and verification (resolveTenantClaimsForSigning,verifyNodeTenantClaims) soadmin_auth,guest_auth,guest_invite_session, andguest_photo_session(plus printable/photos?qr=links) carrysiteIdand normalizedsubdomainclaims and enforce tenant isolation wheneverMULTISITE_ENABLEDistruewhile remaining backward-compatible in single-site mode. - Signed Internal Guest Gating Headers (src/core/auth/guestHeaderSignature.ts): Strips incoming client-supplied
x-guest-*headers (stripClientGuestHeaders) and signs/verifies internalx-guest-gated-pageandx-guest-callback-urlheaders (signGuestInternalHeaders,verifyGuestInternalHeaders) viaGUEST_SESSION_SECRET(resolveGuestSigningSecret) so SSR revocation checks cannot be bypassed by forged headers. - SSR Admin Page Guard (src/core/auth/adminPageGuard.ts): Enforces server-side
isAdminRequest()checks (enforceAdminPageSession) on admin and registry management Server Components with HTTP303 See Otherredirects (redirectWithSeeOther) to/admin/loginwhile remaining inert duringSTATIC_EXPORTbuilds (isStaticExportBuild). - Server Admin Authentication (src/core/auth/auth.server.ts): Handles administrative session signing and verification (
signAdminToken,verifyAdminToken,isAdminRequest,setAdminAuthCookie,getAdminCookieOptionswithhttpOnly,sameSite: 'lax',securein production, 8-hour defaultmaxAge), enforcing statelesssubdomainchecks in Edge middleware (edgeOnly: true) and fullAppConfigsiteId/subdomainverification in Node API and SSR contexts. - Client Admin Authentication (src/core/auth/auth.client.ts): Provides client-side session verification via
checkAdminClient(), which queries thePublicGET /api/admin/meendpoint (returning{ success: true, isAdmin: false }when unauthenticated) without requiring a guest cookie or exposing internal token secrets, whilePOST /api/admin/logoutclears staleadmin_authcookies cleanly. - Server Guest Authentication (src/core/auth/guest.server.ts): Manages shared-passcode guest sessions (
signGuestToken,verifyGuestToken,isGuestRequest) backed byGUEST_SESSION_SECRET(requiring a distinct secret of at least 32 characters in production and throwing an error wheneversecret === passcode, i.e.,GUEST_SESSION_SECRET === GUEST_PASSCODE), enforcing statelesssubdomainchecks in Edge middleware and fullAppConfigsiteId/subdomainverification in Node API and SSR contexts. - Stateless Edge Guest Invite Token (src/core/auth/guestInviteToken.ts): Implements Tier 1 Edge-safe token signing and stateless verification (
signGuestInviteSessionToken,verifyGuestInviteSessionToken,getSignedGuestInviteSession) for the 7-dayguest_invite_sessioncookie usingGUEST_SESSION_SECRET(>= 32 characters in production, rejectingsecret === passcode) with zero Prisma or Node-only dependencies so src/middleware.ts runs cleanly in the Edge runtime. - Stateless Edge Photo QR & Upload Session Token (src/core/auth/photoUploadToken.ts): Implements Edge-safe token signing, stateless verification, and strict route-scope predicates (
signPhotoQrLinkToken,verifyPhotoQrLinkToken,signPhotoUploadSessionToken,verifyPhotoUploadSessionToken,getSignedPhotoUploadSession,buildSignedPhotoUploadUrl,isPhotoScopedRoute) for printable/photos?qr=<signedToken>deep links and the 7-dayguest_photo_session(GUEST_PHOTO_COOKIE)HttpOnlycookie usingGUEST_SESSION_SECRET, confining QR sessions strictly to/photos,/photos/slideshow,GET /api/photos,POST /api/guest/photos/upload, andPOST /api/photos/upload. - Database-Backed Guest Invitation & Photo Session Revocation (src/core/auth/guestInviteSession.ts): Implements Tier 2 Node/Server session validation and immediate revocation (
getGuestInviteSession,getActivePhotoUploadSession,enforceActiveGuestPageSession, backed by per-request hydration in src/lib/requestContext.ts). After verifying signed cookies viagetSignedGuestInviteSessionorgetSignedPhotoUploadSession(and enforcingAppConfigtenant claims whenMULTISITE_ENABLEDistrue), it queriesprisma.invitationCode(isSample: false) andAppConfig.guestPhotoQrTokenVersion—immediately invalidating deleted invitations, rotated QR token versions, or purged sample sessions. On guest-gated SSR pages,RootLayout(src/app/layout.tsx) callsenforceActiveGuestPageSession(), issuing a303 See Otherredirect to/guest/loginwhen aguest_invite_sessionorguest_photo_sessionis revoked and neitheradmin_authnorguest_authis valid. On non-excluded API routes (isInviteRevocationExcludedApiPathin src/utils/withApiMiddleware.ts),withApiMiddlewareverifies active guest or photo sessions and responds with HTTP401while clearing stale session cookies (maxAge: 0) when no fallbackadmin_authorguest_authcookie exists. - Guest Login vs. Read-Only Lookup Endpoints (src/app/api/guest/login/route.ts, src/app/api/guest/lookup/route.ts):
POST /api/guest/loginauthenticates credentials and mints 7-dayHttpOnlycookies—issuingguest_authwhen matching the sharedGUEST_PASSCODE(via constant-time SHA-256 comparison) orguest_invite_sessionwhen matching a non-sample (isSample: false)InvitationCode. By contrast,POST /api/guest/lookup(throttled to 5 failed attempts per 15 minutes inwithApiMiddleware) performs a read-only search across non-sampleInvitationCoderecords by name, plus-one name, or email and returns only{ guestName }without minting cookies or exposing invitation codes.
5. Feature Organization
To maintain modularity and prevent logic smear, the codebase adopts a strict layered feature architecture. All domain-specific logic is encapsulated in isolated feature directories under src/features/.
- Location:
src/features/ - Structure: Each feature scaffolded by scripts/scaffold-feature.mjs contains:
api/: Route handlers and server-side logic (e.g., proxying).components/: UI components specific to the feature.hooks/: Custom React hooks.lib/: Internal feature-scoped helper utilities.repository.ts: Data access layer for Prisma queries.service.ts: Business logic layer.schemas.ts: Validation schemas (Zod).types.ts: TypeScript interfaces.index.ts: The public interface. To prevent cross-domain internal leakage, other modules must solely import from this file (enforced byno-restricted-importsin eslint.config.mjs against both@/features/*/*and relative../features/*/*paths).
New features should be scaffolded using the included CLI utility (npm run scaffold <feature-name>) to ensure correct structural boundaries and naming conventions.
6. Architectural Boundaries & Shared Components Guidelines
To prevent code duplication and maintain clear ownership boundaries while preserving file-path stability for downstream template forks, the codebase balances feature encapsulation with documented shared-folder exceptions.
Folder Boundaries
- Generic & Cross-Cutting Shared Directories (
src/components/,src/components/ui/,src/utils/,src/lib/):- New reusable UI primitives (e.g.,
Button,Dialoginsrc/components/ui/) and stateless helpers (e.g.,cninsrc/utils/cn.ts) belong in these shared directories and should stay domain-agnostic. - Documented Shared-Folder Exceptions (Preserved for Downstream Fork Stability): Core runtime singletons and cross-cutting services intentionally reside at stable paths under
src/lib/,src/utils/, andsrc/components/so downstream adopters merge upgrades cleanly without path churn:src/lib/: Database connection singletons (prisma.ts,postgresPool.ts), globalAppConfigresolution (config.ts), snapshot audit logging (audit.ts), theme/preset engines (theme/presets.ts,theme/stylesheet.ts), module registry (modules.ts), base-path resolution (basePath.ts), sample and static archetype data builders (sampleData/generator.ts,sampleData/builder.ts), and the browser showcase demo state/interceptor layer (demo/demoStore.ts,demo/demoApiHandler.ts,staticDemo/runtime.ts).src/utils/: Cross-route API middleware (withApiMiddleware.ts), backup/invitation/RSVP validation helpers (backupValidation.ts,invitationValidation.ts,rsvpDeadline.ts), and calendar/pagination utilities.src/components/: Root layout providers (ThemeProvider.tsx,layout/RootLayoutClient.tsx), interactive showcase controls (demo/DemoContext.tsx,demo/DemoToolbar.tsx), multi-feature page orchestrators (home/HomePageClient.tsx), and onboarding/admin shells (setup/SetupWizard.tsx).
- New reusable UI primitives (e.g.,
Interactive Static Showcase & Browser Demo Runtime (STATIC_EXPORT)
When compiled via npm run build:export (scripts/build-export.mjs with STATIC_EXPORT=true and optional NEXT_PUBLIC_BASE_PATH), the application runs as a database-free static HTML showcase powered by a browser-resident simulation layer:
- Layout Bootstrap & Demo Context:
RootLayoutClientin src/components/layout/RootLayoutClient.tsx invokesensureStaticDemoRuntime(src/lib/staticDemo/runtime.ts), wraps the application tree inDemoProvider(src/components/demo/DemoContext.tsx) whenisStaticExportis true, and mountsDemoToolbar(src/components/demo/DemoToolbar.tsx) with subpath-safe return links (resolveShowcasePathin src/lib/basePath.ts) to the documentation portal (/), OpenAPI explorer (/api/), and Storybook (/storybook/). - Persistent Browser State & Archetype Datasets:
hydrateDemoStateFromStorageandresetDemoStatein src/lib/demo/demoStore.ts persist visitor persona (guest,admin,setup), active wedding archetype (classic,destination,romantic), visual theme preset, guest invite sessions, and local mutations under thewedding_showcase_demo_v1localStoragekey, seeded from deterministic static datasets built bybuildArchetypeSeedDataandisStaticExportBuildin src/lib/sampleData/builder.ts. - Client-Side API Simulation, Checkout & Setup Preview:
installDemoFetchInterceptorin src/lib/demo/demoApiHandler.ts intercepts same-origin/api/*and/api/admin/*browserfetchcalls against the activedemoStoredataset without server Route Handlers;SimulatedCardCheckoutandSIMULATED_TEST_CARDSin src/features/registry/components/SimulatedCardCheckout.tsx simulate approved and declined card contributions without external payment processors; andAdminSetupPagein src/app/admin/setup/page.tsx renders<SetupWizard />directly during static exports so visitors can walk through all five onboarding steps in-browser. - Feature Directories (
src/features/<feature-name>/):- Feature directories contain UI components, hooks, internal
lib/helpers, schema definitions, repositories, and services scoped to a single domain (e.g.,weather,registry,seating,sub-events,broadcast). - Feature internals must not be imported directly across module boundaries; external callers import exclusively through the feature's public barrel (
@/features/<feature-name>, backed bysrc/features/<feature-name>/index.ts) as enforced byeslint.config.mjs.
- Feature directories contain UI components, hooks, internal
Structural Rules for Shared UI Primitives
Shared UI primitives added to src/components/ui/ must adhere to the following design and quality patterns:
React Ref Forwarding (DOM-Wrapping Primitives):
- Interactive and layout primitives that wrap a single underlying DOM element (such as
Button,Input,Select,Textarea,Checkbox,Dialog,Table,Icon,Skeleton, andLayoutprimitives) must forwardrefto their root DOM node using React 19refprops (React.ComponentPropsWithRef<'...'>, orReact.forwardRef). - Stateful, context, portal/provider, or error-boundary components in
src/components/ui/that do not represent a single ref-target DOM element (ErrorBoundary,GlobalRadialGlow,RouteErrorFallback,ThemeSelector, andToastProvider) are exempt from DOMrefforwarding. - Example:tsx
import React from 'react'; import { cn } from '@/utils/cn'; export interface InputProps extends React.ComponentPropsWithRef<'input'> {} export function Input({ className, type, ref, ...props }: InputProps) { return ( <input type={type} className={cn('border rounded px-3 py-2', className)} ref={ref} {...props} /> ); }
- Interactive and layout primitives that wrap a single underlying DOM element (such as
Style Composition / Class Merging:
- Primitives must be highly configurable from the outside. Default Tailwind styles must be composed with custom styles passed via the
classNameprop. - Class composition uses the lightweight
cn(...)helper in src/utils/cn.ts (classes.filter(Boolean).join(' ')), which filters falsy values and joins truthy class strings with spaces without performing Tailwind utility conflict resolution (tailwind-mergeis not installed). Avoid passing conflicting Tailwind utilities in base and override class strings. - Example:tsx
import { cn } from '@/utils/cn'; // Usage inside a component: className={cn('base-classes-here', className)}
- Primitives must be highly configurable from the outside. Default Tailwind styles must be composed with custom styles passed via the
Unit Tests:
- Every new shared UI primitive must have a matching unit test file inside the respective
__tests__directory (e.g.,src/components/ui/__tests__/<Component>.test.tsx). - Unit tests must verify proper rendering, prop-based configuration, custom ref forwarding, and interactive behavior (e.g., fire events).
- Every new shared UI primitive must have a matching unit test file inside the respective
Upstream Compatibility & Downstream Upgrade Architecture
To treat upstream compatibility as a product feature for downstream template adopters, the architecture enforces strict separation between application code, personal content, and deployment configuration:
- Personal Content Isolation: Couple details, venue information, story text, wedding party members, registry items, and photos reside in PostgreSQL database models (
AppConfig,Media,RegistryItem,WeddingPartyMember,ContentNode). Avoid hardcoding personal details into React page components (src/app/orsrc/features/). - Deployment Isolation: Provider configurations and secret credentials are injected via environment variables (
DATABASE_URL,ADMIN_PASSWORD, etc.) using a provider-neutral container setup. - Database Schema Evolution (
Expand-Migrate-Contract): Schema updates are managed via immutable, forward-only Prisma migration scripts (prisma/migrations/) governed by the three-phase Expand-Migrate-Contract policy (npm run lint:migrations; see docs/versioning.md) and applied in production vianpx prisma migrate deployagainstDATABASE_URL/POSTGRES_URL_NON_POOLING(prisma.config.ts) or offline in containers via./node_modules/.bin/prisma migrate deploy(reservingnpm run migrate:deployfor local development; see docs/upgrading.md), preserving custom database records across upgrades. - Configuration Schema Versioning:
AppConfigschema changes utilize Zod default value fallbacks (src/features/content/schemas.ts) to ensure non-destructive upgrades for existing database instances. - Detailed Documentation: See docs/upgrading.md for the downstream workflow, docs/versioning.md for semantic versioning and migration lifecycle policies, and DEPLOYMENT.md for production rollout and rollback runbooks.
System Configuration
Configuration Architecture & Precedence Hierarchy
The application follows a strict 4-layer configuration architecture with deterministic precedence:
- Deployment Configuration (Layer 1): Environment variables & secrets (
DATABASE_URL,ADMIN_PASSWORD,ALLOWED_HOSTS,GUEST_PASSCODE,GUEST_SESSION_SECRET,S3_*) plus all 32SITE_*environment variable overrides parsed bygetEnvConfigOverridesin src/lib/config.ts:- Partner & Event Identity (6):
SITE_BRIDE_NAME,SITE_GROOM_NAME,SITE_PARTNER1_NAME,SITE_PARTNER2_NAME,SITE_WEDDING_DATE,SITE_BASE_URL. - Venue, Coordinates, & Timezone (8):
SITE_VENUE_NAME,SITE_VENUE_ADDRESS,SITE_VENUE_CITY,SITE_VENUE_STATE,SITE_VENUE_ZIP,SITE_LATITUDE,SITE_LONGITUDE,SITE_TIMEZONE. - Theme & Widget Overrides (6):
SITE_COLOR_PRIMARY,SITE_COLOR_SECONDARY,SITE_THEME_PRESET,SITE_THEME_TOKENS,SITE_SHOW_COUNTDOWN,SITE_SHOW_ADD_TO_CALENDAR. - SEO, Branding Assets, & Contact (12):
SITE_SEO_TITLE,SITE_SEO_DESCRIPTION,SITE_BRAND_MONOGRAM,SITE_BRAND_LOGO_URL,SITE_BRAND_LOGO_ALT,SITE_HERO_IMAGE_URL,SITE_HERO_IMAGE_ALT,SITE_BRAND_WATERMARK_URL,SITE_BRAND_WATERMARK_ALT,SITE_BADGE_GRAPHIC_URL,SITE_BADGE_GRAPHIC_ALT,SITE_CONTACT_EMAIL.
- Partner & Event Identity (6):
- Site Configuration (Layer 2): Database-persisted site settings (
AppConfigtable: partner names, wedding date, venue details, colors, sparsethemeTokens, timezone, feature toggles, SEO metadata). - Site Content (Layer 3): Editable content nodes (
ContentNodetable: stories, wedding party members, FAQs, travel advice, local attractions, registry items). - Application Defaults (Layer 4): Domain-agnostic technical defaults (
APP_DEFAULTSinsrc/lib/config.ts) with generic placeholder fallbacks and zero personal wedding content.
Theme Token Precedence, WCAG Contrast Calibration, & Zero-FOUC Hydration
- Sparse
themeTokensDiffing (stripPresetDefaultTokens, src/lib/theme/presets.ts):AppConfig.themeTokensstores only sparse custom--*CSS token overrides rather than full preset dumps.stripPresetDefaultTokensstrips entries matching the active preset's light defaults, the previous preset's defaults, or legacy hydrated payloads (>= 25 matching preset keys) so switchingthemePresetnever carries stale preset defaults forward. Effective token precedence resolves deterministically asAPP_DEFAULTS->THEME_PRESETS[themePreset]-> sparse databasethemeTokens-> sparseSITE_THEME_TOKENS. - WCAG Contrast Calibration & Dark Surface Tiers (src/lib/theme/stylesheet.ts):
optimizeContrastbinary-searches HSL lightness across 7 iterations (memoized in the bounded 1,000-entrycontrastCache) to guarantee >=4.5:1text contrast and >=3.0:1UI/focus-ring contrast against target backgrounds.generateDynamicStylesandgenerateThemeStylesheetemit calibrated:rootlight-mode variables alongside.dark/[data-theme="dark"]dark-mode palettes across three surface tiers: base dark surfaces (800/900/950/#000000), elevated700cards, and interactive600controls. - Zero-FOUC
<head>Script &ThemeProviderSynchronization (src/app/layout.tsx, src/components/ThemeProvider.tsx):RootLayoutinjects the server-compiled<style id="dynamic-theme-style">tag and a blocking inlinethemeScriptin<head>that readslocalStorage.getItem('theme_mode'), falls back to thetheme_modecookie orprefers-color-scheme: dark, and applies.dark/.lighton<html>prior to first paint. On hydration,ThemeProvider(hasServerStylesheet) adopts the server stylesheet without FOUC and keepslocalStorageand thetheme_modecookie synchronized when guests toggle modes.
Deterministic Precedence Hierarchy
Deployment Config (Environment Overrides / Secrets)
↓ (overrides)
Site Configuration (Database AppConfig)
↓ (falls back to)
Application Defaults (Generic Technical Fallbacks)Every configurable value has one authoritative home. Ordinary site customization requires zero source code edits. At runtime boundaries (especially in production), configuration payloads are validated against Zod schemas (AppConfigSchema in src/features/content/schemas.ts, covering 89 persisted PostgreSQL columns in prisma/schema.prisma—including modules piped through ModuleConfigSchema—and 16 virtual DTO fields for 105 total schema fields), ensuring immediate, clear failure if misconfigured.
DTO sanitization in src/lib/config.ts and src/lib/backupPersistence.ts enforces three explicit visibility boundaries:
- Public DTO (
PublicAppConfigSchemain src/features/content/schemas.ts /toPublicAppConfigin src/lib/config.ts): Applies a strict 70-field allowlist for public SSR/client consumption, stripping all email/SMS delivery, secret, moderation/QR token, and RSVP grace-period fields while injecting runtimemultisiteEnabled,isRsvpOpen, andisMessagingActive. - Backup Export Sanitizer (
sanitizeAppConfigForBackup, src/lib/backupPersistence.ts): Iterates over the 85APP_CONFIG_BACKUP_KEYS(src/lib/backupPersistence.ts, withsanitizeAppConfigForBackupre-exported by src/lib/config.ts) to retain all persisted non-secret PostgreSQLAppConfigcolumns (includingmodules,rsvpOpen,rsvpGracePeriodHours, and non-secret broadcast provider settings) while stripping the 4 raw provider secrets (APP_CONFIG_SECRET_KEYS:smtpPass,resendApiKey,sendgridApiKey,twilioAuthToken). - Admin DTO (
AdminAppConfig/toAdminAppConfig, src/lib/config.ts): ExtendstoPublicAppConfigfor authenticated admin settings endpoints (/api/admin/settings) withautoApproveGuestPhotos,rsvpOpen,rsvpGracePeriodHours, shipping/payment defaults, and the 13 non-secret email/SMS provider and batching fields (emailProvider,smtpHost,smtpPort,smtpUser,smtpFrom,smtpSecure,resendFrom,sendgridFrom,smsProvider,twilioAccountSid,twilioFromNumber,broadcastBatchSize,broadcastBatchDelayMs), while omitting the 4 raw provider secrets (smtpPass,resendApiKey,sendgridApiKey,twilioAuthToken) in favor of boolean presence flags (hasSmtpPass,hasResendApiKey,hasSendgridApiKey,hasTwilioAuthToken).
Import and export formats (src/app/api/admin/maintenance/export/route.ts) include versioning metadata (schemaVersion: "2.0") across the 18 exported domain models (excluding ephemeral AuthLockout lockout rows) to guarantee upgrade safety.
| Field | Type | Storage | DTO Exposure | Description |
|---|---|---|---|---|
id | string | Prisma | Public | Unique configuration profile identifier (defaults to "global" in single-site deployments). |
subdomain | string | Prisma | Public | Optional subdomain slug for AppConfig branding/profile routing when MULTISITE_ENABLED is active (the other 14 Prisma tables remain shared). |
multisiteEnabled | boolean | Virtual DTO | Public | Runtime flag resolved from MULTISITE_ENABLED indicating whether subdomain AppConfig profile routing is active (14 other Prisma tables are shared). |
partner1Name | string | Prisma | Public | Primary display name for the first partner across headings, metadata, and monograms. |
partner2Name | string | Prisma | Public | Primary display name for the second partner across headings, metadata, and monograms. |
brideName | string | Prisma | Public | Legacy optional alias for the first partner name retained for backward compatibility. |
groomName | string | Prisma | Public | Legacy optional alias for the second partner name retained for backward compatibility. |
weddingDate | date | Prisma | Public | Scheduled wedding ceremony date and timestamp used by countdowns and calendar exports. |
baseUrl | string | Prisma | Public | Canonical public base URL of the deployed wedding website used for SEO and Open Graph tags. |
venueName | string | Prisma | Public | Display name of the primary wedding ceremony or reception venue. |
venueAddress | string | Prisma | Public | Street address of the primary wedding venue. |
venueCity | string | Prisma | Public | City where the primary wedding venue is located. |
venueState | string | Prisma | Public | State, province, or region of the primary wedding venue. |
venueZip | string | Prisma | Public | Postal or ZIP code of the primary wedding venue. |
latitude | number | Prisma | Public | Geographic latitude coordinate of the venue used for maps and live weather forecasts. |
longitude | number | Prisma | Public | Geographic longitude coordinate of the venue used for maps and live weather forecasts. |
storyText | string | Prisma | Public | Couple story narrative displayed on the homepage story section. |
venueDescription | string | Prisma | Public | Descriptive overview of the wedding venue grounds, setting, and amenities. |
travelAdvice | string | Prisma | Public | Travel, airport, parking, and local transit guidance for attending guests. |
heroTitle | string | Prisma | Public | Main headline rendered inside the homepage hero banner. |
heroSubtitle | string | Prisma | Public | Secondary tagline rendered beneath the homepage hero headline. |
seoTitle | string | Prisma | Public | HTML document title and social preview title for search engines and link cards. |
seoDescription | string | Prisma | Public | Meta description summarizing the wedding website for search engines and Open Graph previews. |
contactEmail | string | Prisma | Public | Public host contact email address displayed for guest inquiries. |
photoAlbumUrl | string | Prisma | Public | Optional external shared photo album URL displayed on the public gallery page. |
autoApproveGuestPhotos | boolean | Prisma | Admin-only | Admin-only toggle controlling whether new guest photo uploads are automatically approved and published immediately without manual moderation; omitted from public DTOs. |
guestPhotoQrTokenVersion | number | Prisma | Server-only | Admin-only monotonic version counter for rotating signed guest photo upload QR links and invalidating previously issued photo sessions; omitted from public DTOs. |
faviconUrl | string | Prisma | Public | Asset path or safe URL for the browser tab favicon icon. |
ogImageUrl | string | Prisma | Public | Default Open Graph social sharing preview image URL or asset path. |
brandMonogram | string | Prisma | Public | Custom monogram text overriding initials derived from partner names. |
brandLogoUrl | string | Prisma | Public | Optional custom brand logo image URL or asset path rendered in navigation. |
brandLogoAlt | string | Prisma | Public | Accessible alt text describing the custom brand logo image. |
heroImageUrl | string | Prisma | Public | Optional custom hero background or featured image URL on the homepage. |
heroImageAlt | string | Prisma | Public | Accessible alt text describing the homepage hero image. |
brandWatermarkUrl | string | Prisma | Public | Optional decorative watermark graphic URL rendered in page backgrounds. |
brandWatermarkAlt | string | Prisma | Public | Accessible alt text for the brand watermark graphic when non-decorative. |
badgeGraphicUrl | string | Prisma | Public | Optional emblem or badge graphic URL displayed in headers or footers. |
badgeGraphicAlt | string | Prisma | Public | Accessible alt text describing the custom badge graphic. |
seoKeywords | string | Prisma | Public | Comma-separated SEO meta keywords template supporting partner and venue placeholders. |
colorPrimary | string | Prisma | Public | Primary brand hex color applied to accents, buttons, and interactive highlights. |
colorSecondary | string | Prisma | Public | Secondary brand hex color applied to complementary badges, borders, and highlights. |
themePreset | 'classic' | 'modern' | 'romantic' | 'minimal' | 'editorial' | Prisma | Public | Named visual theme preset controlling baseline palette and typographic styling. |
themeTokens | record | Prisma | Public | Custom CSS custom property overrides (--* tokens) merged atop the active theme preset. |
typographyScale | object | Virtual DTO | Public | Virtual DTO typography scale tokens defining font sizes, weights, and line heights. |
spacingScale | object | Virtual DTO | Public | Virtual DTO spacing scale tokens defining rhythm units, container width, grid gap, and card padding. |
borderTreatment | object | Virtual DTO | Public | Virtual DTO border radius, width, and stroke style design tokens. |
brandDimensions | object | Virtual DTO | Public | Virtual DTO composite dimensions for brand logos, hero height, watermarks, and badges. |
brandLogoWidth | string | Virtual DTO | Public | Virtual DTO CSS width token for the header brand logo. |
brandLogoHeight | string | Virtual DTO | Public | Virtual DTO CSS height token for the header brand logo. |
brandHeroHeight | string | Virtual DTO | Public | Virtual DTO CSS height token for the homepage hero banner. |
brandWatermarkWidth | string | Virtual DTO | Public | Virtual DTO CSS width token for background watermark graphics. |
brandWatermarkOpacity | string | Virtual DTO | Public | Virtual DTO CSS opacity value (0 to 1) applied to brand watermark graphics. |
brandBadgeSize | string | Virtual DTO | Public | Virtual DTO CSS size token for decorative brand badge graphics. |
layoutContainerMaxWidth | string | Prisma | Public | Maximum CSS width token for primary page content containers. |
layoutGridGap | string | Prisma | Public | Default CSS gap token between multi-column layout grid items. |
layoutCardPadding | string | Prisma | Public | Default internal CSS padding token for surface cards and panels. |
layoutBorderRadius | string | Prisma | Public | Default CSS border-radius token applied to cards, inputs, and dialogs. |
fontHeading | string | Virtual DTO | Public | Virtual DTO CSS font-family token used for display headings and titles. |
fontBody | string | Virtual DTO | Public | Virtual DTO CSS font-family token used for body copy and UI controls. |
fontMono | string | Virtual DTO | Public | Virtual DTO CSS font-family token used for invitation codes and tabular values. |
timezone | string | Prisma | Public | IANA timezone identifier used to format event schedules and countdown timers. |
showCountdown | boolean | Prisma | Public | Toggle controlling whether the live wedding countdown widget renders on public pages. |
showAddToCalendar | boolean | Prisma | Public | Toggle controlling whether Add-to-Calendar links and ICS downloads are shown. |
rsvpOpen | boolean | Prisma | Public | Manual toggle controlling whether online guest RSVP submissions and edits are enabled. |
isRsvpOpen | boolean | Virtual DTO | Public | Virtual server-evaluated flag indicating whether online RSVPs are currently open after evaluating manual lock, cutoff date, and grace period. |
isMessagingActive | boolean | Virtual DTO | Public | Virtual server-evaluated flag indicating whether an outbound email or SMS provider is active for self-service guest sign-in link delivery. |
rsvpDeadlineDate | string | Prisma | Public | Optional global RSVP cutoff calendar date (YYYY-MM-DD) enforced at midnight in the venue timezone. |
rsvpGracePeriodHours | number | Prisma | Admin-only | Admin-only silent grace window in hours (0, 12, 24, 48, 72, or 168) after the midnight RSVP cutoff; omitted from public DTOs. |
rsvpClosedMessage | string | Prisma | Public | Sanitized custom message displayed to guests and returned by RSVP APIs once online RSVPs close. |
emailProvider | string | Prisma | Admin-only | Active outbound email transport provider identifier (smtp, resend, or sendgrid). |
smtpHost | string | Prisma | Admin-only | Hostname of the outbound SMTP relay server for guest broadcasts. |
smtpPort | number | Prisma | Admin-only | TCP port number used when connecting to the outbound SMTP server. |
smtpUser | string | Prisma | Admin-only | Authentication username for the configured outbound SMTP server. |
smtpPass | string | Prisma | Masked secret (hasSmtpPass) | Authentication password for the SMTP server; omitted from public DTOs and masked as hasSmtpPass in admin DTOs. |
smtpFrom | string | Prisma | Admin-only | Sender email address used in the From header of SMTP broadcast emails. |
smtpSecure | boolean | Prisma | Admin-only | Whether the SMTP transport establishes implicit TLS on connection. |
resendApiKey | string | Prisma | Masked secret (hasResendApiKey) | API key for Resend email delivery; omitted from public DTOs and masked as hasResendApiKey in admin DTOs. |
resendFrom | string | Prisma | Admin-only | Verified sender email address used for outbound Resend broadcasts. |
sendgridApiKey | string | Prisma | Masked secret (hasSendgridApiKey) | API key for SendGrid email delivery; omitted from public DTOs and masked as hasSendgridApiKey in admin DTOs. |
sendgridFrom | string | Prisma | Admin-only | Verified sender email address used for outbound SendGrid broadcasts. |
smsProvider | string | Prisma | Admin-only | Active outbound SMS broadcast provider identifier (none or twilio). |
twilioAccountSid | string | Prisma | Admin-only | Twilio Account SID used for dispatching SMS guest broadcasts. |
twilioAuthToken | string | Prisma | Masked secret (hasTwilioAuthToken) | Twilio Auth Token secret; omitted from public DTOs and masked as hasTwilioAuthToken in admin DTOs. |
twilioFromNumber | string | Prisma | Admin-only | Twilio E.164 sender phone number or messaging source for SMS broadcasts. |
broadcastBatchSize | number | Prisma | Admin-only | Maximum number of broadcast recipients processed per delivery batch. |
broadcastBatchDelayMs | number | Prisma | Admin-only | Delay in milliseconds between consecutive outbound broadcast batches. |
shippingRecipientName | string | Prisma | Admin-only | Recipient full name for registry gift shipping; omitted from public DTOs and served only to authenticated guests and admins. |
shippingAddressLine1 | string | Prisma | Admin-only | Primary street address line for registry gift deliveries; omitted from public DTOs. |
shippingAddressLine2 | string | Prisma | Admin-only | Optional apartment, suite, or unit line for registry gift deliveries; omitted from public DTOs. |
shippingCity | string | Prisma | Admin-only | City for registry gift deliveries; omitted from public DTOs. |
shippingState | string | Prisma | Admin-only | State, province, or region for registry gift deliveries; omitted from public DTOs. |
shippingZip | string | Prisma | Admin-only | Postal or ZIP code for registry gift deliveries; omitted from public DTOs. |
shippingCountry | string | Prisma | Admin-only | Destination country for registry gift deliveries; omitted from public DTOs. |
shippingPhone | string | Prisma | Admin-only | Carrier contact phone number for registry gift deliveries; omitted from public DTOs. |
shippingDeliveryNotes | string | Prisma | Admin-only | Optional carrier or concierge instructions for registry gift deliveries; omitted from public DTOs. |
defaultPaymentHandleType | string | Prisma | Admin-only | Site-wide fallback peer-to-peer payment service (Venmo, PayPal, Cash App, Zelle, or Custom) for group gifts without an item-level handle; omitted from public DTOs. |
defaultPaymentHandle | string | Prisma | Admin-only | Site-wide fallback peer-to-peer payment handle or username for group gifts without an item-level handle; omitted from public DTOs. |
registryGiftAccessTier | 'PASSCODE_GUESTS' | 'INVITED_HOUSEHOLDS' | Prisma | Admin-only | Controls whether website passcode guests (PASSCODE_GUESTS) or only verified invited households (INVITED_HOUSEHOLDS) can claim physical gifts and record zero-fee direct transfers; omitted from public DTOs. |
shippingDisclosureTier | 'PASSCODE_GUESTS' | 'INVITED_HOUSEHOLDS' | 'POST_CLAIM_ONLY' | Prisma | Admin-only | Controls when the couple shipping address is revealed: to passcode and invited guests (PASSCODE_GUESTS), verified invited households only (INVITED_HOUSEHOLDS), or strictly after claiming a gift (POST_CLAIM_ONLY); omitted from public DTOs. |
maxPendingReservations | number | Prisma | Admin-only | Maximum concurrent RESERVED physical gift holds allowed per household or email before requiring confirmation or release; omitted from public DTOs. |
setupCompleted | boolean | Prisma | Admin-only | Admin-only flag tracking whether the five-step onboarding setup wizard has been completed; omitted from public DTOs. |
modules | object | Prisma | Public | Persisted feature module enablement map validated against ModuleConfigSchema with dependency resolution. |
features | object[] | Prisma | Public | Ordered homepage content section definitions controlling section titles, visibility, and copy. |
createdAt | date | Prisma | Public | Timestamp recording when the configuration record was initially created. |
updatedAt | date | Prisma | Public | Timestamp recording when the configuration record was last modified. |