# juniormalinga/west_rand_judo_association_wrja-website architecture

> Architecture diagram of the GitHub repository juniormalinga/west_rand_judo_association_wrja-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juniormalinga/west_rand_judo_association_wrja-website
- Repository: https://github.com/juniormalinga/west_rand_judo_association_wrja-website

## Overview

WRJA is a full-stack association website for public information, member services and committee administration. The main workflow runs from a visitor or member using the React site, through the Express API for protected or persisted actions, to Supabase; outcomes include content, account/session state, payment-proof status and contact confirmation. The graph also preserves the documented chatbot, maps, media and email capabilities. Relationships beyond excerpts are included only where the README or SOURCE INDEX supports them; unsampled internals are represented at their known source paths.

Main entry points: [`server/server.js`](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/server.js) (Express application), [`src/App.jsx`](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/App.jsx) (React site and routes), [`server/routes/api.js`](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/routes/api.js) (API routes), [`src/lib/api.js`](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/lib/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Public website"]
  node_site["React site and routes<br/>[App.jsx]"]
  node_public_content["Public content pages"]
  node_instructor_data["Instructor profiles<br/>[instructors.js]"]
  node_chat_widget["AI chat widget<br/>[ChatWidget.jsx]"]
  node_map["Interactive maps<br/>[ContactMap.jsx]"]
end

subgraph group_identity["Member identity"]
  node_auth_context["Session context<br/>[AuthContext.jsx]"]
  node_browser_api["API client<br/>[api.js]"]
  node_auth["Auth and access control<br/>[auth.js]"]
end

subgraph group_services["Member and committee services"]
  node_events_pages["Events and competitions<br/>[EventsPage.jsx]"]
  node_member_pages["Payment proof pages"]
  node_contact_form["Contact enquiries<br/>[useEnquiryForm.js]"]
  node_admin_console["Admin console<br/>[AdminPage.jsx]"]
  node_admin_panels["Admin management panels"]
end

subgraph group_backend["API and domain logic"]
  node_api_entry["API entry point<br/>[index.js]"]
  node_express["Express application<br/>[server.js]"]
  node_api_routes["API routes<br/>[api.js]"]
  node_domain_repos["Content and payment repositories"]
  node_media["Media and upload handling<br/>[mediaRepo.js]"]
end

subgraph group_integrations["Persistence and integrations"]
  node_database[("Supabase Postgres")]
  node_storage[("Supabase Storage")]
  node_supabase_auth["Supabase Auth"]
  node_gemini["Google Gemini"]
  node_smtp["Brevo SMTP"]
  node_mapbox["Mapbox GL JS"]
end

node_visitor(("Visitor / member"))

node_visitor -->|"browses"| node_site
node_site -->|"routes to"| node_public_content
node_public_content -->|"uses profiles"| node_instructor_data
node_site -->|"routes to"| node_events_pages
node_visitor -->|"submits enquiry"| node_contact_form
node_contact_form -->|"submits message"| node_browser_api
node_site -->|"provides session"| node_auth_context
node_auth_context -->|"requests auth"| node_browser_api
node_browser_api -->|"calls API"| node_api_entry
node_api_entry -->|"loads app"| node_express
node_express -.->|"mounts routes"| node_api_routes
node_api_routes -->|"checks access"| node_auth
node_auth -->|"verifies sessions"| node_supabase_auth
node_auth -->|"loads profiles"| node_database
node_api_routes -->|"dispatches data actions"| node_domain_repos
node_domain_repos -.->|"reads and writes"| node_database
node_api_routes -->|"handles media"| node_media
node_media -.->|"stores files"| node_storage
node_events_pages -->|"offers payment flow"| node_member_pages
node_site -->|"routes admins"| node_admin_console
node_admin_console -.->|"presents management"| node_admin_panels
node_admin_console -.->|"manages records"| node_browser_api
node_chat_widget -->|"requests chat"| node_express
node_express -->|"generates answers"| node_gemini
node_api_routes -->|"sends confirmations"| node_smtp
node_map -->|"renders maps"| node_mapbox
node_express -->|"uses privileged data access"| node_database
node_express -->|"uses media storage"| node_storage

click node_site "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/App.jsx"
click node_public_content "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/tree/main/src/pages"
click node_instructor_data "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/data/instructors.js"
click node_events_pages "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/pages/EventsPage.jsx"
click node_member_pages "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/pages/ProofOfPaymentPage.jsx"
click node_contact_form "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/hooks/useEnquiryForm.js"
click node_admin_console "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/pages/AdminPage.jsx"
click node_admin_panels "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/tree/main/src/components"
click node_chat_widget "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/components/ChatWidget.jsx"
click node_map "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/components/ContactMap.jsx"
click node_auth_context "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/context/AuthContext.jsx"
click node_browser_api "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/lib/api.js"
click node_api_entry "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/api/index.js"
click node_express "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/server.js"
click node_api_routes "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/routes/api.js"
click node_auth "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/auth.js"
click node_domain_repos "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/tree/main/server"
click node_media "https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/mediaRepo.js"

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_site,node_public_content,node_instructor_data,node_chat_widget,node_map toneBlue
class node_auth_context,node_browser_api,node_auth toneAmber
class node_events_pages,node_member_pages,node_contact_form,node_admin_console,node_admin_panels toneMint
class node_api_entry,node_express,node_api_routes,node_domain_repos,node_media toneRose
class node_database,node_storage,node_supabase_auth,node_gemini,node_smtp,node_mapbox,node_visitor toneIndigo
```

## Components

### Public website

- [React site and routes](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/App.jsx): `src/App.jsx`
- [Public content pages](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/tree/main/src/pages): `src/pages`
- [Instructor profiles](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/data/instructors.js): `src/data/instructors.js`
- [AI chat widget](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/components/ChatWidget.jsx): `src/components/ChatWidget.jsx`
- [Interactive maps](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/components/ContactMap.jsx): `src/components/ContactMap.jsx`

### Member identity

- [Session context](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [API client](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/lib/api.js): `src/lib/api.js`
- [Auth and access control](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/auth.js): `server/auth.js`

### Member and committee services

- [Events and competitions](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/pages/EventsPage.jsx): `src/pages/EventsPage.jsx`
- [Payment proof pages](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/pages/ProofOfPaymentPage.jsx): `src/pages/ProofOfPaymentPage.jsx`
- [Contact enquiries](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/hooks/useEnquiryForm.js): `src/hooks/useEnquiryForm.js`
- [Admin console](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/src/pages/AdminPage.jsx): `src/pages/AdminPage.jsx`
- [Admin management panels](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/tree/main/src/components): `src/components`

### API and domain logic

- [API entry point](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/api/index.js): `api/index.js`
- [Express application](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/server.js): `server/server.js`
- [API routes](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/routes/api.js): `server/routes/api.js`
- [Content and payment repositories](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/tree/main/server): `server`
- [Media and upload handling](https://github.com/juniormalinga/west_rand_judo_association_wrja-website/blob/main/server/mediaRepo.js): `server/mediaRepo.js`

### Persistence and integrations

- **Supabase Postgres**
- **Supabase Storage**
- **Supabase Auth**
- **Google Gemini**
- **Brevo SMTP**
- **Mapbox GL JS**

### Other components

- **Visitor / member**

## Connections

- Visitor / member → React site and routes: browses
- React site and routes → Public content pages: routes to (evidence: `src/App.jsx`)
- Public content pages → Instructor profiles: uses profiles (evidence: `src/data/instructors.js`)
- React site and routes → Events and competitions: routes to (evidence: `src/App.jsx`)
- Visitor / member → Contact enquiries: submits enquiry
- Contact enquiries → API client: submits message (evidence: `src/hooks/useEnquiryForm.js`)
- React site and routes → Session context: provides session (evidence: `src/App.jsx`)
- Session context → API client: requests auth (evidence: `src/context/AuthContext.jsx`)
- API client → API entry point: calls API
- API entry point → Express application: loads app (evidence: `api/index.js`)
- Express application → API routes: mounts routes (evidence: `server/server.js`)
- API routes → Auth and access control: checks access (evidence: `server/routes/api.js`)
- Auth and access control → Supabase Auth: verifies sessions (evidence: `server/auth.js`)
- Auth and access control → Supabase Postgres: loads profiles (evidence: `server/auth.js`)
- API routes → Content and payment repositories: dispatches data actions (evidence: `server/routes/api.js`)
- Content and payment repositories → Supabase Postgres: reads and writes
- API routes → Media and upload handling: handles media (evidence: `server/routes/api.js`)
- Media and upload handling → Supabase Storage: stores files
- Events and competitions → Payment proof pages: offers payment flow (evidence: `src/App.jsx`)
- React site and routes → Admin console: routes admins (evidence: `src/App.jsx`)
- Admin console → Admin management panels: presents management
- Admin console → API client: manages records
- AI chat widget → Express application: requests chat
- Express application → Google Gemini: generates answers
- API routes → Brevo SMTP: sends confirmations
- Interactive maps → Mapbox GL JS: renders maps
- Express application → Supabase Postgres: uses privileged data access
- Express application → Supabase Storage: uses media storage
