# sami-142745/smartsdlc architecture

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

- Interactive diagram: https://gitdiagram.com/sami-142745/smartsdlc
- Repository: https://github.com/sami-142745/smartsdlc

## Overview

SmartSDLC is a web application for GitHub-centered software lifecycle intelligence, with GitLab provider support noted in the README. Users authenticate, browse repositories and pull requests, request AI-assisted reviews, inspect findings, and submit feedback. The backend also exposes repository intelligence, architecture, documentation, security, supply-chain, insights, workflows, and assistant capabilities. The graph reflects documented routes and sampled orchestration; links for less-documented features are shown as unverified where their runtime calls were not excerpted.

Main entry points: [`backend/app/main.py`](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/main.py) (FastAPI application), [`backend/app/services/review_service.py`](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/review_service.py) (Review orchestration), [`frontend/src/App.tsx`](https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/App.tsx) (React application), [`backend/app/services/ai_review_service.py`](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/ai_review_service.py) (AI review pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_spa["React application<br/>[App.tsx]"]
  node_auth_ui["OAuth and session UI<br/>[AuthContext.tsx]"]
  node_pr_ui["PR and review UI"]
  node_repo_ui["Repository intelligence UI"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_entry["API entry and auth"]
  node_api_main["FastAPI application<br/>[main.py]"]
  node_auth_router["Auth routes<br/>[auth.py]"]
  node_github_router["GitHub and PR routes<br/>[github.py]"]
  node_review_router["Review routes<br/>[reviews.py]"]
  node_webhook_router["Webhook intake<br/>[webhook.py]"]
end

subgraph group_reviews["Review workflow"]
  node_review_service["Review orchestration<br/>[review_service.py]"]
  node_ai_review_service["AI review pipeline"]
  node_heuristics["Heuristic analysis<br/>[heuristics.py]"]
  node_gemini["Gemini analysis<br/>[gemini_service.py]"]
end

subgraph group_intelligence["Repository intelligence"]
  node_repo_routes["Repository intelligence routes"]
  node_other_features["Analysis capabilities"]
end

subgraph group_state["Persistence and learning"]
  node_review_store[("Review persistence")]
  node_ai_review_store[("AI review persistence")]
  node_feedback_learning["Feedback learning"]
  node_database[("MongoDB access<br/>[database.py]")]
end

node_user(("Engineer"))
node_github{{"GitHub"}}
node_gemini_service{{"Gemini API"}}

node_user -->|"uses"| node_spa
node_spa -->|"provides session"| node_auth_ui
node_spa -->|"routes to"| node_pr_ui
node_spa -->|"routes to"| node_repo_ui
node_api_client -.->|"sends API requests"| node_api_main
node_api_main -->|"registers routes"| node_auth_router
node_api_main -->|"registers routes"| node_github_router
node_api_main -->|"registers routes"| node_review_router
node_api_main -->|"registers routes"| node_webhook_router
node_api_main -->|"registers routes"| node_repo_routes
node_api_main -->|"registers feature routes"| node_other_features
node_user -->|"authenticates with"| node_github
node_github_router -.->|"accesses provider"| node_github
node_review_service -->|"runs analysis"| node_heuristics
node_review_service -->|"requests analysis"| node_gemini
node_review_service -->|"resolves weights"| node_feedback_learning
node_review_service -->|"saves review"| node_review_store
node_ai_review_service -.->|"uses analysis"| node_heuristics
node_ai_review_service -.->|"requests analysis"| node_gemini
node_ai_review_service -.->|"persists results"| node_ai_review_store
node_gemini -.->|"calls model"| node_gemini_service
node_review_store -->|"reads and writes"| node_database
node_ai_review_store -->|"reads and writes"| node_database
node_feedback_learning -.->|"uses feedback history"| node_review_store
node_repo_ui -.->|"requests repository data"| node_api_client
node_repo_routes -.->|"offers related analyses"| node_other_features

click node_spa "https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/App.tsx"
click node_auth_ui "https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/auth/AuthContext.tsx"
click node_pr_ui "https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/components/ai-review/AiReviewWorkspace.tsx"
click node_repo_ui "https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/pages/RepositoryIntelligencePage.tsx"
click node_api_client "https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/api/client.ts"
click node_api_main "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/main.py"
click node_auth_router "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/auth.py"
click node_github_router "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/github.py"
click node_review_router "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/reviews.py"
click node_webhook_router "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/webhook.py"
click node_review_service "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/review_service.py"
click node_ai_review_service "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/ai_review_service.py"
click node_heuristics "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/heuristics.py"
click node_gemini "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/gemini_service.py"
click node_repo_routes "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/repository_intelligence.py"
click node_other_features "https://github.com/sami-142745/smartsdlc/tree/master/backend/app/routers"
click node_review_store "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/review_repository.py"
click node_ai_review_store "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/ai_review_repository.py"
click node_feedback_learning "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/feedback_learning_service.py"
click node_database "https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/database.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_spa,node_auth_ui,node_pr_ui,node_repo_ui,node_api_client toneBlue
class node_api_main,node_auth_router,node_github_router,node_review_router,node_webhook_router toneAmber
class node_review_service,node_ai_review_service,node_heuristics,node_gemini,node_gemini_service toneMint
class node_repo_routes,node_other_features toneRose
class node_review_store,node_ai_review_store,node_feedback_learning,node_database,node_user,node_github toneIndigo
```

## Components

### Web client

- [React application](https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [OAuth and session UI](https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/auth/AuthContext.tsx): `frontend/src/auth/AuthContext.tsx`
- [PR and review UI](https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/components/ai-review/AiReviewWorkspace.tsx): `frontend/src/components/ai-review/AiReviewWorkspace.tsx`
- [Repository intelligence UI](https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/pages/RepositoryIntelligencePage.tsx): `frontend/src/pages/RepositoryIntelligencePage.tsx`
- [API client](https://github.com/sami-142745/smartsdlc/blob/master/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API entry and auth

- [FastAPI application](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/main.py): `backend/app/main.py`
- [Auth routes](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [GitHub and PR routes](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/github.py): `backend/app/routers/github.py`
- [Review routes](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/reviews.py): `backend/app/routers/reviews.py`
- [Webhook intake](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/webhook.py): `backend/app/routers/webhook.py`

### Review workflow

- [Review orchestration](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/review_service.py): `backend/app/services/review_service.py`
- [AI review pipeline](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/ai_review_service.py): `backend/app/services/ai_review_service.py`
- [Heuristic analysis](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/heuristics.py): `backend/app/services/heuristics.py`
- [Gemini analysis](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/gemini_service.py): `backend/app/services/gemini_service.py`

### Repository intelligence

- [Repository intelligence routes](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/routers/repository_intelligence.py): `backend/app/routers/repository_intelligence.py`
- [Analysis capabilities](https://github.com/sami-142745/smartsdlc/tree/master/backend/app/routers): `backend/app/routers`

### Persistence and learning

- [Review persistence](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/review_repository.py): `backend/app/services/review_repository.py`
- [AI review persistence](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/ai_review_repository.py): `backend/app/services/ai_review_repository.py`
- [Feedback learning](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/feedback_learning_service.py): `backend/app/services/feedback_learning_service.py`
- [MongoDB access](https://github.com/sami-142745/smartsdlc/blob/master/backend/app/services/database.py): `backend/app/services/database.py`

### Other components

- **Engineer**
- **GitHub**
- **Gemini API**

## Connections

- Engineer → React application: uses (evidence: `README.md`)
- React application → OAuth and session UI: provides session (evidence: `frontend/src/App.tsx`)
- React application → PR and review UI: routes to (evidence: `frontend/src/App.tsx`)
- React application → Repository intelligence UI: routes to (evidence: `frontend/src/App.tsx`)
- API client → FastAPI application: sends API requests
- FastAPI application → Auth routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → GitHub and PR routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Review routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Webhook intake: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Repository intelligence routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Analysis capabilities: registers feature routes (evidence: `backend/app/main.py`)
- Engineer → GitHub: authenticates with (evidence: `README.md`)
- GitHub and PR routes → GitHub: accesses provider
- Review orchestration → Heuristic analysis: runs analysis (evidence: `backend/app/services/review_service.py`)
- Review orchestration → Gemini analysis: requests analysis (evidence: `backend/app/services/review_service.py`)
- Review orchestration → Feedback learning: resolves weights (evidence: `backend/app/services/review_service.py`)
- Review orchestration → Review persistence: saves review (evidence: `backend/app/services/review_service.py`)
- AI review pipeline → Heuristic analysis: uses analysis (evidence: `backend/app/services/ai_review_service.py`)
- AI review pipeline → Gemini analysis: requests analysis (evidence: `backend/app/services/ai_review_service.py`)
- AI review pipeline → AI review persistence: persists results (evidence: `backend/app/services/ai_review_service.py`)
- Gemini analysis → Gemini API: calls model
- Review persistence → MongoDB access: reads and writes (evidence: `backend/app/services/review_repository.py`)
- AI review persistence → MongoDB access: reads and writes (evidence: `backend/app/services/ai_review_repository.py`)
- Feedback learning → Review persistence: uses feedback history
- Repository intelligence UI → API client: requests repository data
- Repository intelligence routes → Analysis capabilities: offers related analyses
