# atharva12105/prep-connect architecture

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

- Interactive diagram: https://gitdiagram.com/atharva12105/prep-connect
- Repository: https://github.com/atharva12105/prep-connect

## Overview

PrepConnect is a role-aware career community for students, alumni, and administrators. The main journey is account access, then role-aware dashboards and pages for profiles, discussions, questions, experiences, directories, and mentorship; administrators also manage users and moderate content. React pages use shared authentication and an Axios client to reach an Express API, whose route handlers enforce access and query PostgreSQL. The README documents capabilities beyond the sampled route excerpts; those are retained under the content API, with uncertain client-to-feature calls marked dashed.

Main entry points: [`backend/src/routes/content.js`](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js) (Content and domain routes), [`frontend/src/App.jsx`](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/App.jsx) (Route shell), [`frontend/src/services/api.js`](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/services/api.js) (API client), [`backend/src/routes/auth.js`](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/auth.js) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route shell<br/>[App.jsx]"]
  node_authpage["Sign in / sign up<br/>[Auth.jsx]"]
  node_authstate["Session state<br/>[AuthContext.jsx]"]
  node_apiclient["API client<br/>[api.js]"]
  node_dashboard["Role dashboards<br/>[Dashboard.jsx]"]
  node_communitypage["Community pages<br/>[Community.jsx]"]
  node_directorypage["Directory pages<br/>[Directory.jsx]"]
  node_profilepage["Profile page<br/>[Profile.jsx]"]
  node_layout["Workspace layout<br/>[Layout.jsx]"]
end

