# guhanbr/nexus-project architecture

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

- Interactive diagram: https://gitdiagram.com/guhanbr/nexus-project
- Repository: https://github.com/guhanbr/nexus-project

## Overview

RebalanceX is a project-planning and resource-rebalancing application. Users enter through the web workspaces to manage projects, form teams, plan and track tasks, and simulate disruptions; the backend exposes these capabilities through FastAPI routes and persists project, member, task, proposal, and history data. The README documents team optimization, critical-path scheduling, crisis simulation, and decision explanations. Some frontend pages and backend routes are unsampled, so their detailed interactions are shown only where documented or explicitly evidenced.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/App.jsx) (Workspace routing), [`Frontend/src/api/client.js`](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/api/client.js) (API client), [`backend/app/main.py`](https://github.com/guhanbr/nexus-project/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/api/routes/rebalancing_routes.py`](https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/rebalancing_routes.py) (Rebalance lifecycle routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Workspace routing<br/>[App.jsx]"]
  node_auth["Authentication state<br/>[AuthContext.jsx]"]
  node_projectctx["Project state<br/>[ProjectContext.jsx]"]
  node_projectsui["Project workspaces<br/>[ProjectsPage.jsx]"]
  node_overview["Project overview<br/>[OverviewPage.jsx]"]
  node_teamui["Team formation"]
  node_taskui["Task planning"]
  node_memberui["Member task tracking"]
  node_recoveryui["Crisis and recovery<br/>[RecoveryPage.jsx]"]
  node_historyui["Decision history"]
  node_apiclient["API client<br/>[client.js]"]
end

subgraph group_api["API and workflows"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_projectroutes["Project routes<br/>[projects.py]"]
  node_teamroutes["Team and member routes"]
  node_taskroutes["Task and schedule routes"]
  node_rebalanceroutes["Rebalance lifecycle routes"]
end

subgraph group_planning["Planning algorithms"]
  node_teamalgo["Team selection<br/>[team_formation.py]"]
  node_scheduler["Critical path scheduler<br/>[scheduler.py]"]
  node_rebalance["Resource rebalancer<br/>[rebalancer.py]"]
  node_explainer["Decision explanations<br/>[explainer.py]"]
end

subgraph group_storage["Persistence"]
  node_projectsrepo["Project repository<br/>[project_repo.py]"]
  node_entitiesrepo["Member task proposal history repositories<br/>[entities_repo.py]"]
  node_database[("MongoDB and local cache<br/>[connection.py]")]
end

node_user(("Project user"))

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"provides project state"| node_projectctx
node_app -->|"routes to"| node_projectsui
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_teamui
node_app -->|"routes to"| node_taskui
node_app -->|"routes to"| node_memberui
node_app -->|"routes to"| node_recoveryui
node_app -->|"routes to"| node_historyui
node_auth -->|"calls"| node_apiclient
node_projectctx -->|"fetches data"| node_apiclient
node_projectsui -->|"uses state"| node_projectctx
node_overview -->|"uses state"| node_projectctx
node_taskui -->|"calls"| node_apiclient
node_memberui -->|"updates tasks"| node_apiclient
node_recoveryui -->|"requests recovery"| node_apiclient
node_historyui -->|"loads history"| node_apiclient
node_apiclient -->|"sends API requests"| node_fastapi
node_fastapi -->|"registers router"| node_projectroutes
node_fastapi -->|"registers router"| node_teamroutes
node_fastapi -->|"registers router"| node_taskroutes
node_fastapi -->|"registers router"| node_rebalanceroutes
node_taskroutes -->|"calls"| node_scheduler
node_rebalanceroutes -->|"calls"| node_rebalance
node_rebalanceroutes -->|"generates rationale"| node_explainer
node_rebalanceroutes -->|"loads and saves proposals"| node_entitiesrepo
node_rebalanceroutes -->|"loads project"| node_projectsrepo
node_taskroutes -->|"accesses tasks"| node_entitiesrepo
node_taskroutes -->|"accesses projects"| node_projectsrepo
node_projectroutes -.->|"uses repository"| node_projectsrepo
node_teamroutes -.->|"uses team selection"| node_teamalgo
node_projectsrepo -->|"reads and writes"| node_database
node_entitiesrepo -->|"reads and writes"| node_database
node_rebalance -->|"uses scheduling"| node_scheduler

click node_app "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/App.jsx"
click node_auth "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/context/AuthContext.jsx"
click node_projectctx "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/context/ProjectContext.jsx"
click node_projectsui "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/ProjectsPage.jsx"
click node_overview "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/OverviewPage.jsx"
click node_teamui "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/TeamFormationPage.jsx"
click node_taskui "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/AdminTaskPlanningPage.jsx"
click node_memberui "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/MemberMyTasksPage.jsx"
click node_recoveryui "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/RecoveryPage.jsx"
click node_historyui "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/DecisionHistoryPage.jsx"
click node_apiclient "https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/api/client.js"
click node_fastapi "https://github.com/guhanbr/nexus-project/blob/main/backend/app/main.py"
click node_projectroutes "https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/projects.py"
click node_teamroutes "https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/team_and_members.py"
click node_taskroutes "https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/tasks_and_schedule.py"
click node_rebalanceroutes "https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/rebalancing_routes.py"
click node_teamalgo "https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/team_formation.py"
click node_scheduler "https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/scheduler.py"
click node_rebalance "https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/rebalancer.py"
click node_explainer "https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/explainer.py"
click node_projectsrepo "https://github.com/guhanbr/nexus-project/blob/main/backend/app/repositories/project_repo.py"
click node_entitiesrepo "https://github.com/guhanbr/nexus-project/blob/main/backend/app/repositories/entities_repo.py"
click node_database "https://github.com/guhanbr/nexus-project/blob/main/backend/app/database/connection.py"

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_auth,node_projectctx,node_projectsui,node_overview,node_teamui,node_taskui,node_memberui,node_recoveryui,node_historyui,node_apiclient,node_user toneBlue
class node_fastapi,node_projectroutes,node_teamroutes,node_taskroutes,node_rebalanceroutes toneAmber
class node_teamalgo,node_scheduler,node_rebalance,node_explainer toneMint
class node_projectsrepo,node_entitiesrepo,node_database toneRose
```

## Components

### Web application

- [Workspace routing](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Authentication state](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/context/AuthContext.jsx): `Frontend/src/context/AuthContext.jsx`
- [Project state](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/context/ProjectContext.jsx): `Frontend/src/context/ProjectContext.jsx`
- [Project workspaces](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/ProjectsPage.jsx): `Frontend/src/pages/ProjectsPage.jsx`
- [Project overview](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/OverviewPage.jsx): `Frontend/src/pages/OverviewPage.jsx`
- [Team formation](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/TeamFormationPage.jsx): `Frontend/src/pages/TeamFormationPage.jsx`
- [Task planning](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/AdminTaskPlanningPage.jsx): `Frontend/src/pages/AdminTaskPlanningPage.jsx`
- [Member task tracking](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/MemberMyTasksPage.jsx): `Frontend/src/pages/MemberMyTasksPage.jsx`
- [Crisis and recovery](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/RecoveryPage.jsx): `Frontend/src/pages/RecoveryPage.jsx`
- [Decision history](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/pages/DecisionHistoryPage.jsx): `Frontend/src/pages/DecisionHistoryPage.jsx`
- [API client](https://github.com/guhanbr/nexus-project/blob/main/Frontend/src/api/client.js): `Frontend/src/api/client.js`

### API and workflows

- [FastAPI application](https://github.com/guhanbr/nexus-project/blob/main/backend/app/main.py): `backend/app/main.py`
- [Project routes](https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/projects.py): `backend/app/api/routes/projects.py`
- [Team and member routes](https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/team_and_members.py): `backend/app/api/routes/team_and_members.py`
- [Task and schedule routes](https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/tasks_and_schedule.py): `backend/app/api/routes/tasks_and_schedule.py`
- [Rebalance lifecycle routes](https://github.com/guhanbr/nexus-project/blob/main/backend/app/api/routes/rebalancing_routes.py): `backend/app/api/routes/rebalancing_routes.py`

### Planning algorithms

- [Team selection](https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/team_formation.py): `backend/app/algorithms/team_formation.py`
- [Critical path scheduler](https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/scheduler.py): `backend/app/algorithms/scheduler.py`
- [Resource rebalancer](https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/rebalancer.py): `backend/app/algorithms/rebalancer.py`
- [Decision explanations](https://github.com/guhanbr/nexus-project/blob/main/backend/app/algorithms/explainer.py): `backend/app/algorithms/explainer.py`

### Persistence

- [Project repository](https://github.com/guhanbr/nexus-project/blob/main/backend/app/repositories/project_repo.py): `backend/app/repositories/project_repo.py`
- [Member task proposal history repositories](https://github.com/guhanbr/nexus-project/blob/main/backend/app/repositories/entities_repo.py): `backend/app/repositories/entities_repo.py`
- [MongoDB and local cache](https://github.com/guhanbr/nexus-project/blob/main/backend/app/database/connection.py): `backend/app/database/connection.py`

### Other components

- **Project user**

## Connections

- Project user → Workspace routing: uses (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Authentication state: provides auth (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Project state: provides project state (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Project workspaces: routes to (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Project overview: routes to (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Team formation: routes to (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Task planning: routes to (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Member task tracking: routes to (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Crisis and recovery: routes to (evidence: `Frontend/src/App.jsx`)
- Workspace routing → Decision history: routes to (evidence: `Frontend/src/App.jsx`)
- Authentication state → API client: calls (evidence: `Frontend/src/context/AuthContext.jsx`)
- Project state → API client: fetches data (evidence: `Frontend/src/context/ProjectContext.jsx`)
- Project workspaces → Project state: uses state (evidence: `Frontend/src/pages/ProjectsPage.jsx`)
- Project overview → Project state: uses state (evidence: `Frontend/src/pages/OverviewPage.jsx`)
- Task planning → API client: calls (evidence: `Frontend/src/pages/AdminTaskPlanningPage.jsx`)
- Member task tracking → API client: updates tasks (evidence: `Frontend/src/pages/MemberMyTasksPage.jsx`)
- Crisis and recovery → API client: requests recovery (evidence: `Frontend/src/pages/RecoveryPage.jsx`)
- Decision history → API client: loads history (evidence: `Frontend/src/pages/DecisionHistoryPage.jsx`)
- API client → FastAPI application: sends API requests (evidence: `Frontend/src/api/client.js`)
- FastAPI application → Project routes: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Team and member routes: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Task and schedule routes: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Rebalance lifecycle routes: registers router (evidence: `backend/app/main.py`)
- Task and schedule routes → Critical path scheduler: calls (evidence: `backend/app/api/routes/tasks_and_schedule.py`)
- Rebalance lifecycle routes → Resource rebalancer: calls (evidence: `backend/app/api/routes/rebalancing_routes.py`)
- Rebalance lifecycle routes → Decision explanations: generates rationale (evidence: `backend/app/api/routes/rebalancing_routes.py`)
- Rebalance lifecycle routes → Member task proposal history repositories: loads and saves proposals (evidence: `backend/app/api/routes/rebalancing_routes.py`)
- Rebalance lifecycle routes → Project repository: loads project (evidence: `backend/app/api/routes/rebalancing_routes.py`)
- Task and schedule routes → Member task proposal history repositories: accesses tasks (evidence: `backend/app/api/routes/tasks_and_schedule.py`)
- Task and schedule routes → Project repository: accesses projects (evidence: `backend/app/api/routes/tasks_and_schedule.py`)
- Project routes → Project repository: uses repository
- Team and member routes → Team selection: uses team selection
- Project repository → MongoDB and local cache: reads and writes (evidence: `backend/app/repositories/project_repo.py`)
- Member task proposal history repositories → MongoDB and local cache: reads and writes (evidence: `backend/app/repositories/entities_repo.py`)
- Resource rebalancer → Critical path scheduler: uses scheduling (evidence: `backend/app/algorithms/rebalancer.py`)
