# mardemes/segress-score architecture

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

- Interactive diagram: https://gitdiagram.com/mardemes/segress-score
- Repository: https://github.com/mardemes/segress-score

## Overview

SEGRESS-Score evaluates the quality of reporting in systematic software-engineering reviews. Its main workflow accepts a PDF, extracts and classifies it, waits for confirmation when needed, checks applicable SEGRESS items using rules and optionally an LLM, then returns a scored report that a reviewer can adjust. The README also documents a standalone browser version. Edges reflect the README and shown source; unsampled frontend details are not inferred beyond documented capabilities.

Main entry points: [`backend/app/pipeline.py`](https://github.com/mardemes/segress-score/blob/main/backend/app/pipeline.py) (Pipeline orchestration), [`backend/app/main.py`](https://github.com/mardemes/segress-score/blob/main/backend/app/main.py) (Evaluation API), [`backend/app/extract.py`](https://github.com/mardemes/segress-score/blob/main/backend/app/extract.py) (PDF extraction), [`backend/app/llm.py`](https://github.com/mardemes/segress-score/blob/main/backend/app/llm.py) (LLM checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_web_ui["Web interface<br/>[index.html]"]
  node_standalone["Browser evaluator<br/>[segress-score.html]"]
end

subgraph group_workflow["Evaluation workflow"]
  node_api["Evaluation API<br/>[main.py]"]
  node_orchestrator["Pipeline orchestration<br/>[pipeline.py]"]
  node_extract["PDF extraction<br/>[extract.py]"]
  node_classification["Study classification<br/>[classify.py]"]
end

subgraph group_assessment["Assessment logic"]
  node_checklist["SEGRESS checklist<br/>[checklist.py]"]
  node_rules["Rule checks<br/>[rules.py]"]
  node_llm["LLM checks<br/>[llm.py]"]
  node_scoring["Scoring and rating<br/>[scoring.py]"]
end

subgraph group_persistence["Evaluation storage"]
  node_database[("SQLite evaluations<br/>[db.py]")]
end

node_reviewer(("Reviewer"))
node_anthropic{{"Anthropic API"}}

node_reviewer -->|"uploads PDF"| node_web_ui
node_web_ui -->|"uses evaluation API"| node_api
node_reviewer -->|"confirms or adjusts"| node_api
node_reviewer -->|"evaluates in browser"| node_standalone
node_api -->|"analyzes and checks"| node_orchestrator
node_api -->|"reads and updates"| node_database
node_api -->|"scores results"| node_scoring
node_orchestrator -->|"extracts PDF"| node_extract
node_orchestrator -->|"classifies study"| node_classification
node_orchestrator -->|"classifies and checks"| node_llm
node_orchestrator -->|"runs rule checks"| node_rules
node_orchestrator -->|"loads applicable items"| node_checklist
node_classification -->|"uses extracted document"| node_extract
node_rules -->|"checks document"| node_extract
node_llm -->|"verifies citations"| node_extract
node_llm -->|"requests judgments"| node_anthropic
node_scoring -->|"loads items and applicability"| node_checklist

click node_web_ui "https://github.com/mardemes/segress-score/blob/main/frontend/index.html"
click node_standalone "https://github.com/mardemes/segress-score/blob/main/web/segress-score.html"
click node_api "https://github.com/mardemes/segress-score/blob/main/backend/app/main.py"
click node_orchestrator "https://github.com/mardemes/segress-score/blob/main/backend/app/pipeline.py"
click node_extract "https://github.com/mardemes/segress-score/blob/main/backend/app/extract.py"
click node_classification "https://github.com/mardemes/segress-score/blob/main/backend/app/classify.py"
click node_checklist "https://github.com/mardemes/segress-score/blob/main/backend/app/checklist.py"
click node_rules "https://github.com/mardemes/segress-score/blob/main/backend/app/rules.py"
click node_llm "https://github.com/mardemes/segress-score/blob/main/backend/app/llm.py"
click node_scoring "https://github.com/mardemes/segress-score/blob/main/backend/app/scoring.py"
click node_database "https://github.com/mardemes/segress-score/blob/main/backend/app/db.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_web_ui,node_standalone,node_reviewer toneBlue
class node_api,node_orchestrator,node_extract,node_classification toneAmber
class node_checklist,node_rules,node_llm,node_scoring,node_anthropic toneMint
class node_database toneRose
```

## Components

### User interfaces

- [Web interface](https://github.com/mardemes/segress-score/blob/main/frontend/index.html): `frontend/index.html`
- [Browser evaluator](https://github.com/mardemes/segress-score/blob/main/web/segress-score.html): `web/segress-score.html`

### Evaluation workflow

- [Evaluation API](https://github.com/mardemes/segress-score/blob/main/backend/app/main.py): `backend/app/main.py`
- [Pipeline orchestration](https://github.com/mardemes/segress-score/blob/main/backend/app/pipeline.py): `backend/app/pipeline.py`
- [PDF extraction](https://github.com/mardemes/segress-score/blob/main/backend/app/extract.py): `backend/app/extract.py`
- [Study classification](https://github.com/mardemes/segress-score/blob/main/backend/app/classify.py): `backend/app/classify.py`

### Assessment logic

- [SEGRESS checklist](https://github.com/mardemes/segress-score/blob/main/backend/app/checklist.py): `backend/app/checklist.py`
- [Rule checks](https://github.com/mardemes/segress-score/blob/main/backend/app/rules.py): `backend/app/rules.py`
- [LLM checks](https://github.com/mardemes/segress-score/blob/main/backend/app/llm.py): `backend/app/llm.py`
- [Scoring and rating](https://github.com/mardemes/segress-score/blob/main/backend/app/scoring.py): `backend/app/scoring.py`

### Evaluation storage

- [SQLite evaluations](https://github.com/mardemes/segress-score/blob/main/backend/app/db.py): `backend/app/db.py`

### Other components

- **Reviewer**
- **Anthropic API**

## Connections

- Reviewer → Web interface: uploads PDF (evidence: `README.md`)
- Web interface → Evaluation API: uses evaluation API (evidence: `README.md`)
- Reviewer → Evaluation API: confirms or adjusts (evidence: `README.md`)
- Reviewer → Browser evaluator: evaluates in browser (evidence: `README.md`)
- Evaluation API → Pipeline orchestration: analyzes and checks (evidence: `backend/app/main.py`)
- Evaluation API → SQLite evaluations: reads and updates (evidence: `backend/app/main.py`)
- Evaluation API → Scoring and rating: scores results (evidence: `backend/app/main.py`)
- Pipeline orchestration → PDF extraction: extracts PDF (evidence: `backend/app/pipeline.py`)
- Pipeline orchestration → Study classification: classifies study (evidence: `backend/app/pipeline.py`)
- Pipeline orchestration → LLM checks: classifies and checks (evidence: `backend/app/pipeline.py`)
- Pipeline orchestration → Rule checks: runs rule checks (evidence: `backend/app/pipeline.py`)
- Pipeline orchestration → SEGRESS checklist: loads applicable items (evidence: `backend/app/pipeline.py`)
- Study classification → PDF extraction: uses extracted document (evidence: `backend/app/classify.py`)
- Rule checks → PDF extraction: checks document (evidence: `backend/app/rules.py`)
- LLM checks → PDF extraction: verifies citations (evidence: `backend/app/llm.py`)
- LLM checks → Anthropic API: requests judgments (evidence: `backend/app/llm.py`)
- Scoring and rating → SEGRESS checklist: loads items and applicability (evidence: `backend/app/scoring.py`)
