# srikarshetkar/spih101 architecture

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

- Interactive diagram: https://gitdiagram.com/srikarshetkar/spih101
- Repository: https://github.com/srikarshetkar/spih101

## Overview

SportSphere is an athlete networking and sports-event platform. Athletes sign in, complete onboarding and profiles, discover people or events, then coordinate participation through event management, chat and notifications; attendance feeds the trust system. The graph separates the React experience, API feature handlers and persistence/realtime integrations. README capabilities are retained where source excerpts were unavailable; those links are shown only where documented or directly evidenced, so some feature wiring is intentionally not inferred.

Main entry points: [`backend/src/server.js`](https://github.com/srikarshetkar/spih101/blob/main/backend/src/server.js) (Express server), [`frontend/src/App.jsx`](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/App.jsx) (App routes), [`backend/src/services/prismaService.js`](https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/prismaService.js) (PostgreSQL data), [`frontend/src/services/api.js`](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Athlete experience"]
  node_app["App routes<br/>[App.jsx]"]
  node_authui["Sign in<br/>[Login.jsx]"]
  node_onboardui["Onboarding<br/>[Onboarding.jsx]"]
  node_profileui["Athlete profile<br/>[AthleteProfile.jsx]"]
  node_discoveryui["Discovery<br/>[Discovery.jsx]"]
  node_eventsui["Events<br/>[Events.jsx]"]
  node_eventdetail["Event details<br/>[EventDetails.jsx]"]
  node_notificationsui["Notifications<br/>[Notifications.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Platform API"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_auth["Authentication<br/>[authController.js]"]
  node_googleauth["Google verification"]
  node_onboarding["Onboarding API"]
  node_profile["Profile API"]
  node_discovery["Athlete discovery"]
  node_events["Event management<br/>[eventController.js]"]
  node_payment["Paid event joining"]
  node_trust["Trust scoring<br/>[trustService.js]"]
  node_notifications["Notifications"]
  node_chat["Chat API<br/>[chatController.js]"]
  node_db[("PostgreSQL data<br/>[prismaService.js]")]
end

subgraph group_realtime["Realtime and media"]
  node_socket["Socket.IO<br/>[index.js]"]
  node_socketclient["Socket client<br/>[socket.js]"]
end

subgraph group_integrations["External services"]
  node_cloudinary["Cloudinary uploads<br/>[uploadRoutes.js]"]
  node_google{{"Google identity"}}
  node_razorpay{{"Razorpay<br/>[razorpayService.js]"}}
end

node_athlete(("Athlete"))

node_athlete -->|"uses"| node_app
node_app -->|"routes"| node_authui
node_app -->|"routes"| node_onboardui
node_app -->|"routes"| node_profileui
node_app -->|"routes"| node_discoveryui
node_app -->|"routes"| node_eventsui
node_app -->|"routes"| node_eventdetail
node_app -->|"routes"| node_notificationsui
node_authui -->|"requests"| node_api_client
node_onboardui -->|"requests"| node_api_client
node_profileui -->|"requests"| node_api_client
node_discoveryui -->|"requests"| node_api_client
node_eventsui -->|"requests"| node_api_client
node_eventdetail -->|"requests"| node_api_client
node_notificationsui -->|"requests"| node_api_client
node_api_client -->|"HTTP API"| node_server
node_server -->|"mounts"| node_authroutes
node_authroutes -->|"dispatches"| node_auth
node_auth -->|"reads/writes"| node_db
node_auth -->|"verifies token"| node_googleauth
node_googleauth -->|"fetches signing keys"| node_google
node_server -->|"mounts routes"| node_onboarding
node_server -->|"mounts routes"| node_profile
node_server -->|"mounts routes"| node_discovery
node_server -->|"mounts routes"| node_events
node_server -->|"mounts routes"| node_chat
node_server -->|"mounts routes"| node_notifications
node_onboarding -->|"reads/writes"| node_db
node_profile -->|"reads/writes"| node_db
node_discovery -->|"queries"| node_db
node_events -->|"reads/writes"| node_db
node_events -->|"applies attendance"| node_trust
node_events -->|"sends updates"| node_notifications
node_trust -->|"updates scores"| node_db
node_notifications -->|"stores notices"| node_db
node_server -->|"initializes"| node_socket
node_chat -->|"reads/writes"| node_db
node_socketclient -->|"connects"| node_socket
node_server -.->|"configures"| node_cloudinary
node_events -->|"dispatches paid join"| node_payment
node_payment -.->|"processes payment"| node_razorpay
node_payment -->|"updates participation"| node_db

click node_app "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Login.jsx"
click node_onboardui "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Onboarding.jsx"
click node_profileui "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/AthleteProfile.jsx"
click node_discoveryui "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Discovery.jsx"
click node_eventsui "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Events.jsx"
click node_eventdetail "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/EventDetails.jsx"
click node_notificationsui "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Notifications.jsx"
click node_api_client "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/srikarshetkar/spih101/blob/main/backend/src/server.js"
click node_authroutes "https://github.com/srikarshetkar/spih101/blob/main/backend/src/routes/authRoutes.js"
click node_auth "https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/authController.js"
click node_googleauth "https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/googleAuthService.js"
click node_onboarding "https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/onboardingController.js"
click node_profile "https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/profileController.js"
click node_discovery "https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/discoveryController.js"
click node_events "https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/eventController.js"
click node_payment "https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/paymentController.js"
click node_trust "https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/trustService.js"
click node_notifications "https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/notificationService.js"
click node_chat "https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/chatController.js"
click node_db "https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/prismaService.js"
click node_socket "https://github.com/srikarshetkar/spih101/blob/main/backend/src/socket/index.js"
click node_socketclient "https://github.com/srikarshetkar/spih101/blob/main/frontend/src/services/socket.js"
click node_cloudinary "https://github.com/srikarshetkar/spih101/blob/main/backend/src/routes/uploadRoutes.js"
click node_razorpay "https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/razorpayService.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_app,node_authui,node_onboardui,node_profileui,node_discoveryui,node_eventsui,node_eventdetail,node_notificationsui,node_api_client toneBlue
class node_server,node_authroutes,node_auth,node_googleauth,node_onboarding,node_profile,node_discovery,node_events,node_payment,node_trust,node_notifications,node_chat,node_db toneAmber
class node_socket,node_socketclient toneMint
class node_cloudinary,node_google,node_razorpay toneRose
class node_athlete toneIndigo
```

## Components

### Athlete experience

- [App routes](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign in](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Onboarding](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Onboarding.jsx): `frontend/src/pages/Onboarding.jsx`
- [Athlete profile](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/AthleteProfile.jsx): `frontend/src/pages/AthleteProfile.jsx`
- [Discovery](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Discovery.jsx): `frontend/src/pages/Discovery.jsx`
- [Events](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Events.jsx): `frontend/src/pages/Events.jsx`
- [Event details](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/EventDetails.jsx): `frontend/src/pages/EventDetails.jsx`
- [Notifications](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/pages/Notifications.jsx): `frontend/src/pages/Notifications.jsx`
- [API client](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Platform API

- [Express server](https://github.com/srikarshetkar/spih101/blob/main/backend/src/server.js): `backend/src/server.js`
- [Auth routes](https://github.com/srikarshetkar/spih101/blob/main/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Authentication](https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Google verification](https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/googleAuthService.js): `backend/src/services/googleAuthService.js`
- [Onboarding API](https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/onboardingController.js): `backend/src/controllers/onboardingController.js`
- [Profile API](https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/profileController.js): `backend/src/controllers/profileController.js`
- [Athlete discovery](https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/discoveryController.js): `backend/src/controllers/discoveryController.js`
- [Event management](https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/eventController.js): `backend/src/controllers/eventController.js`
- [Paid event joining](https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/paymentController.js): `backend/src/controllers/paymentController.js`
- [Trust scoring](https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/trustService.js): `backend/src/services/trustService.js`
- [Notifications](https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/notificationService.js): `backend/src/services/notificationService.js`
- [Chat API](https://github.com/srikarshetkar/spih101/blob/main/backend/src/controllers/chatController.js): `backend/src/controllers/chatController.js`
- [PostgreSQL data](https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/prismaService.js): `backend/src/services/prismaService.js`

### Realtime and media

- [Socket.IO](https://github.com/srikarshetkar/spih101/blob/main/backend/src/socket/index.js): `backend/src/socket/index.js`
- [Socket client](https://github.com/srikarshetkar/spih101/blob/main/frontend/src/services/socket.js): `frontend/src/services/socket.js`

### External services

- [Cloudinary uploads](https://github.com/srikarshetkar/spih101/blob/main/backend/src/routes/uploadRoutes.js): `backend/src/routes/uploadRoutes.js`
- **Google identity**
- [Razorpay](https://github.com/srikarshetkar/spih101/blob/main/backend/src/services/razorpayService.js): `backend/src/services/razorpayService.js`

### Other components

- **Athlete**

## Connections

- Athlete → App routes: uses
- App routes → Sign in: routes
- App routes → Onboarding: routes
- App routes → Athlete profile: routes
- App routes → Discovery: routes
- App routes → Events: routes
- App routes → Event details: routes
- App routes → Notifications: routes
- Sign in → API client: requests
- Onboarding → API client: requests
- Athlete profile → API client: requests
- Discovery → API client: requests
- Events → API client: requests
- Event details → API client: requests
- Notifications → API client: requests
- API client → Express server: HTTP API
- Express server → Auth routes: mounts
- Auth routes → Authentication: dispatches
- Authentication → PostgreSQL data: reads/writes
- Authentication → Google verification: verifies token
- Google verification → Google identity: fetches signing keys
- Express server → Onboarding API: mounts routes
- Express server → Profile API: mounts routes
- Express server → Athlete discovery: mounts routes
- Express server → Event management: mounts routes
- Express server → Chat API: mounts routes
- Express server → Notifications: mounts routes
- Onboarding API → PostgreSQL data: reads/writes
- Profile API → PostgreSQL data: reads/writes
- Athlete discovery → PostgreSQL data: queries
- Event management → PostgreSQL data: reads/writes
- Event management → Trust scoring: applies attendance
- Event management → Notifications: sends updates
- Trust scoring → PostgreSQL data: updates scores
- Notifications → PostgreSQL data: stores notices
- Express server → Socket.IO: initializes
- Chat API → PostgreSQL data: reads/writes
- Socket client → Socket.IO: connects
- Express server → Cloudinary uploads: configures
- Event management → Paid event joining: dispatches paid join
- Paid event joining → Razorpay: processes payment
- Paid event joining → PostgreSQL data: updates participation
