# sudarshanag31/collab-x architecture

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

- Interactive diagram: https://gitdiagram.com/sudarshanag31/collab-x
- Repository: https://github.com/sudarshanag31/collab-x

## Overview

Collab-X is a project-collaboration platform: users discover or create projects, apply to join, receive owner decisions, and collaborate through project workspaces. The frontend routes users through authentication and profile completion before project and workspace views; its API client attaches bearer tokens. The backend exposes project, application, membership, leave-request, and workspace capabilities, with MongoDB-backed domain models and GitHub repository access/invitations. Workspace feature controllers and several frontend pages are represented at their enclosing paths because their implementations were not sampled; links without direct evidence are omitted or marked unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/App.jsx) (Routed web app), [`backend/src/controllers/applicationController.js`](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/controllers/applicationController.js) (Application decisions), [`frontend/src/services/api.js`](https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/services/api.js) (API client), [`backend/src/app.js`](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/app.js) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Routed web app<br/>[App.jsx]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_apiclient["API client<br/>[api.js]"]
  node_projectui["Project discovery<br/>[Discover.jsx]"]
  node_applicationui["Application views"]
  node_workspaceui["Workspace views"]
end

subgraph group_platform["Project platform"]
  node_backend["HTTP API<br/>[app.js]"]
  node_projectroutes["Project routes<br/>[project.routes.js]"]
  node_applicationroutes["Application routes"]
  node_authroutes["Authentication routes<br/>[auth.routes.js]"]
  node_projectlogic["Project lifecycle"]
  node_applicationlogic["Application decisions"]
  node_leavelogic["Leave requests"]
  node_matching["Project matching"]
end

subgraph group_collaboration["Workspace collaboration"]
  node_workspaceapi["Workspace features"]
end

subgraph group_integrations["Persistence and integrations"]
  node_membership["Membership records<br/>[Membership.js]"]
  node_domainmodels["Domain records"]
  node_database[("MongoDB<br/>[db.js]")]
  node_github["GitHub services<br/>[github.service.js]"]
  node_githubinvite["GitHub invitations"]
end

node_user(("Project user"))
node_githubservice{{"GitHub"}}

node_user -->|"uses"| node_webapp
node_webapp -->|"provides auth"| node_authstate
node_authstate -->|"requests"| node_apiclient
node_webapp -->|"routes to"| node_projectui
node_webapp -->|"routes to"| node_applicationui
node_webapp -->|"routes to"| node_workspaceui
node_projectui -->|"requests data"| node_apiclient
node_applicationui -->|"requests data"| node_apiclient
node_workspaceui -->|"requests data"| node_apiclient
node_apiclient -.->|"HTTP requests"| node_backend
node_backend -->|"mounts"| node_authroutes
node_backend -->|"mounts"| node_projectroutes
node_backend -->|"mounts"| node_applicationroutes
node_projectroutes -->|"routes to"| node_projectlogic
node_projectroutes -->|"routes to"| node_applicationlogic
node_projectroutes -->|"routes to"| node_workspaceapi
node_applicationroutes -->|"routes to"| node_applicationlogic
node_projectlogic -->|"gets matches"| node_matching
node_applicationlogic -->|"updates membership"| node_membership
node_leavelogic -->|"deactivates membership"| node_membership
node_applicationlogic -->|"sends invite"| node_githubinvite
node_githubinvite -->|"uses API"| node_github
node_github -.->|"calls API"| node_githubservice
node_projectlogic -.->|"reads and writes"| node_database
node_applicationlogic -.->|"reads and writes"| node_database
node_workspaceapi -.->|"persists features"| node_database
node_domainmodels -.->|"stores records"| node_database

