# sri-raj-2222/share_sphere architecture

> Architecture diagram of the GitHub repository sri-raj-2222/share_sphere, 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/sri-raj-2222/share_sphere
- Repository: https://github.com/sri-raj-2222/share_sphere

## Overview

ShareSphere is a peer-to-peer learning and collaboration product: users create skill profiles, find exchange partners or tutors, coordinate sessions and projects, then record completion and reviews. It also offers live broadcast classes and project collaboration, with administrative moderation. The frontend routes domain experiences; an Express/Socket.IO server handles API and real-time behavior, using local JSON-backed data and Supabase. Server and page excerpts are partial, so links to unsampled features are limited to routing and documented product capabilities.

Main entry points: [`src/App.tsx`](https://github.com/sri-raj-2222/share_sphere/blob/main/src/App.tsx) (App routes), [`server/server.js`](https://github.com/sri-raj-2222/share_sphere/blob/main/server/server.js) (API and events), [`src/pages/Chat.tsx`](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Chat.tsx) (Exchange rooms), [`src/contexts/auth-context.tsx`](https://github.com/sri-raj-2222/share_sphere/blob/main/src/contexts/auth-context.tsx) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and discovery"]
  node_signin["Sign in<br/>[SignIn.tsx]"]
  node_auth["Authentication<br/>[auth-context.tsx]"]
  node_onboarding["Skill onboarding<br/>[Onboarding.tsx]"]
  node_profile["Profiles<br/>[Profile.tsx]"]
  node_tutors["Tutor discovery<br/>[TutorDiscovery.tsx]"]
end

subgraph group_exchange["Skill exchange"]
  node_matches["Skill matches"]
  node_direct["Direct exchange<br/>[DirectExchange.tsx]"]
  node_requests["Match requests<br/>[Requests.tsx]"]
  node_chat["Exchange rooms<br/>[Chat.tsx]"]
  node_activity["Activity and reviews<br/>[MyActivity.tsx]"]
end

subgraph group_collaboration["Projects and live learning"]
  node_workfeed["Project listings<br/>[WorkFeed.tsx]"]
  node_workpost["Post project<br/>[WorkPost.tsx]"]
  node_workdetail["Project detail<br/>[WorkDetail.tsx]"]
  node_workroom["Project workspace<br/>[WorkRoom.tsx]"]
  node_broadcast["Live classes<br/>[BroadcastClass.tsx]"]
  node_broadcastchat["Class chat<br/>[BroadcastChat.tsx]"]
end

subgraph group_platform["Platform services"]
  node_app["App routes<br/>[App.tsx]"]
  node_supabase[("Supabase<br/>[supabase.ts]")]
  node_socket["Realtime events<br/>[socket-context.tsx]"]
  node_server["API and events<br/>[server.js]"]
  node_localdb[("Local data store<br/>[localDb.js]")]
  node_admin["Administration<br/>[AdminDashboard.tsx]"]
  node_reports["Reports and moderation<br/>[ReportsPanel.tsx]"]
  node_useradmin["User management<br/>[UserManagement.tsx]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_app
node_app -->|"routes"| node_signin
node_app -->|"routes"| node_onboarding
node_app -->|"routes"| node_profile
node_app -->|"routes"| node_tutors
node_app -->|"routes"| node_matches
node_app -->|"routes"| node_direct
node_app -->|"routes"| node_chat
node_app -->|"routes"| node_workfeed
node_app -->|"routes"| node_workpost
node_app -->|"routes"| node_workdetail
node_app -->|"routes"| node_workroom
node_app -->|"routes"| node_broadcast
node_app -->|"routes"| node_broadcastchat
node_app -->|"routes"| node_admin
node_signin -->|"authenticates"| node_auth
node_auth -->|"reads and writes"| node_supabase
node_auth -->|"checks bans"| node_server
node_onboarding -->|"sets up skills"| node_profile
node_matches -->|"starts requests"| node_requests
node_direct -->|"starts requests"| node_requests
node_requests -->|"uses API"| node_server
node_chat -->|"uses API"| node_server
node_chat -->|"receives events"| node_socket
node_socket -->|"connects"| node_server
node_server -->|"reads and writes"| node_localdb
node_server -.->|"uses client"| node_supabase
node_chat -->|"records outcomes"| node_activity
node_workpost -->|"uses API"| node_server
node_workfeed -->|"uses API"| node_server
node_workdetail -->|"uses API"| node_server
node_workroom -->|"uses API"| node_server
node_broadcast -->|"manages sessions"| node_server
node_broadcastchat -->|"uses API"| node_server
node_admin -->|"routes to"| node_reports
node_admin -->|"routes to"| node_useradmin
node_reports -->|"uses API"| node_server
node_useradmin -->|"uses API"| node_server

click node_app "https://github.com/sri-raj-2222/share_sphere/blob/main/src/App.tsx"
click node_signin "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/SignIn.tsx"
click node_auth "https://github.com/sri-raj-2222/share_sphere/blob/main/src/contexts/auth-context.tsx"
click node_supabase "https://github.com/sri-raj-2222/share_sphere/blob/main/src/lib/supabase.ts"
click node_onboarding "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Onboarding.tsx"
click node_profile "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Profile.tsx"
click node_tutors "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/TutorDiscovery.tsx"
click node_matches "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/AvailableMatches.tsx"
click node_direct "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/DirectExchange.tsx"
click node_requests "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Requests.tsx"
click node_chat "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Chat.tsx"
click node_socket "https://github.com/sri-raj-2222/share_sphere/blob/main/src/contexts/socket-context.tsx"
click node_server "https://github.com/sri-raj-2222/share_sphere/blob/main/server/server.js"
click node_localdb "https://github.com/sri-raj-2222/share_sphere/blob/main/server/localDb.js"
click node_activity "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/MyActivity.tsx"
click node_workfeed "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkFeed.tsx"
click node_workpost "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkPost.tsx"
click node_workdetail "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkDetail.tsx"
click node_workroom "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkRoom.tsx"
click node_broadcast "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/BroadcastClass.tsx"
click node_broadcastchat "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/BroadcastChat.tsx"
click node_admin "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/admin/AdminDashboard.tsx"
click node_reports "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/admin/ReportsPanel.tsx"
click node_useradmin "https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/admin/UserManagement.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_signin,node_auth,node_onboarding,node_profile,node_tutors toneBlue
class node_matches,node_direct,node_requests,node_chat,node_activity toneAmber
class node_workfeed,node_workpost,node_workdetail,node_workroom,node_broadcast,node_broadcastchat toneMint
class node_app,node_supabase,node_socket,node_server,node_localdb,node_admin,node_reports,node_useradmin toneRose
class node_learner toneIndigo
```

## Components

### Identity and discovery

- [Sign in](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/SignIn.tsx): `src/pages/SignIn.tsx`
- [Authentication](https://github.com/sri-raj-2222/share_sphere/blob/main/src/contexts/auth-context.tsx): `src/contexts/auth-context.tsx`
- [Skill onboarding](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Onboarding.tsx): `src/pages/Onboarding.tsx`
- [Profiles](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Tutor discovery](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/TutorDiscovery.tsx): `src/pages/TutorDiscovery.tsx`

### Skill exchange

- [Skill matches](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/AvailableMatches.tsx): `src/pages/AvailableMatches.tsx`
- [Direct exchange](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/DirectExchange.tsx): `src/pages/DirectExchange.tsx`
- [Match requests](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Requests.tsx): `src/pages/Requests.tsx`
- [Exchange rooms](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/Chat.tsx): `src/pages/Chat.tsx`
- [Activity and reviews](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/MyActivity.tsx): `src/pages/MyActivity.tsx`

### Projects and live learning

- [Project listings](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkFeed.tsx): `src/pages/WorkFeed.tsx`
- [Post project](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkPost.tsx): `src/pages/WorkPost.tsx`
- [Project detail](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkDetail.tsx): `src/pages/WorkDetail.tsx`
- [Project workspace](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/WorkRoom.tsx): `src/pages/WorkRoom.tsx`
- [Live classes](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/BroadcastClass.tsx): `src/pages/BroadcastClass.tsx`
- [Class chat](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/BroadcastChat.tsx): `src/pages/BroadcastChat.tsx`

### Platform services

- [App routes](https://github.com/sri-raj-2222/share_sphere/blob/main/src/App.tsx): `src/App.tsx`
- [Supabase](https://github.com/sri-raj-2222/share_sphere/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Realtime events](https://github.com/sri-raj-2222/share_sphere/blob/main/src/contexts/socket-context.tsx): `src/contexts/socket-context.tsx`
- [API and events](https://github.com/sri-raj-2222/share_sphere/blob/main/server/server.js): `server/server.js`
- [Local data store](https://github.com/sri-raj-2222/share_sphere/blob/main/server/localDb.js): `server/localDb.js`
- [Administration](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/admin/AdminDashboard.tsx): `src/pages/admin/AdminDashboard.tsx`
- [Reports and moderation](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/admin/ReportsPanel.tsx): `src/pages/admin/ReportsPanel.tsx`
- [User management](https://github.com/sri-raj-2222/share_sphere/blob/main/src/pages/admin/UserManagement.tsx): `src/pages/admin/UserManagement.tsx`

### Other components

- **Learner**

## Connections

- Learner → App routes: opens
- App routes → Sign in: routes
- App routes → Skill onboarding: routes
- App routes → Profiles: routes
- App routes → Tutor discovery: routes
- App routes → Skill matches: routes
- App routes → Direct exchange: routes
- App routes → Exchange rooms: routes
- App routes → Project listings: routes
- App routes → Post project: routes
- App routes → Project detail: routes
- App routes → Project workspace: routes
- App routes → Live classes: routes
- App routes → Class chat: routes
- App routes → Administration: routes
- Sign in → Authentication: authenticates
- Authentication → Supabase: reads and writes
- Authentication → API and events: checks bans
- Skill onboarding → Profiles: sets up skills
- Skill matches → Match requests: starts requests
- Direct exchange → Match requests: starts requests
- Match requests → API and events: uses API
- Exchange rooms → API and events: uses API
- Exchange rooms → Realtime events: receives events
- Realtime events → API and events: connects
- API and events → Local data store: reads and writes
- API and events → Supabase: uses client
- Exchange rooms → Activity and reviews: records outcomes
- Post project → API and events: uses API
- Project listings → API and events: uses API
- Project detail → API and events: uses API
- Project workspace → API and events: uses API
- Live classes → API and events: manages sessions
- Class chat → API and events: uses API
- Administration → Reports and moderation: routes to
- Administration → User management: routes to
- Reports and moderation → API and events: uses API
- User management → API and events: uses API
