# arcendala-byte/kenya-insider architecture

> Architecture diagram of the GitHub repository arcendala-byte/kenya-insider, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arcendala-byte/kenya-insider
- Repository: https://github.com/arcendala-byte/kenya-insider

## Overview

Kenya Insider is a bilingual Kenya travel-discovery and trip-planning platform. Travelers browse destinations and experiences, then submit a tailored trip request; the API validates and rate-limits it, stores it, and sends an email notification. Separate public contact and newsletter flows and traveler authentication/dashboard capabilities complement the core journey, while admins manage requests and other site records. The graph includes documented integrations and source-index-supported links; unsampled modules are represented only where the tree or README establishes their role, so some connections are intentionally omitted.

Main entry points: [`app/api/trip-requests/route.ts`](https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/trip-requests/route.ts) (Trip request API), [`app/api/contact/route.ts`](https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/contact/route.ts) (Contact API), [`app/api/newsletter/route.ts`](https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/newsletter/route.ts) (Newsletter API), [`components/admin/AdminDashboard.tsx`](https://github.com/arcendala-byte/kenya-insider/blob/main/components/admin/AdminDashboard.tsx) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Travel discovery"]
  node_home["Home page"]
  node_catalog["Travel catalog<br/>[catalog.ts]"]
  node_destinations["Destination pages"]
  node_experiences["Experience pages"]
  node_experience_explorer["Experience explorer"]
  node_journal["Journal"]
end

subgraph group_planning["Trip planning"]
  node_trip_planner["Trip planner<br/>[TripPlanner.tsx]"]
  node_trip_api["Trip request API<br/>[route.ts]"]
  node_contact_api["Contact API<br/>[route.ts]"]
  node_newsletter_api["Newsletter API<br/>[route.ts]"]
  node_whatsapp["WhatsApp concierge<br/>[WhatsAppButton.tsx]"]
end

subgraph group_operations["Admin operations"]
  node_user_dashboard["Traveler dashboard<br/>[UserDashboard.tsx]"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_admin_stats["Admin statistics<br/>[AdminStats.tsx]"]
  node_admin_users["Admin users table"]
end

subgraph group_platform["Platform services"]
  node_locale_provider["Locale provider<br/>[LocaleProvider.tsx]"]
  node_translations["Translations<br/>[i18n.ts]"]
  node_request_guard["Request safeguards<br/>[public-request.ts]"]
  node_supabase_server["Server connector<br/>[server.ts]"]
  node_email["Email notifications<br/>[email.ts]"]
  node_auth_form["Sign-in and registration<br/>[AuthForm.tsx]"]
  node_supabase_client["Browser connector<br/>[client.ts]"]
end

node_traveler(("Traveler"))
node_admin_user(("Administrator"))
node_supabase_db[("Supabase database")]
node_resend["Resend email"]

node_traveler -->|"browses"| node_home
node_home -->|"reads listings"| node_catalog
node_traveler -->|"explores"| node_destinations
node_destinations -->|"reads destination"| node_catalog
node_traveler -->|"explores"| node_experiences
node_experiences -->|"reads experience"| node_catalog
node_experience_explorer -->|"filters listings"| node_catalog
node_traveler -->|"reads"| node_journal
node_locale_provider -->|"loads locales"| node_translations
node_traveler -->|"submits preferences"| node_trip_planner
node_trip_planner -.->|"posts request"| node_trip_api
node_trip_api -->|"validates and limits"| node_request_guard
node_trip_api -->|"gets client"| node_supabase_server
node_trip_api -->|"stores request"| node_supabase_db
node_trip_api -->|"notifies"| node_email
node_email -->|"sends email"| node_resend
node_traveler -->|"sends message"| node_contact_api
node_contact_api -->|"validates and limits"| node_request_guard
node_contact_api -->|"gets client"| node_supabase_server
node_contact_api -->|"stores message"| node_supabase_db
node_contact_api -->|"notifies"| node_email
node_traveler -.->|"subscribes"| node_newsletter_api
node_newsletter_api -->|"validates and limits"| node_request_guard
node_newsletter_api -->|"gets client"| node_supabase_server
node_newsletter_api -->|"stores subscription"| node_supabase_db
node_traveler -->|"contacts concierge"| node_whatsapp
node_traveler -->|"authenticates"| node_auth_form
node_auth_form -->|"uses auth client"| node_supabase_client
node_traveler -->|"tracks trip"| node_user_dashboard
node_admin_user -->|"manages requests"| node_admin_dashboard
node_admin_dashboard -->|"reads and updates"| node_supabase_client
node_admin_dashboard -->|"renders"| node_admin_stats
node_admin_dashboard -->|"renders"| node_admin_users

click node_home "https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/HomePageContent.tsx"
click node_catalog "https://github.com/arcendala-byte/kenya-insider/blob/main/lib/catalog.ts"
click node_destinations "https://github.com/arcendala-byte/kenya-insider/blob/main/components/destinations/DestinationDetailContent.tsx"
click node_experiences "https://github.com/arcendala-byte/kenya-insider/blob/main/components/experiences/ExperienceDetailContent.tsx"
click node_experience_explorer "https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/ExperienceExplorer.tsx"
click node_journal "https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/JournalPageContent.tsx"
click node_locale_provider "https://github.com/arcendala-byte/kenya-insider/blob/main/components/LocaleProvider.tsx"
click node_translations "https://github.com/arcendala-byte/kenya-insider/blob/main/lib/i18n.ts"
click node_trip_planner "https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/TripPlanner.tsx"
click node_trip_api "https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/trip-requests/route.ts"
click node_contact_api "https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/contact/route.ts"
click node_newsletter_api "https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/newsletter/route.ts"
click node_request_guard "https://github.com/arcendala-byte/kenya-insider/blob/main/lib/server/public-request.ts"
click node_supabase_server "https://github.com/arcendala-byte/kenya-insider/blob/main/lib/supabase/server.ts"
click node_email "https://github.com/arcendala-byte/kenya-insider/blob/main/lib/server/email.ts"
click node_whatsapp "https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/WhatsAppButton.tsx"
click node_auth_form "https://github.com/arcendala-byte/kenya-insider/blob/main/components/auth/AuthForm.tsx"
click node_supabase_client "https://github.com/arcendala-byte/kenya-insider/blob/main/lib/supabase/client.ts"
click node_user_dashboard "https://github.com/arcendala-byte/kenya-insider/blob/main/components/dashboard/UserDashboard.tsx"
click node_admin_dashboard "https://github.com/arcendala-byte/kenya-insider/blob/main/components/admin/AdminDashboard.tsx"
click node_admin_stats "https://github.com/arcendala-byte/kenya-insider/blob/main/components/admin/AdminStats.tsx"
click node_admin_users "https://github.com/arcendala-byte/kenya-insider/blob/main/components/admin/AdminUsersTable.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_catalog,node_destinations,node_experiences,node_experience_explorer,node_journal toneBlue
class node_trip_planner,node_trip_api,node_contact_api,node_newsletter_api,node_whatsapp,node_supabase_db toneAmber
class node_user_dashboard,node_admin_dashboard,node_admin_stats,node_admin_users toneMint
class node_locale_provider,node_translations,node_request_guard,node_supabase_server,node_email,node_auth_form,node_supabase_client toneRose
class node_traveler,node_admin_user,node_resend toneIndigo
```

## Components

### Travel discovery

- [Home page](https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/HomePageContent.tsx): `components/site/HomePageContent.tsx`
- [Travel catalog](https://github.com/arcendala-byte/kenya-insider/blob/main/lib/catalog.ts): `lib/catalog.ts`
- [Destination pages](https://github.com/arcendala-byte/kenya-insider/blob/main/components/destinations/DestinationDetailContent.tsx): `components/destinations/DestinationDetailContent.tsx`
- [Experience pages](https://github.com/arcendala-byte/kenya-insider/blob/main/components/experiences/ExperienceDetailContent.tsx): `components/experiences/ExperienceDetailContent.tsx`
- [Experience explorer](https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/ExperienceExplorer.tsx): `components/site/ExperienceExplorer.tsx`
- [Journal](https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/JournalPageContent.tsx): `components/site/JournalPageContent.tsx`

### Trip planning

- [Trip planner](https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/TripPlanner.tsx): `components/site/TripPlanner.tsx`
- [Trip request API](https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/trip-requests/route.ts): `app/api/trip-requests/route.ts`
- [Contact API](https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/contact/route.ts): `app/api/contact/route.ts`
- [Newsletter API](https://github.com/arcendala-byte/kenya-insider/blob/main/app/api/newsletter/route.ts): `app/api/newsletter/route.ts`
- [WhatsApp concierge](https://github.com/arcendala-byte/kenya-insider/blob/main/components/site/WhatsAppButton.tsx): `components/site/WhatsAppButton.tsx`

### Admin operations

- [Traveler dashboard](https://github.com/arcendala-byte/kenya-insider/blob/main/components/dashboard/UserDashboard.tsx): `components/dashboard/UserDashboard.tsx`
- [Admin dashboard](https://github.com/arcendala-byte/kenya-insider/blob/main/components/admin/AdminDashboard.tsx): `components/admin/AdminDashboard.tsx`
- [Admin statistics](https://github.com/arcendala-byte/kenya-insider/blob/main/components/admin/AdminStats.tsx): `components/admin/AdminStats.tsx`
- [Admin users table](https://github.com/arcendala-byte/kenya-insider/blob/main/components/admin/AdminUsersTable.tsx): `components/admin/AdminUsersTable.tsx`

### Platform services

- [Locale provider](https://github.com/arcendala-byte/kenya-insider/blob/main/components/LocaleProvider.tsx): `components/LocaleProvider.tsx`
- [Translations](https://github.com/arcendala-byte/kenya-insider/blob/main/lib/i18n.ts): `lib/i18n.ts`
- [Request safeguards](https://github.com/arcendala-byte/kenya-insider/blob/main/lib/server/public-request.ts): `lib/server/public-request.ts`
- [Server connector](https://github.com/arcendala-byte/kenya-insider/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [Email notifications](https://github.com/arcendala-byte/kenya-insider/blob/main/lib/server/email.ts): `lib/server/email.ts`
- [Sign-in and registration](https://github.com/arcendala-byte/kenya-insider/blob/main/components/auth/AuthForm.tsx): `components/auth/AuthForm.tsx`
- [Browser connector](https://github.com/arcendala-byte/kenya-insider/blob/main/lib/supabase/client.ts): `lib/supabase/client.ts`

### Other components

- **Traveler**
- **Administrator**
- **Supabase database**
- **Resend email**

## Connections

- Traveler → Home page: browses
- Home page → Travel catalog: reads listings (evidence: `components/site/HomePageContent.tsx`)
- Traveler → Destination pages: explores
- Destination pages → Travel catalog: reads destination (evidence: `components/destinations/DestinationDetailContent.tsx`)
- Traveler → Experience pages: explores
- Experience pages → Travel catalog: reads experience (evidence: `components/experiences/ExperienceDetailContent.tsx`)
- Experience explorer → Travel catalog: filters listings
- Traveler → Journal: reads
- Locale provider → Translations: loads locales (evidence: `components/LocaleProvider.tsx`)
- Traveler → Trip planner: submits preferences
- Trip planner → Trip request API: posts request
- Trip request API → Request safeguards: validates and limits (evidence: `app/api/trip-requests/route.ts`)
- Trip request API → Server connector: gets client (evidence: `app/api/trip-requests/route.ts`)
- Trip request API → Supabase database: stores request (evidence: `app/api/trip-requests/route.ts`)
- Trip request API → Email notifications: notifies (evidence: `app/api/trip-requests/route.ts`)
- Email notifications → Resend email: sends email
- Traveler → Contact API: sends message
- Contact API → Request safeguards: validates and limits (evidence: `app/api/contact/route.ts`)
- Contact API → Server connector: gets client (evidence: `app/api/contact/route.ts`)
- Contact API → Supabase database: stores message (evidence: `app/api/contact/route.ts`)
- Contact API → Email notifications: notifies (evidence: `app/api/contact/route.ts`)
- Traveler → Newsletter API: subscribes
- Newsletter API → Request safeguards: validates and limits (evidence: `app/api/newsletter/route.ts`)
- Newsletter API → Server connector: gets client (evidence: `app/api/newsletter/route.ts`)
- Newsletter API → Supabase database: stores subscription (evidence: `app/api/newsletter/route.ts`)
- Traveler → WhatsApp concierge: contacts concierge
- Traveler → Sign-in and registration: authenticates
- Sign-in and registration → Browser connector: uses auth client (evidence: `components/auth/AuthForm.tsx`)
- Traveler → Traveler dashboard: tracks trip
- Administrator → Admin dashboard: manages requests
- Admin dashboard → Browser connector: reads and updates (evidence: `components/admin/AdminDashboard.tsx`)
- Admin dashboard → Admin statistics: renders (evidence: `components/admin/AdminDashboard.tsx`)
- Admin dashboard → Admin users table: renders (evidence: `components/admin/AdminDashboard.tsx`)
