# p-saiprasanth/alumnisphere architecture

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

- Interactive diagram: https://gitdiagram.com/p-saiprasanth/alumnisphere
- Repository: https://github.com/p-saiprasanth/alumnisphere

## Overview

AlumniSphere is a full-stack alumni networking and mentorship platform. Users register or log in, then discover alumni, exchange mentorship requests, message connections, and find or post opportunities; profiles and dashboard analytics support that work, with an admin view for user management. The React pages use service modules to call Express routes and controllers, which read and update MongoDB models. Socket.io supports real-time chat, though its event wiring is not included in the sampled source. Feature-to-service links beyond sampled files follow documented capabilities and the repository tree.

Main entry points: [`frontend/src/App.jsx`](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/App.jsx) (Routes and access), [`backend/server.js`](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/server.js) (Express and Socket server), [`frontend/src/services/api.js`](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/api.js) (HTTP client), [`backend/controllers/mentorshipController.js`](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/mentorshipController.js) (Mentorship workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Routes and access<br/>[App.jsx]"]
  node_authctx["Session state<br/>[AuthContext.jsx]"]
  node_discovery["Alumni discovery<br/>[DiscoveryPage.jsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_mentorshipui["Mentorship<br/>[MentorshipPage.jsx]"]
  node_messagesui["Messaging<br/>[MessagesPage.jsx]"]
  node_oppsui["Opportunities"]
  node_profileui["Profiles<br/>[ProfilePage.jsx]"]
  node_adminui["Admin panel<br/>[AdminPage.jsx]"]
  node_socketctx["Live connection<br/>[SocketContext.jsx]"]
  node_api["HTTP client<br/>[api.js]"]
  node_usersvc["User service<br/>[userService.js]"]
  node_mentorsvc["Mentorship service"]
  node_messagesvc["Message service<br/>[messageService.js]"]
  node_oppsvc["Opportunity service"]
  node_notifsvc["Notification service"]
end

subgraph group_backend["API and domain"]
  node_server["Express and Socket server<br/>[server.js]"]
  node_authctrl["Authentication<br/>[authController.js]"]
  node_userctrl["Discovery and analytics<br/>[userController.js]"]
  node_mentorctrl["Mentorship workflow"]
  node_messagectrl["Chat workflow"]
  node_oppctrl["Opportunity workflow"]
  node_authmw["JWT protection<br/>[auth.js]"]
  node_socket["Socket event handling<br/>[socket.js]"]
end

subgraph group_state["Persistent and live state"]
  node_mongo[("MongoDB<br/>[db.js]")]
  node_users[("User records<br/>[User.js]")]
  node_mentorships[("Mentorship records")]
  node_messages[("Message records<br/>[Message.js]")]
  node_opportunities[("Opportunity records<br/>[Opportunity.js]")]
  node_notifications[("Notification records<br/>[Notification.js]")]
end

node_visitor(("Student / alumni"))

node_visitor -->|"uses"| node_app
node_app -->|"provides session"| node_authctx
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_mentorshipui
node_app -->|"routes to"| node_messagesui
node_app -->|"routes to"| node_oppsui
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_adminui
node_authctx -->|"calls auth endpoints"| node_api
node_discovery -->|"requests people"| node_usersvc
node_dashboard -->|"requests stats"| node_usersvc
node_profileui -->|"requests profiles"| node_usersvc
node_mentorshipui -->|"requests mentorship"| node_mentorsvc
node_messagesui -->|"requests messages"| node_messagesvc
node_oppsui -->|"requests listings"| node_oppsvc
node_messagesui -.->|"uses live chat"| node_socketctx
node_usersvc -->|"calls"| node_api
node_mentorsvc -->|"calls"| node_api
node_messagesvc -->|"calls"| node_api
node_oppsvc -->|"calls"| node_api
node_notifsvc -->|"calls"| node_api
node_api -->|"HTTP requests"| node_server
node_server -->|"protects routes"| node_authmw
node_server -->|"dispatches auth"| node_authctrl
node_server -->|"dispatches users"| node_userctrl
node_server -->|"dispatches mentorship"| node_mentorctrl
node_server -->|"dispatches messages"| node_messagectrl
node_server -->|"dispatches opportunities"| node_oppctrl
node_server -->|"initializes"| node_socket
node_socketctx -.->|"Socket.IO events"| node_socket
node_server -->|"connects"| node_mongo
node_authctrl -->|"reads and writes"| node_users
node_userctrl -->|"queries and updates"| node_users
node_userctrl -->|"queries"| node_mentorships
node_mentorctrl -->|"reads and updates"| node_mentorships
node_mentorctrl -->|"looks up and connects"| node_users
node_mentorctrl -->|"creates"| node_notifications
node_messagectrl -->|"reads and writes"| node_messages
node_messagectrl -->|"looks up partners"| node_users
node_oppctrl -->|"reads and updates"| node_opportunities
node_oppctrl -->|"creates"| node_notifications

click node_app "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/context/AuthContext.jsx"
click node_discovery "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/DiscoveryPage.jsx"
click node_dashboard "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_mentorshipui "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/MentorshipPage.jsx"
click node_messagesui "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/MessagesPage.jsx"
click node_oppsui "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/OpportunitiesPage.jsx"
click node_profileui "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/ProfilePage.jsx"
click node_adminui "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/AdminPage.jsx"
click node_socketctx "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/context/SocketContext.jsx"
click node_api "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/api.js"
click node_usersvc "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/userService.js"
click node_mentorsvc "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/mentorshipService.js"
click node_messagesvc "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/messageService.js"
click node_oppsvc "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/opportunityService.js"
click node_notifsvc "https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/notificationService.js"
click node_server "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/server.js"
click node_authctrl "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/authController.js"
click node_userctrl "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/userController.js"
click node_mentorctrl "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/mentorshipController.js"
click node_messagectrl "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/messageController.js"
click node_oppctrl "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/opportunityController.js"
click node_authmw "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/middleware/auth.js"
click node_socket "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/socket.js"
click node_mongo "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/config/db.js"
click node_users "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/User.js"
click node_mentorships "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/MentorshipRequest.js"
click node_messages "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/Message.js"
click node_opportunities "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/Opportunity.js"
click node_notifications "https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/Notification.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_authctx,node_discovery,node_dashboard,node_mentorshipui,node_messagesui,node_oppsui,node_profileui,node_adminui,node_socketctx,node_api,node_usersvc,node_mentorsvc,node_messagesvc,node_oppsvc,node_notifsvc toneBlue
class node_server,node_authctrl,node_userctrl,node_mentorctrl,node_messagectrl,node_oppctrl,node_authmw,node_socket toneAmber
class node_mongo,node_users,node_mentorships,node_messages,node_opportunities,node_notifications toneMint
class node_visitor toneIndigo
```

## Components

### Web application

- [Routes and access](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session state](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Alumni discovery](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/DiscoveryPage.jsx): `frontend/src/pages/DiscoveryPage.jsx`
- [Dashboard](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Mentorship](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/MentorshipPage.jsx): `frontend/src/pages/MentorshipPage.jsx`
- [Messaging](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/MessagesPage.jsx): `frontend/src/pages/MessagesPage.jsx`
- [Opportunities](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/OpportunitiesPage.jsx): `frontend/src/pages/OpportunitiesPage.jsx`
- [Profiles](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/ProfilePage.jsx): `frontend/src/pages/ProfilePage.jsx`
- [Admin panel](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/pages/AdminPage.jsx): `frontend/src/pages/AdminPage.jsx`
- [Live connection](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/context/SocketContext.jsx): `frontend/src/context/SocketContext.jsx`
- [HTTP client](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [User service](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/userService.js): `frontend/src/services/userService.js`
- [Mentorship service](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/mentorshipService.js): `frontend/src/services/mentorshipService.js`
- [Message service](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/messageService.js): `frontend/src/services/messageService.js`
- [Opportunity service](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/opportunityService.js): `frontend/src/services/opportunityService.js`
- [Notification service](https://github.com/p-saiprasanth/alumnisphere/blob/main/frontend/src/services/notificationService.js): `frontend/src/services/notificationService.js`

### API and domain

- [Express and Socket server](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Discovery and analytics](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Mentorship workflow](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/mentorshipController.js): `backend/controllers/mentorshipController.js`
- [Chat workflow](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/messageController.js): `backend/controllers/messageController.js`
- [Opportunity workflow](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/controllers/opportunityController.js): `backend/controllers/opportunityController.js`
- [JWT protection](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Socket event handling](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/socket.js): `backend/socket.js`

### Persistent and live state

- [MongoDB](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/config/db.js): `backend/config/db.js`
- [User records](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/User.js): `backend/models/User.js`
- [Mentorship records](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/MentorshipRequest.js): `backend/models/MentorshipRequest.js`
- [Message records](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/Message.js): `backend/models/Message.js`
- [Opportunity records](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/Opportunity.js): `backend/models/Opportunity.js`
- [Notification records](https://github.com/p-saiprasanth/alumnisphere/blob/main/backend/models/Notification.js): `backend/models/Notification.js`

### Other components

- **Student / alumni**

## Connections

- Student / alumni → Routes and access: uses
- Routes and access → Session state: provides session
- Routes and access → Alumni discovery: routes to
- Routes and access → Dashboard: routes to
- Routes and access → Mentorship: routes to
- Routes and access → Messaging: routes to
- Routes and access → Opportunities: routes to
- Routes and access → Profiles: routes to
- Routes and access → Admin panel: routes to
- Session state → HTTP client: calls auth endpoints
- Alumni discovery → User service: requests people
- Dashboard → User service: requests stats
- Profiles → User service: requests profiles
- Mentorship → Mentorship service: requests mentorship
- Messaging → Message service: requests messages
- Opportunities → Opportunity service: requests listings
- Messaging → Live connection: uses live chat
- User service → HTTP client: calls
- Mentorship service → HTTP client: calls
- Message service → HTTP client: calls
- Opportunity service → HTTP client: calls
- Notification service → HTTP client: calls
- HTTP client → Express and Socket server: HTTP requests
- Express and Socket server → JWT protection: protects routes
- Express and Socket server → Authentication: dispatches auth
- Express and Socket server → Discovery and analytics: dispatches users
- Express and Socket server → Mentorship workflow: dispatches mentorship
- Express and Socket server → Chat workflow: dispatches messages
- Express and Socket server → Opportunity workflow: dispatches opportunities
- Express and Socket server → Socket event handling: initializes
- Live connection → Socket event handling: Socket.IO events
- Express and Socket server → MongoDB: connects
- Authentication → User records: reads and writes
- Discovery and analytics → User records: queries and updates
- Discovery and analytics → Mentorship records: queries
- Mentorship workflow → Mentorship records: reads and updates
- Mentorship workflow → User records: looks up and connects
- Mentorship workflow → Notification records: creates
- Chat workflow → Message records: reads and writes
- Chat workflow → User records: looks up partners
- Opportunity workflow → Opportunity records: reads and updates
- Opportunity workflow → Notification records: creates
