# gurram-rohith/devhub architecture

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

- Interactive diagram: https://gitdiagram.com/gurram-rohith/devhub
- Repository: https://github.com/gurram-rohith/devhub

## Overview

This is a workspace collaboration application: users authenticate, create or join workspaces, then coordinate assigned tasks and workspace events. The browser provides protected workspace views and task, event, and member tabs; its API modules communicate with an Express service that applies authentication and workspace permissions before controllers update or query MongoDB models. The tree also identifies workspace statistics, though their detailed behavior and wiring were not sampled. Edges for the sampled task and event flows follow their routes and controller model operations; unsampled UI and statistics details are represented cautiously.

Main entry points: [`server/src/app.js`](https://github.com/gurram-rohith/devhub/blob/main/server/src/app.js) (Express app), [`client/src/App.jsx`](https://github.com/gurram-rohith/devhub/blob/main/client/src/App.jsx) (App routing), [`client/src/api/axios.js`](https://github.com/gurram-rohith/devhub/blob/main/client/src/api/axios.js) (HTTP client), [`server/src/models/Workspace.js`](https://github.com/gurram-rohith/devhub/blob/main/server/src/models/Workspace.js) (Workspace records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser application"]
  node_appui["App routing<br/>[App.jsx]"]
  node_authui["Auth context<br/>[AuthContext.jsx]"]
  node_protected["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_login["Login and register<br/>[Login.jsx]"]
  node_workspacesui["Workspace list<br/>[Workspaces.jsx]"]
  node_detailui["Workspace detail"]
  node_taskui["Task tab<br/>[TasksTab.jsx]"]
  node_eventui["Event tab<br/>[EventsTab.jsx]"]
  node_memberui["Member tab<br/>[MembersTab.jsx]"]
  node_authapi["Auth API<br/>[auth.js]"]
  node_workspaceapi["Workspace API<br/>[workspaces.js]"]
  node_taskapi["Task API<br/>[tasks.js]"]
  node_eventapi["Event API<br/>[events.js]"]
  node_httpclient["HTTP client<br/>[axios.js]"]
end

subgraph group_http["HTTP service"]
  node_service["Express app<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_workspaceroutes["Workspace routes<br/>[workspaceRoutes.js]"]
  node_taskroutes["Task routes<br/>[taskRoutes.js]"]
  node_eventroutes["Event routes<br/>[eventRoutes.js]"]
  node_statsroutes["Statistics routes<br/>[statsRoutes.js]"]
  node_authmw["Authentication<br/>[auth.js]"]
  node_accessmw["Workspace access<br/>[workspaceAccess.js]"]
  node_errors["Error handling<br/>[errorHandler.js]"]
end

subgraph group_domain["Workspace features"]
  node_authctrl["Authentication logic<br/>[auth.js]"]
  node_workspacectrl["Workspace logic"]
  node_taskctrl["Task logic<br/>[taskController.js]"]
  node_eventctrl["Event logic<br/>[eventController.js]"]
  node_statsctrl["Workspace statistics<br/>[statsController.js]"]
end

subgraph group_storage["Persistence"]
  node_userstore[("User records<br/>[User.js]")]
  node_workspacestore[("Workspace records<br/>[Workspace.js]")]
  node_taskstore[("Task records<br/>[Task.js]")]
  node_eventstore[("Event records<br/>[Event.js]")]
end

node_user(("Workspace user"))
node_mongodb[("MongoDB<br/>[db.js]")]

node_user -->|"uses"| node_appui
node_appui -->|"routes"| node_login
node_appui -->|"routes"| node_workspacesui
node_appui -->|"routes"| node_detailui
node_appui -->|"guards"| node_protected
node_protected -->|"checks session"| node_authui
node_login -->|"authenticates"| node_authapi
node_authui -->|"manages session"| node_authapi
node_workspacesui -->|"loads workspaces"| node_workspaceapi
node_detailui -->|"shows"| node_taskui
node_detailui -->|"shows"| node_eventui
node_detailui -->|"shows"| node_memberui
node_taskui -->|"manages tasks"| node_taskapi
node_eventui -->|"manages events"| node_eventapi
node_authapi -->|"sends requests"| node_httpclient
node_workspaceapi -->|"sends requests"| node_httpclient
node_taskapi -->|"sends requests"| node_httpclient
node_eventapi -->|"sends requests"| node_httpclient
node_httpclient -->|"HTTP requests"| node_service
node_service -->|"mounts"| node_authroutes
node_service -->|"mounts"| node_workspaceroutes
node_service -->|"mounts"| node_taskroutes
node_service -->|"mounts"| node_eventroutes
node_service -->|"mounts"| node_statsroutes
node_authroutes -->|"protects"| node_authmw
node_workspaceroutes -->|"protects"| node_authmw
node_workspaceroutes -->|"checks roles"| node_accessmw
node_taskroutes -->|"protects"| node_authmw
node_eventroutes -->|"protects"| node_authmw
node_authroutes -->|"dispatches"| node_authctrl
node_workspaceroutes -->|"dispatches"| node_workspacectrl
node_taskroutes -->|"dispatches"| node_taskctrl
node_eventroutes -->|"dispatches"| node_eventctrl
node_statsroutes -->|"dispatches"| node_statsctrl
node_authctrl -->|"reads and writes"| node_userstore
node_workspacectrl -->|"reads and writes"| node_workspacestore
node_workspacectrl -->|"deletes events"| node_eventstore
node_workspacectrl -->|"deletes tasks"| node_taskstore
node_taskctrl -->|"checks membership"| node_workspacestore
node_taskctrl -->|"reads and writes"| node_taskstore
node_eventctrl -->|"checks membership"| node_workspacestore
node_eventctrl -->|"reads and writes"| node_eventstore
node_statsctrl -->|"reads"| node_workspacestore
node_statsctrl -->|"reads"| node_taskstore
node_statsctrl -->|"reads"| node_eventstore
node_service -->|"handles errors"| node_errors
node_mongodb -->|"persists"| node_workspacestore
node_mongodb -->|"persists"| node_taskstore

click node_appui "https://github.com/gurram-rohith/devhub/blob/main/client/src/App.jsx"
click node_authui "https://github.com/gurram-rohith/devhub/blob/main/client/src/context/AuthContext.jsx"
click node_protected "https://github.com/gurram-rohith/devhub/blob/main/client/src/components/ProtectedRoute.jsx"
click node_login "https://github.com/gurram-rohith/devhub/blob/main/client/src/pages/Login.jsx"
click node_workspacesui "https://github.com/gurram-rohith/devhub/blob/main/client/src/pages/Workspaces.jsx"
click node_detailui "https://github.com/gurram-rohith/devhub/blob/main/client/src/pages/WorkspaceDetail.jsx"
click node_taskui "https://github.com/gurram-rohith/devhub/blob/main/client/src/components/TasksTab.jsx"
click node_eventui "https://github.com/gurram-rohith/devhub/blob/main/client/src/components/EventsTab.jsx"
click node_memberui "https://github.com/gurram-rohith/devhub/blob/main/client/src/components/MembersTab.jsx"
click node_authapi "https://github.com/gurram-rohith/devhub/blob/main/client/src/api/auth.js"
click node_workspaceapi "https://github.com/gurram-rohith/devhub/blob/main/client/src/api/workspaces.js"
click node_taskapi "https://github.com/gurram-rohith/devhub/blob/main/client/src/api/tasks.js"
click node_eventapi "https://github.com/gurram-rohith/devhub/blob/main/client/src/api/events.js"
click node_httpclient "https://github.com/gurram-rohith/devhub/blob/main/client/src/api/axios.js"
click node_service "https://github.com/gurram-rohith/devhub/blob/main/server/src/app.js"
click node_authroutes "https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/auth.js"
click node_workspaceroutes "https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/workspaceRoutes.js"
click node_taskroutes "https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/taskRoutes.js"
click node_eventroutes "https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/eventRoutes.js"
click node_statsroutes "https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/statsRoutes.js"
click node_authmw "https://github.com/gurram-rohith/devhub/blob/main/server/src/middleware/auth.js"
click node_accessmw "https://github.com/gurram-rohith/devhub/blob/main/server/src/middleware/workspaceAccess.js"
click node_errors "https://github.com/gurram-rohith/devhub/blob/main/server/src/middleware/errorHandler.js"
click node_authctrl "https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/auth.js"
click node_workspacectrl "https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/workspaceController.js"
click node_taskctrl "https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/taskController.js"
click node_eventctrl "https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/eventController.js"
click node_statsctrl "https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/statsController.js"
click node_userstore "https://github.com/gurram-rohith/devhub/blob/main/server/src/models/User.js"
click node_workspacestore "https://github.com/gurram-rohith/devhub/blob/main/server/src/models/Workspace.js"
click node_taskstore "https://github.com/gurram-rohith/devhub/blob/main/server/src/models/Task.js"
click node_eventstore "https://github.com/gurram-rohith/devhub/blob/main/server/src/models/Event.js"
click node_mongodb "https://github.com/gurram-rohith/devhub/blob/main/server/src/config/db.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_appui,node_authui,node_protected,node_login,node_workspacesui,node_detailui,node_taskui,node_eventui,node_memberui,node_authapi,node_workspaceapi,node_taskapi,node_eventapi,node_httpclient,node_user toneBlue
class node_service,node_authroutes,node_workspaceroutes,node_taskroutes,node_eventroutes,node_statsroutes,node_authmw,node_accessmw,node_errors,node_mongodb toneAmber
class node_authctrl,node_workspacectrl,node_taskctrl,node_eventctrl,node_statsctrl toneMint
class node_userstore,node_workspacestore,node_taskstore,node_eventstore toneRose
```

## Components

### Browser application

- [App routing](https://github.com/gurram-rohith/devhub/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Auth context](https://github.com/gurram-rohith/devhub/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Protected routes](https://github.com/gurram-rohith/devhub/blob/main/client/src/components/ProtectedRoute.jsx): `client/src/components/ProtectedRoute.jsx`
- [Login and register](https://github.com/gurram-rohith/devhub/blob/main/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [Workspace list](https://github.com/gurram-rohith/devhub/blob/main/client/src/pages/Workspaces.jsx): `client/src/pages/Workspaces.jsx`
- [Workspace detail](https://github.com/gurram-rohith/devhub/blob/main/client/src/pages/WorkspaceDetail.jsx): `client/src/pages/WorkspaceDetail.jsx`
- [Task tab](https://github.com/gurram-rohith/devhub/blob/main/client/src/components/TasksTab.jsx): `client/src/components/TasksTab.jsx`
- [Event tab](https://github.com/gurram-rohith/devhub/blob/main/client/src/components/EventsTab.jsx): `client/src/components/EventsTab.jsx`
- [Member tab](https://github.com/gurram-rohith/devhub/blob/main/client/src/components/MembersTab.jsx): `client/src/components/MembersTab.jsx`
- [Auth API](https://github.com/gurram-rohith/devhub/blob/main/client/src/api/auth.js): `client/src/api/auth.js`
- [Workspace API](https://github.com/gurram-rohith/devhub/blob/main/client/src/api/workspaces.js): `client/src/api/workspaces.js`
- [Task API](https://github.com/gurram-rohith/devhub/blob/main/client/src/api/tasks.js): `client/src/api/tasks.js`
- [Event API](https://github.com/gurram-rohith/devhub/blob/main/client/src/api/events.js): `client/src/api/events.js`
- [HTTP client](https://github.com/gurram-rohith/devhub/blob/main/client/src/api/axios.js): `client/src/api/axios.js`

### HTTP service

- [Express app](https://github.com/gurram-rohith/devhub/blob/main/server/src/app.js): `server/src/app.js`
- [Auth routes](https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/auth.js): `server/src/routes/auth.js`
- [Workspace routes](https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/workspaceRoutes.js): `server/src/routes/workspaceRoutes.js`
- [Task routes](https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/taskRoutes.js): `server/src/routes/taskRoutes.js`
- [Event routes](https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/eventRoutes.js): `server/src/routes/eventRoutes.js`
- [Statistics routes](https://github.com/gurram-rohith/devhub/blob/main/server/src/routes/statsRoutes.js): `server/src/routes/statsRoutes.js`
- [Authentication](https://github.com/gurram-rohith/devhub/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Workspace access](https://github.com/gurram-rohith/devhub/blob/main/server/src/middleware/workspaceAccess.js): `server/src/middleware/workspaceAccess.js`
- [Error handling](https://github.com/gurram-rohith/devhub/blob/main/server/src/middleware/errorHandler.js): `server/src/middleware/errorHandler.js`

### Workspace features

- [Authentication logic](https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/auth.js): `server/src/controllers/auth.js`
- [Workspace logic](https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/workspaceController.js): `server/src/controllers/workspaceController.js`
- [Task logic](https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/taskController.js): `server/src/controllers/taskController.js`
- [Event logic](https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/eventController.js): `server/src/controllers/eventController.js`
- [Workspace statistics](https://github.com/gurram-rohith/devhub/blob/main/server/src/controllers/statsController.js): `server/src/controllers/statsController.js`

### Persistence

- [User records](https://github.com/gurram-rohith/devhub/blob/main/server/src/models/User.js): `server/src/models/User.js`
- [Workspace records](https://github.com/gurram-rohith/devhub/blob/main/server/src/models/Workspace.js): `server/src/models/Workspace.js`
- [Task records](https://github.com/gurram-rohith/devhub/blob/main/server/src/models/Task.js): `server/src/models/Task.js`
- [Event records](https://github.com/gurram-rohith/devhub/blob/main/server/src/models/Event.js): `server/src/models/Event.js`

### Other components

- **Workspace user**
- [MongoDB](https://github.com/gurram-rohith/devhub/blob/main/server/src/config/db.js): `server/src/config/db.js`

## Connections

- Workspace user → App routing: uses
- App routing → Login and register: routes
- App routing → Workspace list: routes
- App routing → Workspace detail: routes
- App routing → Protected routes: guards
- Protected routes → Auth context: checks session
- Login and register → Auth API: authenticates
- Auth context → Auth API: manages session
- Workspace list → Workspace API: loads workspaces
- Workspace detail → Task tab: shows
- Workspace detail → Event tab: shows
- Workspace detail → Member tab: shows
- Task tab → Task API: manages tasks
- Event tab → Event API: manages events
- Auth API → HTTP client: sends requests
- Workspace API → HTTP client: sends requests
- Task API → HTTP client: sends requests
- Event API → HTTP client: sends requests
- HTTP client → Express app: HTTP requests
- Express app → Auth routes: mounts
- Express app → Workspace routes: mounts
- Express app → Task routes: mounts
- Express app → Event routes: mounts
- Express app → Statistics routes: mounts
- Auth routes → Authentication: protects
- Workspace routes → Authentication: protects
- Workspace routes → Workspace access: checks roles
- Task routes → Authentication: protects
- Event routes → Authentication: protects
- Auth routes → Authentication logic: dispatches
- Workspace routes → Workspace logic: dispatches
- Task routes → Task logic: dispatches
- Event routes → Event logic: dispatches
- Statistics routes → Workspace statistics: dispatches
- Authentication logic → User records: reads and writes
- Workspace logic → Workspace records: reads and writes
- Workspace logic → Event records: deletes events
- Workspace logic → Task records: deletes tasks
- Task logic → Workspace records: checks membership
- Task logic → Task records: reads and writes
- Event logic → Workspace records: checks membership
- Event logic → Event records: reads and writes
- Workspace statistics → Workspace records: reads
- Workspace statistics → Task records: reads
- Workspace statistics → Event records: reads
- Express app → Error handling: handles errors
- MongoDB → Workspace records: persists
- MongoDB → Task records: persists
