# k-nilesh04/645-running-club architecture

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

- Interactive diagram: https://gitdiagram.com/k-nilesh04/645-running-club
- Repository: https://github.com/k-nilesh04/645-running-club

## Overview

645 Run Club is a React client backed by an Express/MongoDB API for club members and administrators. Members authenticate, verify accounts, manage profiles and memberships, and register for runs; organizers administer runs and attendance, while admins manage announcements and chatbot knowledge. The chatbot filters questions, retrieves verified club knowledge, and can use Gemini for responses. The README documents broad product capabilities, while the excerpts and source index establish only some internal calls; unsampled implementation links are omitted where evidence is insufficient.

Main entry points: [`backend/index.js`](https://github.com/k-nilesh04/645-running-club/blob/main/backend/index.js) (REST API server), [`frontend/src/App.jsx`](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/App.jsx) (Web app), [`frontend/src/api/api.js`](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/api/api.js) (API client), [`backend/controller/adminController.js`](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/adminController.js) (Admin operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Member web client"]
  node_web_app["Web app<br/>[App.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_auth_page["Sign-in and signup<br/>[Auth.jsx]"]
  node_profile_ui["Profile<br/>[Profile.jsx]"]
  node_run_ui["Run registration<br/>[RegisterRun.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_widget["Chat widget<br/>[ChatbotWidget.jsx]"]
  node_knowledge_ui["Knowledge editor"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_service["Authentication<br/>[authController.js]"]
  node_verification["Email verification"]
  node_email_sender["Email delivery<br/>[emailSender.js]"]
  node_profile_service["Profile management<br/>[profileUpdate.js]"]
  node_user_store[("User records<br/>[user.model.js]")]
end

subgraph group_club_ops["Club operations"]
  node_membership_payments["Membership and payments"]
  node_membership_store[("Membership records")]
  node_payment_store[("Payment records<br/>[payment.model.js]")]
  node_run_registration["Run registration<br/>[runregistration.js]"]
  node_run_store[("Run records<br/>[run.model.js]")]
  node_attendance_store[("Attendance records")]
  node_announcement_store[("Announcements")]
end

subgraph group_admin["Administration"]
  node_admin_controller["Admin operations<br/>[adminController.js]"]
  node_dashboard_summary["Dashboard summary<br/>[adminDashboard.js]"]
end

subgraph group_chatbot["Club chatbot"]
  node_chat_controller["Chat API"]
  node_knowledge_service["Knowledge retrieval"]
  node_knowledge_store[("Knowledge entries")]
  node_gemini["Gemini service<br/>[geminiService.js]"]
end

node_member(("Member"))
node_administrator(("Administrator"))
node_api_server["REST API server<br/>[index.js]"]
node_mongodb[("MongoDB")]
node_email_provider["Email provider"]
node_gemini_service["Gemini API"]

node_member -->|"uses"| node_web_app
node_administrator -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_auth_page
node_web_app -->|"routes to"| node_profile_ui
node_web_app -->|"routes to"| node_run_ui
node_web_app -->|"routes to"| node_admin_ui
node_web_app -->|"renders"| node_widget
node_auth_page -->|"calls"| node_api_client
node_auth_page -.->|"verifies signup"| node_verification
node_profile_ui -->|"calls"| node_api_client
node_run_ui -->|"calls"| node_api_client
node_admin_ui -->|"calls"| node_api_client
node_admin_ui -->|"renders"| node_knowledge_ui
node_knowledge_ui -->|"calls"| node_api_client
node_widget -->|"sends messages"| node_api_client
node_api_client -->|"requests"| node_api_server
node_api_server -->|"routes requests"| node_auth_service
node_api_server -->|"routes requests"| node_verification
node_api_server -->|"routes requests"| node_profile_service
node_api_server -->|"routes requests"| node_run_registration
node_api_server -->|"routes requests"| node_membership_payments
node_api_server -->|"routes requests"| node_admin_controller
node_api_server -->|"routes requests"| node_chat_controller
node_auth_service -->|"reads and writes"| node_user_store
node_verification -->|"creates users"| node_user_store
node_verification -->|"sends email"| node_email_sender
node_email_sender -.->|"delivers mail"| node_email_provider
node_profile_service -.->|"manages profiles"| node_user_store
node_membership_payments -->|"reads and writes"| node_membership_store
node_membership_payments -->|"creates and updates"| node_payment_store
node_run_registration -.->|"uses runs"| node_run_store
node_run_registration -.->|"tracks registration"| node_attendance_store
node_admin_controller -->|"reads runs"| node_run_store
node_admin_controller -->|"reads and updates"| node_attendance_store
node_admin_controller -->|"reads memberships"| node_membership_store
node_admin_controller -->|"summarizes attendance"| node_dashboard_summary
node_admin_controller -.->|"manages announcements"| node_announcement_store
node_chat_controller -->|"filters and retrieves"| node_knowledge_service
node_chat_controller -->|"reads and writes"| node_knowledge_store
node_chat_controller -->|"requests answer"| node_gemini
node_gemini -.->|"generates response"| node_gemini_service
node_api_server -->|"connects"| node_mongodb

click node_web_app "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/api/api.js"
click node_auth_page "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/Auth.jsx"
click node_profile_ui "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/Profile.jsx"
click node_run_ui "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/RegisterRun.jsx"
click node_admin_ui "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/AdminDashboard.jsx"
click node_widget "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/components/chatbot/ChatbotWidget.jsx"
click node_knowledge_ui "https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/components/chatbot/ChatbotKnowledgeAdmin.jsx"
click node_api_server "https://github.com/k-nilesh04/645-running-club/blob/main/backend/index.js"
click node_auth_service "https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/authController.js"
click node_verification "https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/verificationController.js"
click node_email_sender "https://github.com/k-nilesh04/645-running-club/blob/main/backend/utils/emailSender.js"
click node_profile_service "https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/profileUpdate.js"
click node_user_store "https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/user.model.js"
click node_membership_payments "https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/paymentController.js"
click node_membership_store "https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/membership.model.js"
click node_payment_store "https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/payment.model.js"
click node_run_registration "https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/runregistration.js"
click node_run_store "https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/run.model.js"
click node_attendance_store "https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/attendance.model.js"
click node_announcement_store "https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/announcement.model.js"
click node_admin_controller "https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/adminController.js"
click node_dashboard_summary "https://github.com/k-nilesh04/645-running-club/blob/main/backend/utils/adminDashboard.js"
click node_chat_controller "https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/chatbotController.js"
click node_knowledge_service "https://github.com/k-nilesh04/645-running-club/blob/main/backend/services/chatbotKnowledgeService.js"
click node_knowledge_store "https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/chatbotKnowledge.model.js"
click node_gemini "https://github.com/k-nilesh04/645-running-club/blob/main/backend/services/geminiService.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_web_app,node_api_client,node_auth_page,node_profile_ui,node_run_ui,node_admin_ui,node_widget,node_knowledge_ui toneBlue
class node_auth_service,node_verification,node_email_sender,node_profile_service,node_user_store,node_mongodb toneAmber
class node_membership_payments,node_membership_store,node_payment_store,node_run_registration,node_run_store,node_attendance_store,node_announcement_store,node_api_server,node_gemini_service toneMint
class node_admin_controller,node_dashboard_summary toneRose
class node_chat_controller,node_knowledge_service,node_knowledge_store,node_gemini,node_member,node_administrator,node_email_provider toneIndigo
```

## Components

### Member web client

- [Web app](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/api/api.js): `frontend/src/api/api.js`
- [Sign-in and signup](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/Auth.jsx): `frontend/src/pages/Auth.jsx`
- [Profile](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [Run registration](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/RegisterRun.jsx): `frontend/src/pages/RegisterRun.jsx`
- [Admin dashboard](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/pages/AdminDashboard.jsx): `frontend/src/pages/AdminDashboard.jsx`
- [Chat widget](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/components/chatbot/ChatbotWidget.jsx): `frontend/src/components/chatbot/ChatbotWidget.jsx`
- [Knowledge editor](https://github.com/k-nilesh04/645-running-club/blob/main/frontend/src/components/chatbot/ChatbotKnowledgeAdmin.jsx): `frontend/src/components/chatbot/ChatbotKnowledgeAdmin.jsx`

### Identity and profiles

- [Authentication](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/authController.js): `backend/controller/authController.js`
- [Email verification](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/verificationController.js): `backend/controller/verificationController.js`
- [Email delivery](https://github.com/k-nilesh04/645-running-club/blob/main/backend/utils/emailSender.js): `backend/utils/emailSender.js`
- [Profile management](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/profileUpdate.js): `backend/controller/profileUpdate.js`
- [User records](https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/user.model.js): `backend/models/user.model.js`

### Club operations

- [Membership and payments](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/paymentController.js): `backend/controller/paymentController.js`
- [Membership records](https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/membership.model.js): `backend/models/membership.model.js`
- [Payment records](https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/payment.model.js): `backend/models/payment.model.js`
- [Run registration](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/runregistration.js): `backend/controller/runregistration.js`
- [Run records](https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/run.model.js): `backend/models/run.model.js`
- [Attendance records](https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/attendance.model.js): `backend/models/attendance.model.js`
- [Announcements](https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/announcement.model.js): `backend/models/announcement.model.js`

### Administration

- [Admin operations](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/adminController.js): `backend/controller/adminController.js`
- [Dashboard summary](https://github.com/k-nilesh04/645-running-club/blob/main/backend/utils/adminDashboard.js): `backend/utils/adminDashboard.js`

### Club chatbot

- [Chat API](https://github.com/k-nilesh04/645-running-club/blob/main/backend/controller/chatbotController.js): `backend/controller/chatbotController.js`
- [Knowledge retrieval](https://github.com/k-nilesh04/645-running-club/blob/main/backend/services/chatbotKnowledgeService.js): `backend/services/chatbotKnowledgeService.js`
- [Knowledge entries](https://github.com/k-nilesh04/645-running-club/blob/main/backend/models/chatbotKnowledge.model.js): `backend/models/chatbotKnowledge.model.js`
- [Gemini service](https://github.com/k-nilesh04/645-running-club/blob/main/backend/services/geminiService.js): `backend/services/geminiService.js`

### Other components

- **Member**
- **Administrator**
- [REST API server](https://github.com/k-nilesh04/645-running-club/blob/main/backend/index.js): `backend/index.js`
- **MongoDB**
- **Email provider**
- **Gemini API**

## Connections

- Member → Web app: uses (evidence: `README.md`)
- Administrator → Web app: uses (evidence: `README.md`)
- Web app → Sign-in and signup: routes to (evidence: `frontend/src/App.jsx`)
- Web app → Profile: routes to (evidence: `frontend/src/App.jsx`)
- Web app → Run registration: routes to (evidence: `frontend/src/App.jsx`)
- Web app → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Web app → Chat widget: renders (evidence: `frontend/src/App.jsx`)
- Sign-in and signup → API client: calls (evidence: `frontend/src/pages/Auth.jsx`)
- Sign-in and signup → Email verification: verifies signup (evidence: `README.md`)
- Profile → API client: calls (evidence: `frontend/src/api/api.js`)
- Run registration → API client: calls (evidence: `frontend/src/api/api.js`)
- Admin dashboard → API client: calls (evidence: `frontend/src/pages/AdminDashboard.jsx`)
- Admin dashboard → Knowledge editor: renders (evidence: `frontend/src/pages/AdminDashboard.jsx`)
- Knowledge editor → API client: calls (evidence: `frontend/src/api/api.js`)
- Chat widget → API client: sends messages (evidence: `frontend/src/components/chatbot/ChatbotWidget.jsx`)
- API client → REST API server: requests (evidence: `README.md`)
- REST API server → Authentication: routes requests (evidence: `backend/index.js`)
- REST API server → Email verification: routes requests (evidence: `backend/index.js`)
- REST API server → Profile management: routes requests (evidence: `backend/index.js`)
- REST API server → Run registration: routes requests (evidence: `backend/index.js`)
- REST API server → Membership and payments: routes requests (evidence: `backend/index.js`)
- REST API server → Admin operations: routes requests (evidence: `backend/index.js`)
- REST API server → Chat API: routes requests (evidence: `backend/index.js`)
- Authentication → User records: reads and writes (evidence: `backend/controller/authController.js`)
- Email verification → User records: creates users (evidence: `backend/controller/verificationController.js`)
- Email verification → Email delivery: sends email (evidence: `backend/controller/verificationController.js`)
- Email delivery → Email provider: delivers mail (evidence: `README.md`)
- Profile management → User records: manages profiles (evidence: `README.md`)
- Membership and payments → Membership records: reads and writes (evidence: `backend/controller/paymentController.js`)
- Membership and payments → Payment records: creates and updates (evidence: `backend/controller/paymentController.js`)
- Run registration → Run records: uses runs (evidence: `README.md`)
- Run registration → Attendance records: tracks registration (evidence: `README.md`)
- Admin operations → Run records: reads runs (evidence: `backend/controller/adminController.js`)
- Admin operations → Attendance records: reads and updates (evidence: `backend/controller/adminController.js`)
- Admin operations → Membership records: reads memberships (evidence: `backend/controller/adminController.js`)
- Admin operations → Dashboard summary: summarizes attendance (evidence: `backend/controller/adminController.js`)
- Admin operations → Announcements: manages announcements (evidence: `README.md`)
- Chat API → Knowledge retrieval: filters and retrieves (evidence: `backend/controller/chatbotController.js`)
- Chat API → Knowledge entries: reads and writes (evidence: `backend/controller/chatbotController.js`)
- Chat API → Gemini service: requests answer (evidence: `backend/controller/chatbotController.js`)
- Gemini service → Gemini API: generates response (evidence: `README.md`)
- REST API server → MongoDB: connects (evidence: `backend/index.js`)