click node_webapp "https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/App.jsx"
click node_authstate "https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/context/AuthContext.jsx"
click node_apiclient "https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/services/api.js"
click node_projectui "https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/pages/projects/Discover.jsx"
click node_applicationui "https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/pages/applications/ReceivedApplications.jsx"
click node_workspaceui "https://github.com/sudarshanag31/collab-x/tree/main/frontend/src/pages/workspace"
click node_backend "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/app.js"
click node_projectroutes "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/routes/project.routes.js"
click node_applicationroutes "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/routes/application.routes.js"
click node_authroutes "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/routes/auth.routes.js"
click node_projectlogic "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/controllers/projectController.js"
click node_applicationlogic "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/controllers/applicationController.js"
click node_leavelogic "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/controllers/leaveRequestController.js"
click node_workspaceapi "https://github.com/sudarshanag31/collab-x/tree/main/backend/src/controllers"
click node_membership "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/models/Membership.js"
click node_domainmodels "https://github.com/sudarshanag31/collab-x/tree/main/backend/src/models"
click node_database "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/config/db.js"
click node_matching "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/services/matching.service.js"
click node_github "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/services/github.service.js"
click node_githubinvite "https://github.com/sudarshanag31/collab-x/blob/main/backend/src/services/githubInvite.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_webapp,node_authstate,node_apiclient,node_projectui,node_applicationui,node_workspaceui,node_user toneBlue
class node_backend,node_projectroutes,node_applicationroutes,node_authroutes,node_projectlogic,node_applicationlogic,node_leavelogic,node_matching toneAmber
class node_workspaceapi toneMint
class node_membership,node_domainmodels,node_database,node_github,node_githubinvite toneRose
class node_githubservice toneIndigo
```

## Components

### Web client

- [Routed web app](https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth state](https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Project discovery](https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/pages/projects/Discover.jsx): `frontend/src/pages/projects/Discover.jsx`
- [Application views](https://github.com/sudarshanag31/collab-x/blob/main/frontend/src/pages/applications/ReceivedApplications.jsx): `frontend/src/pages/applications/ReceivedApplications.jsx`
- [Workspace views](https://github.com/sudarshanag31/collab-x/tree/main/frontend/src/pages/workspace): `frontend/src/pages/workspace`

### Project platform

- [HTTP API](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/app.js): `backend/src/app.js`
- [Project routes](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/routes/project.routes.js): `backend/src/routes/project.routes.js`
- [Application routes](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/routes/application.routes.js): `backend/src/routes/application.routes.js`
- [Authentication routes](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Project lifecycle](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/controllers/projectController.js): `backend/src/controllers/projectController.js`
- [Application decisions](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/controllers/applicationController.js): `backend/src/controllers/applicationController.js`
- [Leave requests](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/controllers/leaveRequestController.js): `backend/src/controllers/leaveRequestController.js`
- [Project matching](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/services/matching.service.js): `backend/src/services/matching.service.js`

### Workspace collaboration

- [Workspace features](https://github.com/sudarshanag31/collab-x/tree/main/backend/src/controllers): `backend/src/controllers`

### Persistence and integrations

- [Membership records](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/models/Membership.js): `backend/src/models/Membership.js`
- [Domain records](https://github.com/sudarshanag31/collab-x/tree/main/backend/src/models): `backend/src/models`
- [MongoDB](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [GitHub services](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/services/github.service.js): `backend/src/services/github.service.js`
- [GitHub invitations](https://github.com/sudarshanag31/collab-x/blob/main/backend/src/services/githubInvite.service.js): `backend/src/services/githubInvite.service.js`

### Other components

- **Project user**
- **GitHub**

## Connections

- Project user → Routed web app: uses (evidence: `frontend/src/App.jsx`)
- Routed web app → Auth state: provides auth (evidence: `frontend/src/App.jsx`)
- Auth state → API client: requests (evidence: `frontend/src/context/AuthContext.jsx`)
- Routed web app → Project discovery: routes to (evidence: `frontend/src/App.jsx`)
- Routed web app → Application views: routes to (evidence: `frontend/src/App.jsx`)
- Routed web app → Workspace views: routes to (evidence: `frontend/src/App.jsx`)
- Project discovery → API client: requests data
- Application views → API client: requests data (evidence: `frontend/src/pages/applications/ReceivedApplications.jsx`)
- Workspace views → API client: requests data (evidence: `frontend/src/pages/workspace/RepositoryExplorer.jsx`)
- API client → HTTP API: HTTP requests
- HTTP API → Authentication routes: mounts (evidence: `backend/src/app.js`)
- HTTP API → Project routes: mounts (evidence: `backend/src/app.js`)
- HTTP API → Application routes: mounts (evidence: `backend/src/app.js`)
- Project routes → Project lifecycle: routes to (evidence: `backend/src/routes/project.routes.js`)
- Project routes → Application decisions: routes to (evidence: `backend/src/routes/project.routes.js`)
- Project routes → Workspace features: routes to (evidence: `backend/src/routes/project.routes.js`)
- Application routes → Application decisions: routes to (evidence: `backend/src/routes/application.routes.js`)
- Project lifecycle → Project matching: gets matches (evidence: `backend/src/controllers/projectController.js`)
- Application decisions → Membership records: updates membership (evidence: `backend/src/controllers/applicationController.js`)
- Leave requests → Membership records: deactivates membership (evidence: `backend/src/controllers/leaveRequestController.js`)
- Application decisions → GitHub invitations: sends invite (evidence: `backend/src/controllers/applicationController.js`)
- GitHub invitations → GitHub services: uses API (evidence: `backend/src/services/githubInvite.service.js`)
- GitHub services → GitHub: calls API
- Project lifecycle → MongoDB: reads and writes
- Application decisions → MongoDB: reads and writes
- Workspace features → MongoDB: persists features
- Domain records → MongoDB: stores records
