# anshika4137/projecthub architecture

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

- Interactive diagram: https://gitdiagram.com/anshika4137/projecthub
- Repository: https://github.com/anshika4137/projecthub

## Overview

ProjectHub is a team project-management application. A user registers or logs in, creates or joins a project, then manages members and tasks on a Kanban board, including assignment, due dates, and comments. The client uses REST for persistent operations and Socket.IO for task refreshes and notifications. The backend’s access checks and notification service are the internal layer connecting authorized requests and events to stored domain data. Some client and server modules were not excerpted; their placement and links below rely only on README statements or SOURCE INDEX references.

Main entry points: [`server/server.js`](https://github.com/anshika4137/projecthub/blob/main/server/server.js) (Express API), [`client/src/App.jsx`](https://github.com/anshika4137/projecthub/blob/main/client/src/App.jsx) (App routing), [`server/routes/projects.js`](https://github.com/anshika4137/projecthub/blob/main/server/routes/projects.js) (Project routes), [`server/routes/tasks.js`](https://github.com/anshika4137/projecthub/blob/main/server/routes/tasks.js) (Task and comment routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["App routing<br/>[App.jsx]"]
  node_authui["Login and register<br/>[Register.jsx]"]
  node_authstate["Auth context<br/>[AuthContext.jsx]"]
  node_authhook["Auth hook<br/>[useAuth.js]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_dashboard["Project dashboard<br/>[Dashboard.jsx]"]
  node_board["Kanban and tasks<br/>[Board.jsx]"]
  node_comments["Task comments<br/>[CommentSection.jsx]"]
  node_navbar["Navigation and alerts<br/>[Navbar.jsx]"]
  node_brand["ProjectHub branding"]
  node_apiurl["REST configuration<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_api["Express API<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_projectroutes["Project routes<br/>[projects.js]"]
  node_taskroutes["Task and comment routes<br/>[tasks.js]"]
  node_authmw["JWT middleware<br/>[auth.js]"]
  node_access["Membership access<br/>[access.js]"]
end

subgraph group_domain["Project data"]
  node_userdoc["User model<br/>[User.js]"]
  node_projectdoc["Project model<br/>[Project.js]"]
  node_taskdoc["Task model<br/>[Task.js]"]
  node_notificationdoc["Notification model<br/>[Notification.js]"]
  node_mongodb[("MongoDB")]
end

subgraph group_realtime["Realtime notifications"]
  node_socketclient["Socket client<br/>[socket.js]"]
  node_notificationroutes["Notification routes<br/>[notifications.js]"]
  node_socketserver["Socket.IO server<br/>[server.js]"]
  node_notificationservice["Notification service<br/>[notifications.js]"]
end

node_user(("Team member"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_board
node_authui -->|"requests via"| node_apiurl
node_dashboard -->|"requests via"| node_apiurl
node_board -->|"requests via"| node_apiurl
node_board -->|"renders"| node_comments
node_board -->|"emits events"| node_socketclient
node_navbar -->|"connects and listens"| node_socketclient
node_navbar -->|"loads alerts"| node_apiurl
node_navbar -->|"renders"| node_brand
node_app -->|"provides"| node_authstate
node_authstate -->|"exports context"| node_authhook
node_apiurl -->|"targets REST API"| node_api
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_projectroutes
node_api -->|"mounts"| node_taskroutes
node_api -->|"mounts"| node_notificationroutes
node_authroutes -->|"uses"| node_authmw
node_projectroutes -->|"uses"| node_authmw
node_taskroutes -->|"uses"| node_authmw
node_notificationroutes -->|"uses"| node_authmw
node_authroutes -->|"reads and writes"| node_userdoc
node_projectroutes -->|"reads and writes"| node_projectdoc
node_projectroutes -->|"uses"| node_taskdoc
node_projectroutes -->|"uses"| node_userdoc
node_taskroutes -->|"reads and writes"| node_taskdoc
node_taskroutes -->|"checks assignees"| node_userdoc
node_notificationroutes -->|"reads and writes"| node_notificationdoc
node_projectroutes -->|"checks membership"| node_access
node_taskroutes -->|"checks membership"| node_access
node_access -->|"loads projects"| node_projectdoc
node_access -->|"loads tasks"| node_taskdoc
node_api -->|"connects"| node_mongodb
node_socketclient -->|"connects to"| node_socketserver
node_api -->|"creates"| node_socketserver
node_api -->|"configures"| node_notificationservice
node_taskroutes -->|"creates comment alerts"| node_notificationservice
node_socketserver -->|"checks project rooms"| node_projectdoc
node_socketserver -->|"creates task alerts"| node_notificationservice
node_notificationservice -->|"stores alerts"| node_notificationdoc
node_notificationservice -->|"emits alerts"| node_socketserver
node_socketserver -->|"sends realtime events"| node_socketclient

click node_app "https://github.com/anshika4137/projecthub/blob/main/client/src/App.jsx"
click node_authui "https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Register.jsx"
click node_authstate "https://github.com/anshika4137/projecthub/blob/main/client/src/context/AuthContext.jsx"
click node_authhook "https://github.com/anshika4137/projecthub/blob/main/client/src/context/useAuth.js"
click node_landing "https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Landing.jsx"
click node_dashboard "https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Dashboard.jsx"
click node_board "https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Board.jsx"
click node_comments "https://github.com/anshika4137/projecthub/blob/main/client/src/components/CommentSection.jsx"
click node_navbar "https://github.com/anshika4137/projecthub/blob/main/client/src/components/Navbar.jsx"
click node_brand "https://github.com/anshika4137/projecthub/blob/main/client/src/components/ProjectHubBrand.jsx"
click node_apiurl "https://github.com/anshika4137/projecthub/blob/main/client/src/config/api.js"
click node_socketclient "https://github.com/anshika4137/projecthub/blob/main/client/src/config/socket.js"
click node_api "https://github.com/anshika4137/projecthub/blob/main/server/server.js"
click node_authroutes "https://github.com/anshika4137/projecthub/blob/main/server/routes/auth.js"
click node_projectroutes "https://github.com/anshika4137/projecthub/blob/main/server/routes/projects.js"
click node_taskroutes "https://github.com/anshika4137/projecthub/blob/main/server/routes/tasks.js"
click node_notificationroutes "https://github.com/anshika4137/projecthub/blob/main/server/routes/notifications.js"
click node_authmw "https://github.com/anshika4137/projecthub/blob/main/server/middleware/auth.js"
click node_access "https://github.com/anshika4137/projecthub/blob/main/server/utils/access.js"
click node_userdoc "https://github.com/anshika4137/projecthub/blob/main/server/models/User.js"
click node_projectdoc "https://github.com/anshika4137/projecthub/blob/main/server/models/Project.js"
click node_taskdoc "https://github.com/anshika4137/projecthub/blob/main/server/models/Task.js"
click node_notificationdoc "https://github.com/anshika4137/projecthub/blob/main/server/models/Notification.js"
click node_socketserver "https://github.com/anshika4137/projecthub/blob/main/server/server.js"
click node_notificationservice "https://github.com/anshika4137/projecthub/blob/main/server/services/notifications.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_authui,node_authstate,node_authhook,node_landing,node_dashboard,node_board,node_comments,node_navbar,node_brand,node_apiurl toneBlue
class node_api,node_authroutes,node_projectroutes,node_taskroutes,node_authmw,node_access toneAmber
class node_userdoc,node_projectdoc,node_taskdoc,node_notificationdoc,node_mongodb toneMint
class node_socketclient,node_notificationroutes,node_socketserver,node_notificationservice toneRose
class node_user toneIndigo
```

## Components

### Client experience

- [App routing](https://github.com/anshika4137/projecthub/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Login and register](https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Register.jsx): `client/src/pages/Register.jsx`
- [Auth context](https://github.com/anshika4137/projecthub/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Auth hook](https://github.com/anshika4137/projecthub/blob/main/client/src/context/useAuth.js): `client/src/context/useAuth.js`
- [Landing page](https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Landing.jsx): `client/src/pages/Landing.jsx`
- [Project dashboard](https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Kanban and tasks](https://github.com/anshika4137/projecthub/blob/main/client/src/pages/Board.jsx): `client/src/pages/Board.jsx`
- [Task comments](https://github.com/anshika4137/projecthub/blob/main/client/src/components/CommentSection.jsx): `client/src/components/CommentSection.jsx`
- [Navigation and alerts](https://github.com/anshika4137/projecthub/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`
- [ProjectHub branding](https://github.com/anshika4137/projecthub/blob/main/client/src/components/ProjectHubBrand.jsx): `client/src/components/ProjectHubBrand.jsx`
- [REST configuration](https://github.com/anshika4137/projecthub/blob/main/client/src/config/api.js): `client/src/config/api.js`

### API and access

- [Express API](https://github.com/anshika4137/projecthub/blob/main/server/server.js): `server/server.js`
- [Authentication routes](https://github.com/anshika4137/projecthub/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [Project routes](https://github.com/anshika4137/projecthub/blob/main/server/routes/projects.js): `server/routes/projects.js`
- [Task and comment routes](https://github.com/anshika4137/projecthub/blob/main/server/routes/tasks.js): `server/routes/tasks.js`
- [JWT middleware](https://github.com/anshika4137/projecthub/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Membership access](https://github.com/anshika4137/projecthub/blob/main/server/utils/access.js): `server/utils/access.js`

### Project data

- [User model](https://github.com/anshika4137/projecthub/blob/main/server/models/User.js): `server/models/User.js`
- [Project model](https://github.com/anshika4137/projecthub/blob/main/server/models/Project.js): `server/models/Project.js`
- [Task model](https://github.com/anshika4137/projecthub/blob/main/server/models/Task.js): `server/models/Task.js`
- [Notification model](https://github.com/anshika4137/projecthub/blob/main/server/models/Notification.js): `server/models/Notification.js`
- **MongoDB**

### Realtime notifications

- [Socket client](https://github.com/anshika4137/projecthub/blob/main/client/src/config/socket.js): `client/src/config/socket.js`
- [Notification routes](https://github.com/anshika4137/projecthub/blob/main/server/routes/notifications.js): `server/routes/notifications.js`
- [Socket.IO server](https://github.com/anshika4137/projecthub/blob/main/server/server.js): `server/server.js`
- [Notification service](https://github.com/anshika4137/projecthub/blob/main/server/services/notifications.js): `server/services/notifications.js`

### Other components

- **Team member**

## Connections

- Team member → App routing: uses (evidence: `README.md`)
- App routing → Login and register: routes to (evidence: `client/src/App.jsx`)
- App routing → Landing page: routes to (evidence: `client/src/App.jsx`)
- App routing → Project dashboard: routes to (evidence: `client/src/App.jsx`)
- App routing → Kanban and tasks: routes to (evidence: `client/src/App.jsx`)
- Login and register → REST configuration: requests via (evidence: `client/src/pages/Register.jsx`)
- Project dashboard → REST configuration: requests via (evidence: `client/src/pages/Dashboard.jsx`)
- Kanban and tasks → REST configuration: requests via (evidence: `client/src/pages/Board.jsx`)
- Kanban and tasks → Task comments: renders (evidence: `client/src/pages/Board.jsx`)
- Kanban and tasks → Socket client: emits events (evidence: `client/src/pages/Board.jsx`)
- Navigation and alerts → Socket client: connects and listens (evidence: `client/src/components/Navbar.jsx`)
- Navigation and alerts → REST configuration: loads alerts (evidence: `client/src/components/Navbar.jsx`)
- Navigation and alerts → ProjectHub branding: renders (evidence: `client/src/components/Navbar.jsx`)
- App routing → Auth context: provides (evidence: `client/src/App.jsx`)
- Auth context → Auth hook: exports context (evidence: `client/src/context/AuthContext.jsx`)
- REST configuration → Express API: targets REST API (evidence: `README.md`)
- Express API → Authentication routes: mounts (evidence: `server/server.js`)
- Express API → Project routes: mounts (evidence: `server/server.js`)
- Express API → Task and comment routes: mounts (evidence: `server/server.js`)
- Express API → Notification routes: mounts (evidence: `server/server.js`)
- Authentication routes → JWT middleware: uses (evidence: `server/routes/auth.js`)
- Project routes → JWT middleware: uses (evidence: `server/routes/projects.js`)
- Task and comment routes → JWT middleware: uses (evidence: `server/routes/tasks.js`)
- Notification routes → JWT middleware: uses (evidence: `server/routes/notifications.js`)
- Authentication routes → User model: reads and writes (evidence: `server/routes/auth.js`)
- Project routes → Project model: reads and writes (evidence: `server/routes/projects.js`)
- Project routes → Task model: uses (evidence: `server/routes/projects.js`)
- Project routes → User model: uses (evidence: `server/routes/projects.js`)
- Task and comment routes → Task model: reads and writes (evidence: `server/routes/tasks.js`)
- Task and comment routes → User model: checks assignees (evidence: `server/routes/tasks.js`)
- Notification routes → Notification model: reads and writes (evidence: `server/routes/notifications.js`)
- Project routes → Membership access: checks membership (evidence: `server/routes/projects.js`)
- Task and comment routes → Membership access: checks membership (evidence: `server/routes/tasks.js`)
- Membership access → Project model: loads projects (evidence: `server/utils/access.js`)
- Membership access → Task model: loads tasks (evidence: `server/utils/access.js`)
- Express API → MongoDB: connects (evidence: `server/server.js`)
- Socket client → Socket.IO server: connects to (evidence: `README.md`)
- Express API → Socket.IO server: creates (evidence: `server/server.js`)
- Express API → Notification service: configures (evidence: `server/server.js`)
- Task and comment routes → Notification service: creates comment alerts (evidence: `server/routes/tasks.js`)
- Socket.IO server → Project model: checks project rooms (evidence: `server/server.js`)
- Socket.IO server → Notification service: creates task alerts (evidence: `server/server.js`)
- Notification service → Notification model: stores alerts (evidence: `server/services/notifications.js`)
- Notification service → Socket.IO server: emits alerts (evidence: `server/services/notifications.js`)
- Socket.IO server → Socket client: sends realtime events (evidence: `README.md`)
