# poojabk-18/alumni_connect architecture

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

- Interactive diagram: https://gitdiagram.com/poojabk-18/alumni_connect
- Repository: https://github.com/poojabk-18/alumni_connect

## Overview

1. **Top-level shape**
   - The repo is split into two independent applications: `frontend/` and `backend/`.
   - This is a classic client/server separation: a React UI talks to a Node.js/Express API, and the API persists application data in MongoDB.

2. **Frontend boundary**
   - The frontend is a Vite-powered React app.
   - Its job is presentation, routing, and auth state management; it does not own persistence.
   - Main entry points are `frontend/src/main.jsx` and `frontend/src/App.jsx`.

3. **Frontend screen-level structure**
   - The app is organized into pages for the main user journeys: `Home`, `About`, `Alumni`, `AlumniDetail`, `FeedPage`, `CreatePost`, `Dashboard`, and `Profile`.
   - Authentication UI lives under `src/assets/components/` with `Login`, `Signup`, and `LogoutButton`.
   - This suggests a route-driven SPA where pages map to distinct user workflows: browse alumni, view details, create posts, and manage profile/dashboard.

4. **Frontend auth and access control**
   - `AuthContext.jsx` and `hooks/UseAuth.js` hold client-side authentication state.
   - `ProtectedRoute.jsx` enforces route-level access for authenticated sections.
   - In architecture terms, this is the boundary between public pages and private user features.

5. **Backend bootstrap and API layer**
   - The backend starts from `backend/server.js` and `backend/src/app.js`.
   - Express is the main HTTP server, with route modules mounted by concern rather than a single monolithic controller.
   - The API surface is split into three areas: auth, alumni profiles, and alumni posts.

6. **Backend domain segmentation**
   - `src/routes/` contains the HTTP endpoints.
   - `src/controllers/` contains request handling and business logic.
   - `src/models/` and `src/Models/` contain persistence models; the duplicate casing suggests a repo cleanup issue or an older/newer model layout.
   - The visible domains are:
     - authentication
     - alumni profile management
     - alumni posts/feed

7. **Data persistence**
   - `src/db/db.js` is the database connection layer.
   - The README states MongoDB is the current database, so the backend likely uses a MongoDB client/ODM behind the model layer.
   - The model/controller split indicates that API handlers do not talk to the database directly; they go through model abstractions.

8. **Media and external service integration**
   - `src/services/image_kit.service.js` is the only explicit third-party service integration in the tree.
   - That implies image upload or asset hosting is delegated outside the API server, which is important for diagramming because media storage is not purely local.
   - This service sits beside the core API, not inside the model layer.

9. **Core request flow**
   - A typical request flow is: React page/component → API request → Express route → controller → model/db → response back to the UI.
   - For authenticated routes, the frontend auth context and protected routes gate access before the request is even made.
   - For content workflows like posts or profiles, the backend is the source of truth and the frontend is just a consumer.

10. **Functional subsystems**
   - The repository currently implements the core alumni-networking primitives from the README:
     - user authentication
     - alumni profile management
     - alumni posts/feed
   - The broader SaaS/admin concepts described in the README are mostly product scope; they are not yet represented as separate backend modules in the tree.

11. **Operational split**
   - `frontend/package.json` and `backend/package.json` mean the two halves can be developed and deployed independently.
   - The frontend can be hosted as static assets, while the backend is a long-running API service.
   - The architecture therefore has a clear browser/UI boundary, an API boundary, and a persistence boundary.

12. **What to draw in an architecture diagram**
   - Draw four main boxes: Browser/React UI, Express API, MongoDB, and ImageKit.
   - Inside the UI box, show public pages plus authenticated pages guarded by auth context/protected routes.
   - Inside the API box, show three logical domains: auth, profiles, posts, with controllers sitting between routes and models.