subgraph group_api["API and access"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_contentroutes["Content and domain routes<br/>[content.js]"]
  node_access["JWT and role checks<br/>[auth.js]"]
end

subgraph group_community["Community features"]
  node_discussions["Discussions and replies<br/>[content.js]"]
  node_questions["Questions and answers<br/>[content.js]"]
  node_experiences["Career experiences<br/>[content.js]"]
  node_mentorship["Mentorship requests<br/>[content.js]"]
  node_notifications["Notifications<br/>[content.js]"]
end

subgraph group_operations["Directories and admin"]
  node_profiles["Profiles<br/>[content.js]"]
  node_directories["Alumni and companies<br/>[content.js]"]
  node_admin["Admin management<br/>[content.js]"]
end

subgraph group_data["Persistent data"]
  node_dbaccess["SQL query access<br/>[db.js]"]
  node_postgres[("PostgreSQL<br/>[schema.sql]")]
end

node_visitor(("Student / alumni / admin"))

node_visitor -->|"signs in"| node_authpage
node_authpage -->|"submits credentials"| node_authstate
node_authstate -->|"requests session"| node_apiclient
node_app -->|"routes to"| node_authpage
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_communitypage
node_app -->|"routes to"| node_directorypage
node_app -->|"routes to"| node_profilepage
node_app -->|"renders"| node_layout
node_dashboard -.->|"fetches data"| node_apiclient
node_communitypage -.->|"fetches data"| node_apiclient
node_directorypage -.->|"fetches data"| node_apiclient
node_profilepage -.->|"fetches data"| node_apiclient
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_contentroutes
node_authroutes -->|"authenticates user"| node_access
node_authroutes -->|"queries"| node_dbaccess
node_contentroutes -->|"checks permissions"| node_access
node_contentroutes -->|"queries"| node_dbaccess
node_dbaccess -.->|"reads and writes"| node_postgres
node_contentroutes -.->|"serves"| node_discussions
node_contentroutes -.->|"serves"| node_questions
node_contentroutes -.->|"serves"| node_experiences
node_contentroutes -->|"serves"| node_mentorship
node_contentroutes -->|"creates and reads"| node_notifications
node_contentroutes -->|"serves"| node_profiles
node_contentroutes -->|"serves"| node_directories
node_contentroutes -->|"serves"| node_admin

click node_app "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/App.jsx"
click node_authpage "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Auth.jsx"
click node_authstate "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/context/AuthContext.jsx"
click node_apiclient "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/services/api.js"
click node_dashboard "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Dashboard.jsx"
click node_communitypage "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Community.jsx"
click node_directorypage "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Directory.jsx"
click node_profilepage "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Profile.jsx"
click node_layout "https://github.com/atharva12105/prep-connect/blob/main/frontend/src/components/Layout.jsx"
click node_server "https://github.com/atharva12105/prep-connect/blob/main/backend/src/server.js"
click node_authroutes "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/auth.js"
click node_contentroutes "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_access "https://github.com/atharva12105/prep-connect/blob/main/backend/src/middleware/auth.js"
click node_discussions "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_questions "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_experiences "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_mentorship "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_notifications "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_profiles "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_directories "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_admin "https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js"
click node_dbaccess "https://github.com/atharva12105/prep-connect/blob/main/backend/src/config/db.js"
click node_postgres "https://github.com/atharva12105/prep-connect/blob/main/database/schema.sql"

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_authpage,node_authstate,node_apiclient,node_dashboard,node_communitypage,node_directorypage,node_profilepage,node_layout toneBlue
class node_server,node_authroutes,node_contentroutes,node_access toneAmber
class node_discussions,node_questions,node_experiences,node_mentorship,node_notifications toneMint
class node_profiles,node_directories,node_admin toneRose
class node_dbaccess,node_postgres,node_visitor toneIndigo
```

## Components

### Web client

- [Route shell](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign in / sign up](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Auth.jsx): `frontend/src/pages/Auth.jsx`
- [Session state](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Role dashboards](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Community pages](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Community.jsx): `frontend/src/pages/Community.jsx`
- [Directory pages](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Directory.jsx): `frontend/src/pages/Directory.jsx`
- [Profile page](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [Workspace layout](https://github.com/atharva12105/prep-connect/blob/main/frontend/src/components/Layout.jsx): `frontend/src/components/Layout.jsx`

### API and access

- [Express server](https://github.com/atharva12105/prep-connect/blob/main/backend/src/server.js): `backend/src/server.js`
- [Authentication routes](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Content and domain routes](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`
- [JWT and role checks](https://github.com/atharva12105/prep-connect/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`

### Community features

- [Discussions and replies](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`
- [Questions and answers](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`
- [Career experiences](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`
- [Mentorship requests](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`
- [Notifications](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`

### Directories and admin

- [Profiles](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`
- [Alumni and companies](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`
- [Admin management](https://github.com/atharva12105/prep-connect/blob/main/backend/src/routes/content.js): `backend/src/routes/content.js`

### Persistent data

- [SQL query access](https://github.com/atharva12105/prep-connect/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [PostgreSQL](https://github.com/atharva12105/prep-connect/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Student / alumni / admin**

## Connections

- Student / alumni / admin → Sign in / sign up: signs in (evidence: `frontend/src/pages/Auth.jsx`)
- Sign in / sign up → Session state: submits credentials (evidence: `frontend/src/pages/Auth.jsx`)
- Session state → API client: requests session (evidence: `frontend/src/context/AuthContext.jsx`)
- Route shell → Sign in / sign up: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Role dashboards: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Community pages: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Directory pages: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Profile page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Workspace layout: renders (evidence: `frontend/src/App.jsx`)
- Role dashboards → API client: fetches data (evidence: `frontend/src/pages/Dashboard.jsx`)
- Community pages → API client: fetches data (evidence: `frontend/src/pages/Community.jsx`)
- Directory pages → API client: fetches data (evidence: `frontend/src/pages/Directory.jsx`)
- Profile page → API client: fetches data (evidence: `frontend/src/pages/Profile.jsx`)
- Express server → Authentication routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Content and domain routes: mounts routes (evidence: `backend/src/server.js`)
- Authentication routes → JWT and role checks: authenticates user (evidence: `backend/src/routes/auth.js`)
- Authentication routes → SQL query access: queries (evidence: `backend/src/routes/auth.js`)
- Content and domain routes → JWT and role checks: checks permissions (evidence: `backend/src/routes/content.js`)
- Content and domain routes → SQL query access: queries (evidence: `backend/src/routes/content.js`)
- SQL query access → PostgreSQL: reads and writes
- Content and domain routes → Discussions and replies: serves (evidence: `backend/src/routes/content.js`)
- Content and domain routes → Questions and answers: serves (evidence: `backend/src/routes/content.js`)
- Content and domain routes → Career experiences: serves (evidence: `backend/src/routes/content.js`)
- Content and domain routes → Mentorship requests: serves (evidence: `backend/src/routes/content.js`)
- Content and domain routes → Notifications: creates and reads (evidence: `backend/src/routes/content.js`)
- Content and domain routes → Profiles: serves (evidence: `backend/src/routes/content.js`)
- Content and domain routes → Alumni and companies: serves (evidence: `backend/src/routes/content.js`)
- Content and domain routes → Admin management: serves (evidence: `backend/src/routes/content.js`)
