# pallavdeshmukh18/structural architecture

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

- Interactive diagram: https://gitdiagram.com/pallavdeshmukh18/structural
- Repository: https://github.com/pallavdeshmukh18/structural

## Overview

StructurAI is a code intelligence and collaboration product. Users connect GitHub repositories, inspect indexed code and pull requests, analyze incidents, and collaborate through projects and chat. The backend serves the frontend’s feature routes and a separate AI engine for review, root-cause analysis, and patch workflows. The README provides no capability details, so the broader feature map follows the source index and tree; dashed links mark relationships whose implementation was not excerpted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/App.tsx) (App routes), [`backend/server.js`](https://github.com/pallavdeshmukh18/structural/blob/main/backend/server.js) (API server), [`backend/src/models/index.js`](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/models/index.js) (Domain models), [`backend/src/modules/repository/repository.controller.js`](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/repository/repository.controller.js) (Repository operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_frontend["App routes<br/>[App.tsx]"]
  node_repo_ui["Repository views<br/>[Repository.tsx]"]
  node_visualizer["Code visualizer"]
  node_review_ui["PR review<br/>[PRReview.tsx]"]
  node_incident_ui["Incident views<br/>[IncidentList.tsx]"]
  node_project_ui["Project workspace"]
end

subgraph group_core["Platform backend"]
  node_api["API server<br/>[server.js]"]
  node_repo_controller["Repository operations"]
  node_webhook["GitHub webhook"]
  node_incident["Incident handling"]
end

subgraph group_analysis["Code analysis"]
  node_indexer["Repository indexer<br/>[indexer.service.js]"]
  node_ast["AST parser<br/>[ast.parser.js]"]
  node_ai_routes["AI routes<br/>[index.js]"]
  node_review["PR analysis"]
  node_rca["Root cause analysis<br/>[rca.service.js]"]
  node_patch["Patch workflow"]
  node_slop["Code health<br/>[slop.service.js]"]
  node_llm["LLM client<br/>[groqClient.js]"]
end

subgraph group_collaboration["Team collaboration"]
  node_projects["Project management"]
  node_chat["PR chat<br/>[chat.controller.js]"]
  node_slack["Slack integration"]
end

subgraph group_data["Persistent data"]
  node_models["Domain models<br/>[index.js]"]
end

node_user(("Engineer"))
node_database[("MongoDB")]
node_github(("GitHub"))
node_groq(("Groq API"))

node_user -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_repo_ui
node_frontend -->|"routes to"| node_visualizer
node_frontend -->|"routes to"| node_review_ui
node_frontend -->|"routes to"| node_incident_ui
node_frontend -->|"routes to"| node_project_ui
node_frontend -.->|"requests"| node_api
node_api -->|"connects"| node_database
node_api -->|"mounts routes"| node_repo_controller
node_api -->|"mounts routes"| node_webhook
node_api -.->|"mounts routes"| node_incident
node_api -->|"mounts routes"| node_ai_routes
node_repo_controller -->|"fetches repository data"| node_github
node_repo_controller -->|"invokes indexing"| node_indexer
node_webhook -->|"processes events"| node_incident
node_webhook -->|"invokes indexing"| node_indexer
node_indexer -.->|"parses source"| node_ast
node_repo_controller -->|"reads and writes"| node_models
node_incident -->|"reads and writes"| node_models
node_ai_routes -->|"routes to"| node_review
node_ai_routes -->|"routes to"| node_rca
node_ai_routes -->|"routes to"| node_patch
node_review -->|"invokes analysis"| node_slop
node_review -->|"requests review"| node_llm
node_rca -->|"requests analysis"| node_llm
node_slop -->|"requests analysis"| node_llm
node_patch -->|"runs root analysis"| node_rca
node_patch -.->|"may submit fix PR"| node_github
node_llm -.->|"calls model"| node_groq
node_projects -->|"reads and writes"| node_models
node_chat -->|"uses chat records"| node_models
node_slack -.->|"integration data"| node_models

click node_frontend "https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/App.tsx"
click node_repo_ui "https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/Repository.tsx"
click node_visualizer "https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/RepositoryVisualizer.tsx"
click node_review_ui "https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/PRReview.tsx"
click node_incident_ui "https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/IncidentList.tsx"
click node_project_ui "https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/ProjectWorkspace.tsx"
click node_api "https://github.com/pallavdeshmukh18/structural/blob/main/backend/server.js"
click node_repo_controller "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/repository/repository.controller.js"
click node_webhook "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/webhook/github.webhook.controller.js"
click node_incident "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/services/incident.service.js"
click node_indexer "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/services/indexer.service.js"
click node_ast "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/services/parser/ast.parser.js"
click node_ai_routes "https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/routes/index.js"
click node_review "https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/review/review.controller.js"
click node_rca "https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/rca/rca.service.js"
click node_patch "https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/patch/patch.controller.js"
click node_slop "https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/slop/slop.service.js"
click node_llm "https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/llm/groqClient.js"
click node_projects "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/project/project.controller.js"
click node_chat "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/chat/chat.controller.js"
click node_slack "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/slack/slack.controller.js"
click node_models "https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/models/index.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_frontend,node_repo_ui,node_visualizer,node_review_ui,node_incident_ui,node_project_ui toneBlue
class node_api,node_repo_controller,node_webhook,node_incident,node_database toneAmber
class node_indexer,node_ast,node_ai_routes,node_review,node_rca,node_patch,node_slop,node_llm,node_groq toneMint
class node_projects,node_chat,node_slack toneRose
class node_models,node_user,node_github toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Repository views](https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/Repository.tsx): `frontend/src/pages/Repository.tsx`
- [Code visualizer](https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/RepositoryVisualizer.tsx): `frontend/src/pages/RepositoryVisualizer.tsx`
- [PR review](https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/PRReview.tsx): `frontend/src/pages/PRReview.tsx`
- [Incident views](https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/IncidentList.tsx): `frontend/src/pages/IncidentList.tsx`
- [Project workspace](https://github.com/pallavdeshmukh18/structural/blob/main/frontend/src/pages/ProjectWorkspace.tsx): `frontend/src/pages/ProjectWorkspace.tsx`

### Platform backend

- [API server](https://github.com/pallavdeshmukh18/structural/blob/main/backend/server.js): `backend/server.js`
- [Repository operations](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/repository/repository.controller.js): `backend/src/modules/repository/repository.controller.js`
- [GitHub webhook](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/webhook/github.webhook.controller.js): `backend/src/modules/webhook/github.webhook.controller.js`
- [Incident handling](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/services/incident.service.js): `backend/src/services/incident.service.js`

### Code analysis

- [Repository indexer](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/services/indexer.service.js): `backend/src/services/indexer.service.js`
- [AST parser](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/services/parser/ast.parser.js): `backend/src/services/parser/ast.parser.js`
- [AI routes](https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/routes/index.js): `backend/mayank-ai-engine/src/routes/index.js`
- [PR analysis](https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/review/review.controller.js): `backend/mayank-ai-engine/src/modules/review/review.controller.js`
- [Root cause analysis](https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/rca/rca.service.js): `backend/mayank-ai-engine/src/modules/rca/rca.service.js`
- [Patch workflow](https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/patch/patch.controller.js): `backend/mayank-ai-engine/src/modules/patch/patch.controller.js`
- [Code health](https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/modules/slop/slop.service.js): `backend/mayank-ai-engine/src/modules/slop/slop.service.js`
- [LLM client](https://github.com/pallavdeshmukh18/structural/blob/main/backend/mayank-ai-engine/src/llm/groqClient.js): `backend/mayank-ai-engine/src/llm/groqClient.js`

### Team collaboration

- [Project management](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/project/project.controller.js): `backend/src/modules/project/project.controller.js`
- [PR chat](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/chat/chat.controller.js): `backend/src/modules/chat/chat.controller.js`
- [Slack integration](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/modules/slack/slack.controller.js): `backend/src/modules/slack/slack.controller.js`

### Persistent data

- [Domain models](https://github.com/pallavdeshmukh18/structural/blob/main/backend/src/models/index.js): `backend/src/models/index.js`

### Other components

- **Engineer**
- **MongoDB**
- **GitHub**
- **Groq API**

## Connections

- Engineer → App routes: uses (evidence: `frontend/src/App.tsx`)
- App routes → Repository views: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Code visualizer: routes to (evidence: `frontend/src/App.tsx`)
- App routes → PR review: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Incident views: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Project workspace: routes to (evidence: `frontend/src/App.tsx`)
- App routes → API server: requests
- API server → MongoDB: connects (evidence: `backend/server.js`)
- API server → Repository operations: mounts routes (evidence: `backend/server.js`)
- API server → GitHub webhook: mounts routes (evidence: `backend/server.js`)
- API server → Incident handling: mounts routes
- API server → AI routes: mounts routes (evidence: `backend/server.js`)
- Repository operations → GitHub: fetches repository data (evidence: `backend/src/modules/repository/repository.controller.js`)
- Repository operations → Repository indexer: invokes indexing (evidence: `backend/src/modules/repository/repository.controller.js`)
- GitHub webhook → Incident handling: processes events (evidence: `backend/src/modules/webhook/github.webhook.controller.js`)
- GitHub webhook → Repository indexer: invokes indexing (evidence: `backend/src/modules/webhook/github.webhook.controller.js`)
- Repository indexer → AST parser: parses source
- Repository operations → Domain models: reads and writes (evidence: `backend/src/modules/repository/repository.controller.js`)
- Incident handling → Domain models: reads and writes (evidence: `backend/src/services/incident.service.js`)
- AI routes → PR analysis: routes to (evidence: `backend/mayank-ai-engine/src/routes/index.js`)
- AI routes → Root cause analysis: routes to (evidence: `backend/mayank-ai-engine/src/routes/index.js`)
- AI routes → Patch workflow: routes to (evidence: `backend/mayank-ai-engine/src/routes/index.js`)
- PR analysis → Code health: invokes analysis (evidence: `backend/mayank-ai-engine/src/modules/review/review.controller.js`)
- PR analysis → LLM client: requests review
- Root cause analysis → LLM client: requests analysis (evidence: `backend/mayank-ai-engine/src/modules/rca/rca.service.js`)
- Code health → LLM client: requests analysis (evidence: `backend/mayank-ai-engine/src/modules/slop/slop.service.js`)
- Patch workflow → Root cause analysis: runs root analysis (evidence: `backend/mayank-ai-engine/src/modules/patch/patch.controller.js`)
- Patch workflow → GitHub: may submit fix PR
- LLM client → Groq API: calls model
- Project management → Domain models: reads and writes (evidence: `backend/src/modules/project/project.controller.js`)
- PR chat → Domain models: uses chat records (evidence: `backend/src/modules/chat/chat.controller.js`)
- Slack integration → Domain models: integration data
