How andrewsherif0/talent-website works
1. Overall shape
- This is a Next.js App Router monolith written in TypeScript, with a clear split between public marketplace UX, authenticated/auth flows, and a separate admin console.
- The backend is not a separate service; it is primarily implemented through Next.js route handlers under app/api plus Supabase for persistence, auth, and some admin access patterns.
2. Top-level route boundaries
- app/(main) contains the public/product-facing experience.
- app/(auth) contains login and registration screens.
- app/(admin) contains the internal admin area with its own layout and dashboard pages.
- These route groups are the main diagram boundary lines: they share the same deployment, but have different layouts, navigation, and access expectations.
3. Public marketplace surface
- The main product pages include home, about, explore, brands, jobs, talent profiles, profile pages, community Q&A, and chat.
- The talent profile area is especially rich: it is composed of many sections such as hero, trust, reviews, packages, portfolio, usage rights, booking bar, and sidebar cards, indicating a detailed profile-driven booking/collaboration flow.
- The jobs, brands, explore, and community pages each have their own local component sets, suggesting they are feature pages rather than generic content pages.
4. Authenticated user flows
- The auth screens are isolated in app/(auth) and likely feed into role-aware behavior elsewhere in the app.
- There are dedicated profile routes for /profile/me and /profile/[username], plus API endpoints like /api/me and /api/me/role, showing that user identity and role are core platform concerns.
- The chat area is also a first-class authenticated workspace, with a list/detail layout for conversations and message composition.
5. Admin console
- The admin area has its own shell components: AdminShell, AdminSidebar, AdminTopbar, and reusable admin UI primitives like tables, pagination, badges, modals, and loading states.
- Admin pages cover dashboard, talents, bookings, brands, reviews, verifications, and settings.
- The presence of route handlers for CRUD operations and moderation tasks indicates the admin console is operational, not just read-only reporting.
6. API layer
- The API surface is large and domain-oriented: app/api/chat, app/api/community, app/api/jobs, app/api/reviews, app/api/profile, app/api/portfolio, and app/api/me.
- There is also a /api/v1 namespace for public/stable endpoints such as health, talents, bookings, and upload, which suggests a versioned external API boundary separate from internal app routes.
- Admin-only endpoints under app/api/admin cover maintenance tasks, seeding, debugging, schema checks, migrations, and entity management.
7. Domain feature modules
- The features/ directory contains reusable domain logic instead of putting everything in route components.
- Notable modules include features/admin/services/admin.service.ts, features/talent-profile/services/talent-profile.service.ts, and a talent profile transformer layer.
- This suggests a separation between UI components, feature-specific business logic, and data shaping/normalization.
8. Supabase as the system of record
- lib/supabase/client.ts, server.ts, and admin.ts show three distinct access modes: browser client, server-side access, and elevated admin access.
- The supabase/migrations folder defines the backend schema evolution, including bookings/reviews, community tables, talent brands, talent status, RLS fixes, and rating triggers.
- The app depends on Supabase not just for database storage, but also for auth-bound server access patterns and likely media/storage operations such as avatar upload.
9. Data flow pattern
- The dominant flow is: page/component → route handler or service → Supabase client → database/migrations-backed schema.
- Client components under app/**/_components handle interactive UI, while server routes in app/api encapsulate mutations, admin operations, and data retrieval.
- Some pages are likely server-rendered shells that compose client components for filtering, tables, chat widgets, and editor interactions.
10. Chat and community as interactive subsystems
- Chat is split into conversation list, message input, message bubbles, and a conversation detail view, implying a real-time or near-real-time messaging workflow.
- Community has question and answer endpoints plus a dedicated question detail page, representing a Q&A content model with its own CRUD/API layer.
- These two subsystems are separate but structurally similar: both combine content feeds, detail views, and API-backed interactions.
11. Operations, migrations, and seed tooling
- The repo includes a notable amount of operational tooling: scripts for database checks, fixes, migrations, seeding, and Supabase testing.
- There are also admin API routes for seeding and migration execution, which means the app supports both local/CLI operations and in-app operational workflows.
- This is important architecturally: the system is designed to be maintained through schema-first database changes plus repeatable seed/reset flows.
12. Shared UI and cross-cutting concerns
- Shared UI lives in components/, including the global navbar/footer and reusable profile/chat/admin widgets.
- contexts/SiteContext.tsx and hooks/useIsMobile.ts indicate some client-side global state and responsive behavior.
- lib/recalcRating.ts plus the related migration trigger imply that ratings are a derived business metric maintained consistently across writes and database triggers.
13. What to show in an architecture diagram
- Draw three main front-end zones: public marketplace, auth, and admin.
- Underneath them, show a shared API layer with domain endpoints and a Supabase-backed persistence layer with separate client/server/admin access.
- Add side systems for migrations/seed scripts, uploads, chat/community content, and admin maintenance routes as operational and domain-specific supporting flows.
Main entry points: (main)/layout.tsx Main site · api App APIs · client.ts Supabase access · app/layout.tsx App shell
Components 20
Front-end app
Next.js route groups and shared client-facing UI
- App shell · Global application entry and shared metadata/layout
app/layout.tsx - Main site · Public marketplace route boundary
app/(main)/layout.tsx - Auth area · Login and registration boundary
app/(auth)/layout.tsx - Home · Landing page and featured talent surface
app/(main)/home/page.tsx - Browse pages · About, explore, brands, and jobs experience pages
app/(main)/explore/page.tsx - Talent profile · Rich profile page with booking, packages, reviews, portfolio, and trust sections
app/(main)/talent/[handle]/page.tsx - My profile · Self profile and public username profile routes
app/(main)/profile/me/page.tsx - Chat · Conversation list, detail view, and message composition
app/(main)/chat/page.tsx - Community Q&A · Question feed and question detail pages
app/(main)/community/page.tsx - Login / register · Authentication entry screens
app/(auth)/login/page.tsx - Feature logic · Admin and talent-profile services plus transformers
features/talent-profile/services/talent-profile.service.ts - Shared UI · Navbar, footer, profile widgets, chat widget, and admin primitives
components/Navbar.tsx
Admin console
Internal management surface and admin UI
- Admin area · Internal admin route boundary
app/(admin)/layout.tsx - Admin shell · Shared admin navigation and layout primitives
components/admin/AdminShell.tsx - Admin pages · Dashboard, talents, bookings, brands, reviews, verifications, and settings
app/(admin)/admin/page.tsx
API layer
Route handlers for domain data, auth, and versioned endpoints
- App APIs · Domain APIs for chat, community, jobs, profiles, reviews, and me
app/api - Public API v1 · Stable external endpoints for health, talents, bookings, and upload
app/api/v1/health/route.ts - Admin APIs · Maintenance, seeding, migration, debugging, and admin CRUD routes
app/api/admin/seed-all/route.ts
Data and ops
Supabase access plus schema, migration, and seed tooling
- Supabase access · Browser, server, and admin Supabase clients
lib/supabase/client.ts - Schema ops · Database migrations, triggers, and seed scripts
supabase/migrations/create_bookings_reviews.sql
Connections 24
- App shell → Main site: routes to · Global app shell composes the public route group
- App shell → Auth area: routes to · Global app shell composes the auth route group
- App shell → Admin area: routes to · Global app shell composes the admin route group
- Main site → Home: hosts · Public landing and featured content pages
- Main site → Browse pages: hosts · About, explore, brands, and jobs pages
- Main site → Talent profile: hosts · Deep talent collaboration and booking profile
- Main site → My profile: hosts · Self and public profile routes
- Main site → Chat: hosts · Authenticated messaging workspace
- Main site → Community Q&A: hosts · Question feed and detail views
- Auth area → Login / register: hosts · Login and registration screens
- Admin area → Admin shell: wraps · Admin area uses dedicated shell and navigation
- Admin area → Admin pages: hosts · Administrative operational pages
- Home → Shared UI: uses · Public pages compose shared chrome and widgets
- Talent profile → Feature logic: uses · Profile rendering and shaping logic
- Chat → App APIs: reads/writes · Conversation and message operations
- Community Q&A → App APIs: reads/writes · Questions and answers CRUD
- Browse pages → App APIs: reads · Marketplace listings and filters
- My profile → App APIs: reads/writes · Profile and role-aware user data
- Admin pages → Admin APIs: operates through · Admin CRUD and moderation workflows
- App APIs → Supabase access: persists via · Application data access through Supabase clients
- Public API v1 → Supabase access: publishes via · Versioned external endpoints backed by Supabase
- Admin APIs → Supabase access: privileged access · Elevated admin operations against the database
- Supabase access → Schema ops: backed by · Clients rely on migrations, triggers, and seeded schema
- Schema ops → Feature logic: shapes · Schema and derived rating logic inform feature services