# chandrashekhar235/learn-bridge architecture

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

- Interactive diagram: https://gitdiagram.com/chandrashekhar235/learn-bridge
- Repository: https://github.com/chandrashekhar235/learn-bridge

## Overview

LearnBridge is a social learning application: users create profiles, discover people and communities, connect and message, publish blogs, and join voice/video rooms. The React client routes users to these experiences; an Express/Mongoose backend provides authentication and domain APIs, with Socket.IO supporting real-time communication. Group and voice-room access requests are distinct from direct connections. The available excerpts show selected route, model, and socket behavior; several feature pages and integrations are indexed but not sampled, so their internal links are left out.

Main entry points: [`backend/server.js`](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/server.js) (HTTP and socket server), [`src/App.jsx`](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/App.jsx) (Page router), [`backend/routes/ChatRoutes.js`](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/ChatRoutes.js) (Chat and connections API), [`backend/middleware/auth.js`](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/middleware/auth.js) (JWT guard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_router["Page router<br/>[App.jsx]"]
  node_profile_ui["Profiles<br/>[Profile.jsx]"]
  node_explore_ui["Explore<br/>[Explore.jsx]"]
  node_blog_ui["Blog publishing<br/>[Blogs.jsx]"]
  node_group_ui["Group admin<br/>[GroupAdmin.jsx]"]
  node_rooms_ui["Room discovery<br/>[Rooms.jsx]"]
  node_call_ui["Video calls<br/>[Vc.jsx]"]
end

subgraph group_identity["Identity"]
  node_login_ui["Login<br/>[Login.jsx]"]
  node_google_ui["Google sign-in"]
  node_auth_api["Account and profile API<br/>[UserRoutes.js]"]
  node_auth_guard["JWT guard<br/>[auth.js]"]
  node_users[("User records<br/>[User.js]")]
end

subgraph group_community["Community"]
  node_blog_api["Blog API<br/>[BlogRoutes.js]"]
  node_blogs[("Blog records<br/>[Blog.js]")]
  node_group_api["Groups API<br/>[GroupRoutes.js]"]
  node_groups[("Group records<br/>[Group.js]")]
  node_ai_api["AI routes<br/>[AiRoutes.js]"]
end

subgraph group_messaging["Messaging"]
  node_chat_ui["Chat hub<br/>[ChatHub.jsx]"]
  node_socket_client["Socket client context<br/>[SocketContext.jsx]"]
  node_chat_api["Chat and connections API<br/>[ChatRoutes.js]"]
  node_connection_requests[("Connection requests")]
  node_conversations[("Conversations<br/>[Conversation.js]")]
  node_messages[("Messages<br/>[Message.js]")]
  node_server["HTTP and socket server<br/>[server.js]"]
end

subgraph group_rooms["Rooms and calls"]
  node_vc_api["Voice-room API<br/>[VcRoutes.js]"]
  node_vc_rooms[("Voice-room records<br/>[VcRoom.js]")]
end

node_user(("Learner"))

node_user -->|"uses"| node_router
node_router -->|"routes to"| node_login_ui
node_router -->|"routes to"| node_profile_ui
node_router -->|"routes to"| node_explore_ui
node_router -->|"routes to"| node_blog_ui
node_router -->|"routes to"| node_group_ui
node_router -->|"routes to"| node_rooms_ui
node_router -->|"routes to"| node_call_ui
node_login_ui -->|"offers"| node_google_ui
node_google_ui -->|"posts credential"| node_auth_api
node_auth_api -->|"reads and writes"| node_users
node_auth_guard -->|"loads user"| node_users
node_auth_api -->|"protects profile"| node_auth_guard
node_profile_ui -.->|"uses profile API"| node_auth_api
node_blog_ui -.->|"uses blog API"| node_blog_api
node_blog_api -->|"reads and writes"| node_blogs
node_group_ui -.->|"uses groups API"| node_group_api
node_group_api -->|"reads and writes"| node_groups
node_group_api -->|"protects actions"| node_auth_guard
node_chat_ui -->|"uses socket"| node_socket_client
node_chat_ui -.->|"uses chat API"| node_chat_api
node_socket_client -->|"connects to"| node_server
node_chat_api -->|"protects routes"| node_auth_guard
node_chat_api -->|"queries users"| node_users
node_chat_api -->|"manages requests"| node_connection_requests
node_chat_api -->|"queries conversations"| node_conversations
node_server -->|"creates messages"| node_messages
node_server -->|"reads and updates"| node_conversations
node_server -.->|"delivers live events"| node_chat_ui
node_rooms_ui -.->|"uses room API"| node_vc_api
node_call_ui -.->|"uses realtime calls"| node_server
node_vc_api -->|"reads and writes"| node_vc_rooms
node_vc_api -->|"protects actions"| node_auth_guard
node_server -->|"mounts routes"| node_chat_api
node_server -->|"mounts routes"| node_blog_api
node_server -->|"mounts routes"| node_group_api
node_server -.->|"mounts routes"| node_vc_api
node_server -->|"mounts routes"| node_ai_api

click node_router "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/App.jsx"
click node_profile_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Profile.jsx"
click node_explore_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Explore.jsx"
click node_blog_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Blogs.jsx"
click node_group_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/GroupAdmin.jsx"
click node_rooms_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Rooms.jsx"
click node_call_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Vc.jsx"
click node_login_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Login.jsx"
click node_google_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/components/GoogleAuthButton.jsx"
click node_auth_api "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/UserRoutes.js"
click node_auth_guard "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/middleware/auth.js"
click node_users "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/User.js"
click node_blog_api "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/BlogRoutes.js"
click node_blogs "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Blog.js"
click node_group_api "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/GroupRoutes.js"
click node_groups "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Group.js"
click node_chat_ui "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/components/ChatHub.jsx"
click node_socket_client "https://github.com/chandrashekhar235/learn-bridge/blob/main/src/context/SocketContext.jsx"
click node_chat_api "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/ChatRoutes.js"
click node_connection_requests "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/ConnectionRequest.js"
click node_conversations "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Conversation.js"
click node_messages "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Message.js"
click node_server "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/server.js"
click node_vc_api "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/VcRoutes.js"
click node_vc_rooms "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/VcRoom.js"
click node_ai_api "https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/AiRoutes.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_router,node_profile_ui,node_explore_ui,node_blog_ui,node_group_ui,node_rooms_ui,node_call_ui toneBlue
class node_login_ui,node_google_ui,node_auth_api,node_auth_guard,node_users toneAmber
class node_blog_api,node_blogs,node_group_api,node_groups,node_ai_api toneMint
class node_chat_ui,node_socket_client,node_chat_api,node_connection_requests,node_conversations,node_messages,node_server toneRose
class node_vc_api,node_vc_rooms,node_user toneIndigo
```

## Components

### Web client

- [Page router](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/App.jsx): `src/App.jsx`
- [Profiles](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Explore](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Explore.jsx): `src/pages/Explore.jsx`
- [Blog publishing](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Blogs.jsx): `src/pages/Blogs.jsx`
- [Group admin](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/GroupAdmin.jsx): `src/pages/GroupAdmin.jsx`
- [Room discovery](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Rooms.jsx): `src/pages/Rooms.jsx`
- [Video calls](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Vc.jsx): `src/pages/Vc.jsx`

### Identity

- [Login](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Google sign-in](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/components/GoogleAuthButton.jsx): `src/components/GoogleAuthButton.jsx`
- [Account and profile API](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/UserRoutes.js): `backend/routes/UserRoutes.js`
- [JWT guard](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [User records](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/User.js): `backend/models/User.js`

### Community

- [Blog API](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/BlogRoutes.js): `backend/routes/BlogRoutes.js`
- [Blog records](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Blog.js): `backend/models/Blog.js`
- [Groups API](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/GroupRoutes.js): `backend/routes/GroupRoutes.js`
- [Group records](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Group.js): `backend/models/Group.js`
- [AI routes](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/AiRoutes.js): `backend/routes/AiRoutes.js`

### Messaging

- [Chat hub](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/components/ChatHub.jsx): `src/components/ChatHub.jsx`
- [Socket client context](https://github.com/chandrashekhar235/learn-bridge/blob/main/src/context/SocketContext.jsx): `src/context/SocketContext.jsx`
- [Chat and connections API](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/ChatRoutes.js): `backend/routes/ChatRoutes.js`
- [Connection requests](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/ConnectionRequest.js): `backend/models/ConnectionRequest.js`
- [Conversations](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Conversation.js): `backend/models/Conversation.js`
- [Messages](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/Message.js): `backend/models/Message.js`
- [HTTP and socket server](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/server.js): `backend/server.js`

### Rooms and calls

- [Voice-room API](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/routes/VcRoutes.js): `backend/routes/VcRoutes.js`
- [Voice-room records](https://github.com/chandrashekhar235/learn-bridge/blob/main/backend/models/VcRoom.js): `backend/models/VcRoom.js`

### Other components

- **Learner**

## Connections

- Learner → Page router: uses (evidence: `src/App.jsx`)
- Page router → Login: routes to (evidence: `src/App.jsx`)
- Page router → Profiles: routes to (evidence: `src/App.jsx`)
- Page router → Explore: routes to (evidence: `src/App.jsx`)
- Page router → Blog publishing: routes to (evidence: `src/App.jsx`)
- Page router → Group admin: routes to (evidence: `src/App.jsx`)
- Page router → Room discovery: routes to (evidence: `src/App.jsx`)
- Page router → Video calls: routes to (evidence: `src/App.jsx`)
- Login → Google sign-in: offers (evidence: `src/pages/Login.jsx`)
- Google sign-in → Account and profile API: posts credential (evidence: `src/components/GoogleAuthButton.jsx`)
- Account and profile API → User records: reads and writes (evidence: `backend/routes/UserRoutes.js`)
- JWT guard → User records: loads user (evidence: `backend/middleware/auth.js`)
- Account and profile API → JWT guard: protects profile (evidence: `backend/routes/UserRoutes.js`)
- Profiles → Account and profile API: uses profile API
- Blog publishing → Blog API: uses blog API
- Blog API → Blog records: reads and writes (evidence: `backend/routes/BlogRoutes.js`)
- Group admin → Groups API: uses groups API
- Groups API → Group records: reads and writes (evidence: `backend/routes/GroupRoutes.js`)
- Groups API → JWT guard: protects actions (evidence: `backend/routes/GroupRoutes.js`)
- Chat hub → Socket client context: uses socket (evidence: `src/components/ChatHub.jsx`)
- Chat hub → Chat and connections API: uses chat API
- Socket client context → HTTP and socket server: connects to (evidence: `src/context/SocketContext.jsx`)
- Chat and connections API → JWT guard: protects routes (evidence: `backend/routes/ChatRoutes.js`)
- Chat and connections API → User records: queries users (evidence: `backend/routes/ChatRoutes.js`)
- Chat and connections API → Connection requests: manages requests (evidence: `backend/routes/ChatRoutes.js`)
- Chat and connections API → Conversations: queries conversations (evidence: `backend/routes/ChatRoutes.js`)
- HTTP and socket server → Messages: creates messages (evidence: `backend/server.js`)
- HTTP and socket server → Conversations: reads and updates (evidence: `backend/server.js`)
- HTTP and socket server → Chat hub: delivers live events
- Room discovery → Voice-room API: uses room API
- Video calls → HTTP and socket server: uses realtime calls
- Voice-room API → Voice-room records: reads and writes (evidence: `backend/routes/VcRoutes.js`)
- Voice-room API → JWT guard: protects actions (evidence: `backend/routes/VcRoutes.js`)
- HTTP and socket server → Chat and connections API: mounts routes (evidence: `backend/server.js`)
- HTTP and socket server → Blog API: mounts routes (evidence: `backend/server.js`)
- HTTP and socket server → Groups API: mounts routes (evidence: `backend/server.js`)
- HTTP and socket server → Voice-room API: mounts routes (evidence: `backend/server.js`)
- HTTP and socket server → AI routes: mounts routes (evidence: `backend/server.js`)
