Frontend Architecture
The frontend is a Next.js 16 App Router application with a mix of server and client components.
Main directories
app/: route segments, layouts, pages, metadata, and API routescomponents/: reusable UI and feature-specific componentsproviders/: app-level providers such as Convex authlib/: cross-cutting utilities
Route organization
The route tree contains several major product zones:
- public marketing and policy pages
- event discovery and checkout
- DP creation and management
- organizer operations
- admin operations
- API routes under
app/api/*
UI composition
The component model is split into:
components/ui/*for shadcn/ui-style primitivescomponents/organizer/*,components/admin/*,components/events/*, and similar feature folders- page-level logic often kept directly in route files for large dashboard screens
State and data access
- Convex client access is provided by
providers/ConvexClientProvider.tsx. - Client routes use
convex/reacthooks for data and actions. - Some server-rendered metadata routes use
ConvexHttpClientdirectly.
API routes owned by the frontend
The Next.js app owns several HTTP surfaces:
app/api/healthapp/api/mobile/backendapp/api/payments/checkoutapp/api/webhooks/*app/api/ai/*app/api/email/*- wallet, QR, badges, and notification helper endpoints
Practical guidance
- Use client components only where interactivity is needed.
- Keep new low-level UI primitives in
components/ui/. - Keep feature-specific logic close to the owning route or feature folder.
- Reuse
lib/money.tsfor currency formatting andlib/utils.tshelpers rather than inlining equivalents.