Main entry points: [`frontend/src/App.jsx`](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/App.jsx) (App shell), [`backend/src/app.js`](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/app.js) (Express app), [`backend/src/controllers/alumni_profile.controller.js`](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/alumni_profile.controller.js) (Profile controller), [`backend/src/controllers/alumni_posts.controller.js`](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/alumni_posts.controller.js) (Post controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_browser["Browser UI<br/>client app<br/>[main.jsx]"]
  node_app["App shell<br/>react shell<br/>[App.jsx]"]
  node_public_pages["Public pages<br/>routes/pages<br/>[Home.jsx]"]
  node_private_pages["Private pages<br/>routes/pages<br/>[FeedPage.jsx]"]
  node_auth_ui["Auth UI<br/>auth components<br/>[Login.jsx]"]
  node_auth_state(("Auth state<br/>context/hook<br/>[AuthContext.jsx]"))
  node_protected_route{{"Guarded route<br/>route guard<br/>[ProtectedRoute.jsx]"}}
end

subgraph group_backend["Backend"]
  node_server["Server entry<br/>node bootstrap<br/>[server.js]"]
  node_express_app["Express app<br/>http app<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>api routes<br/>[auth_Routes.js]"]
  node_profile_routes["Profile routes<br/>api routes"]
  node_post_routes["Post routes<br/>api routes"]
  node_auth_controller["Auth controller<br/>request handler<br/>[authcontroller.js]"]
  node_profile_controller["Profile controller<br/>request handler"]
  node_post_controller["Post controller<br/>request handler"]
  node_auth_model[("Auth model<br/>persistence model<br/>[auth_model.js]")]
  node_profile_model[("Profile model<br/>persistence model")]
  node_post_model[("Post model<br/>persistence model")]
end

subgraph group_external["External services"]
  node_db[("MongoDB<br/>database layer<br/>[db.js]")]
  node_imagekit{{"ImageKit<br/>external service"}}
end

node_browser -->|"loads"| node_app
node_app -->|"routes to"| node_public_pages
node_app -->|"routes to"| node_private_pages
node_app -->|"uses"| node_auth_ui
node_app -->|"tracks"| node_auth_state
node_private_pages -->|"gated by"| node_protected_route
node_protected_route -->|"checks"| node_auth_state
node_browser -->|"api calls"| node_express_app
node_server -->|"starts"| node_express_app
node_express_app -->|"mounts"| node_auth_routes
node_express_app -->|"mounts"| node_profile_routes
node_express_app -->|"mounts"| node_post_routes
node_auth_routes -->|"delegates"| node_auth_controller
node_profile_routes -->|"delegates"| node_profile_controller
node_post_routes -->|"delegates"| node_post_controller
node_auth_controller -->|"uses"| node_auth_model
node_profile_controller -->|"uses"| node_profile_model
node_post_controller -->|"uses"| node_post_model
node_auth_model -->|"persists via"| node_db
node_profile_model -->|"persists via"| node_db
node_post_model -->|"persists via"| node_db
node_profile_controller -->|"uploads media"| node_imagekit
node_post_controller -->|"uploads media"| node_imagekit

click node_browser "https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/App.jsx"
click node_public_pages "https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/Home.jsx"
click node_private_pages "https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/FeedPage.jsx"
click node_auth_ui "https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/assets/components/Login.jsx"
click node_auth_state "https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/AuthContext.jsx"
click node_protected_route "https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/ProtectedRoute.jsx"
click node_server "https://github.com/poojabk-18/alumni_connect/blob/main/backend/server.js"
click node_express_app "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/app.js"
click node_auth_routes "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/routes/auth_Routes.js"
click node_profile_routes "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/routes/alumni_profile.route.js"
click node_post_routes "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/routes/alumni_posts.route.js"
click node_auth_controller "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/authcontroller.js"
click node_profile_controller "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/alumni_profile.controller.js"
click node_post_controller "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/alumni_posts.controller.js"
click node_auth_model "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/Models/auth_model.js"
click node_profile_model "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/models/alumni_profile.model.js"
click node_post_model "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/Models/alumni_posts.model.js"
click node_db "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/db/db.js"
click node_imagekit "https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/services/image_kit.service.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_browser,node_app,node_public_pages,node_private_pages,node_auth_ui,node_auth_state,node_protected_route toneBlue
class node_server,node_express_app,node_auth_routes,node_profile_routes,node_post_routes,node_auth_controller,node_profile_controller,node_post_controller,node_auth_model,node_profile_model,node_post_model toneAmber
class node_db,node_imagekit toneMint
```

## Components

### Frontend

React SPA for browsing alumni content and managing authenticated user flows.

- [Browser UI](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/main.jsx): client app · User-facing React application. · `frontend/src/main.jsx`
- [App shell](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/App.jsx): react shell · Top-level app composition and routing. · `frontend/src/App.jsx`
- [Public pages](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/Home.jsx): routes/pages · Home, About, Alumni, and alumni detail views. · `frontend/src/Home.jsx`
- [Private pages](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/FeedPage.jsx): routes/pages · Feed, create post, dashboard, and profile views. · `frontend/src/FeedPage.jsx`
- [Auth UI](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/assets/components/Login.jsx): auth components · Login, signup, and logout controls. · `frontend/src/assets/components/Login.jsx`
- [Auth state](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/AuthContext.jsx): context/hook · Client-side authentication state and access helpers. · `frontend/src/AuthContext.jsx`
- [Guarded route](https://github.com/poojabk-18/alumni_connect/blob/main/frontend/src/ProtectedRoute.jsx): route guard · Blocks private sections until authenticated. · `frontend/src/ProtectedRoute.jsx`

### Backend

Express API with routes, controllers, models, and database access.

- [Server entry](https://github.com/poojabk-18/alumni_connect/blob/main/backend/server.js): node bootstrap · Backend process entrypoint. · `backend/server.js`
- [Express app](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/app.js): http app · HTTP application wiring and middleware. · `backend/src/app.js`
- [Auth routes](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/routes/auth_Routes.js): api routes · Authentication endpoints. · `backend/src/routes/auth_Routes.js`
- [Profile routes](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/routes/alumni_profile.route.js): api routes · Alumni profile endpoints. · `backend/src/routes/alumni_profile.route.js`
- [Post routes](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/routes/alumni_posts.route.js): api routes · Alumni post and feed endpoints. · `backend/src/routes/alumni_posts.route.js`
- [Auth controller](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/authcontroller.js): request handler · Authentication logic and request handling. · `backend/src/controllers/authcontroller.js`
- [Profile controller](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/alumni_profile.controller.js): request handler · Alumni profile business logic. · `backend/src/controllers/alumni_profile.controller.js`
- [Post controller](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/controllers/alumni_posts.controller.js): request handler · Feed and post business logic. · `backend/src/controllers/alumni_posts.controller.js`
- [Auth model](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/Models/auth_model.js): persistence model · Authentication-related data model. · `backend/src/Models/auth_model.js`
- [Profile model](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/models/alumni_profile.model.js): persistence model · Alumni profile data model. · `backend/src/models/alumni_profile.model.js`
- [Post model](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/Models/alumni_posts.model.js): persistence model · Alumni post data model. · `backend/src/Models/alumni_posts.model.js`

### External services

Infrastructure and third-party dependencies used by the application.

- [MongoDB](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/db/db.js): database layer · Database connection and persistence boundary. · `backend/src/db/db.js`
- [ImageKit](https://github.com/poojabk-18/alumni_connect/blob/main/backend/src/services/image_kit.service.js): external service · External media upload or asset hosting integration. · `backend/src/services/image_kit.service.js`

## Connections

- Browser UI → App shell: loads · React boots the app shell.
- App shell → Public pages: routes to · Public journeys are rendered through route pages.
- App shell → Private pages: routes to · Authenticated journeys are rendered through route pages.
- App shell → Auth UI: uses · App shell includes auth controls.
- App shell → Auth state: tracks · App shell reads client auth state.
- Private pages → Guarded route: gated by · Private pages are protected at the route boundary.
- Guarded route → Auth state: checks · Guard evaluates local authentication state.
- Browser UI → Express app: api calls · UI talks to backend API endpoints.
- Server entry → Express app: starts · Node entrypoint initializes the Express app.
- Express app → Auth routes: mounts · Express mounts auth endpoints.
- Express app → Profile routes: mounts · Express mounts profile endpoints.
- Express app → Post routes: mounts · Express mounts post endpoints.
- Auth routes → Auth controller: delegates · Auth routes hand off to controller logic.
- Profile routes → Profile controller: delegates · Profile routes hand off to controller logic.
- Post routes → Post controller: delegates · Post routes hand off to controller logic.
- Auth controller → Auth model: uses · Auth logic accesses auth persistence model.
- Profile controller → Profile model: uses · Profile logic accesses profile persistence model.
- Post controller → Post model: uses · Post logic accesses post persistence model.
- Auth model → MongoDB: persists via · Auth data is stored through the database layer.
- Profile model → MongoDB: persists via · Profile data is stored through the database layer.
- Post model → MongoDB: persists via · Post data is stored through the database layer.
- Profile controller → ImageKit: uploads media · Profile flows can integrate with external image hosting.
- Post controller → ImageKit: uploads media · Post flows can integrate with external image hosting.
