# prathameshdeshpande99/software-tool architecture

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

- Interactive diagram: https://gitdiagram.com/prathameshdeshpande99/software-tool
- Repository: https://github.com/prathameshdeshpande99/software-tool

## Overview

This repository is an AI-powered dataset-use compliance checker. Users submit rules and a codebase through the web API or CLI; the service parses rules, gathers source, runs a vanilla Gemini audit or an advanced retrieval-based audit, and returns a structured violation report. The asynchronous web workflow dispatches work to a Celery worker and exposes task status. The README also documents the Flask interface and legal-PDF extraction. Advanced RAG connections are grounded in the sampled audit source; unsampled UI internals and some web wiring are not inferred.

Main entry points: [`server.py`](https://github.com/prathameshdeshpande99/software-tool/blob/main/server.py) (Flask API), [`src/audit.py`](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/audit.py) (Advanced Audit), [`main.py`](https://github.com/prathameshdeshpande99/software-tool/blob/main/main.py) (Web API), [`src/compliance_checker/analyzer.py`](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/analyzer.py) (Vanilla Analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Audit Intake"]
  node_ingestion["Codebase Intake<br/>[main.py]"]
  node_loader["Local/GitHub Loader<br/>[codebase_loader.py]"]
end

subgraph group_rules["Rule Processing"]
  node_rule_input["Rule Input<br/>[main.py]"]
  node_pdf_extract["PDF Rule Extractor"]
  node_yaml_rules["YAML Rule Loader<br/>[rules_loader.py]"]
  node_rule_models["Rules Schema<br/>[models.py]"]
end

subgraph group_analysis["Compliance Analysis"]
  node_vanilla["Vanilla Analyzer<br/>[analyzer.py]"]
  node_advanced["Advanced Audit<br/>[audit.py]"]
  node_chunker["Semantic Chunker"]
  node_vector["Incremental Vector Store<br/>[vector_store.py]"]
  node_report["Compliance Report<br/>[models.py]"]
end

subgraph group_jobs["Background Jobs"]
  node_task_worker["Analysis Worker<br/>[worker.py]"]
  node_celery["Celery App<br/>[celery_app.py]"]
end

subgraph group_interfaces["User Interfaces"]
  node_fastapi["Web API<br/>[main.py]"]
  node_flask["Flask API<br/>[server.py]"]
  node_cli["CLI<br/>[cli.py]"]
  node_webapp["Web UI"]
end

node_user(("User"))
node_qdrant[("Qdrant")]
node_gemini(("Google Gemini"))
node_redis[("Redis")]

node_user -->|"submits audit"| node_webapp
node_user -->|"runs scan"| node_cli
node_webapp -.->|"sends request"| node_fastapi
node_user -->|"uses interface"| node_flask
node_cli -->|"loads rules"| node_yaml_rules
node_cli -->|"loads codebase"| node_loader
node_cli -->|"runs analysis"| node_vanilla
node_fastapi -->|"accepts input"| node_ingestion
node_fastapi -->|"parses rules"| node_rule_input
node_fastapi -->|"dispatches task"| node_task_worker
node_fastapi -->|"reads task status"| node_celery
node_flask -->|"accepts input"| node_ingestion
node_flask -->|"parses rules"| node_rule_input
node_flask -->|"loads GitHub code"| node_loader
node_flask -->|"runs advanced audit"| node_advanced
node_flask -->|"runs vanilla audit"| node_vanilla
node_rule_input -->|"extracts PDF rules"| node_pdf_extract
node_pdf_extract -->|"validates rules"| node_rule_models
node_yaml_rules -->|"creates schema"| node_rule_models
node_ingestion -.->|"fetches GitHub"| node_loader
node_task_worker -->|"runs advanced audit"| node_advanced
node_task_worker -.->|"runs vanilla audit"| node_vanilla
node_task_worker -->|"updates task state"| node_celery
node_celery -.->|"stores task state"| node_redis
node_advanced -->|"chunks Python"| node_chunker
node_advanced -->|"syncs codebase"| node_vector
node_vector -->|"indexes chunks"| node_qdrant
node_advanced -->|"queries violations"| node_gemini
node_vanilla -->|"requests analysis"| node_gemini
node_advanced -->|"returns report"| node_report
node_vanilla -->|"returns report"| node_report

click node_fastapi "https://github.com/prathameshdeshpande99/software-tool/blob/main/main.py"
click node_flask "https://github.com/prathameshdeshpande99/software-tool/blob/main/server.py"
click node_cli "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/cli.py"
click node_webapp "https://github.com/prathameshdeshpande99/software-tool/tree/main/webapp"
click node_ingestion "https://github.com/prathameshdeshpande99/software-tool/blob/main/main.py"
click node_loader "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/codebase_loader.py"
click node_rule_input "https://github.com/prathameshdeshpande99/software-tool/blob/main/main.py"
click node_pdf_extract "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/pdf_rule_extractor.py"
click node_yaml_rules "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/rules_loader.py"
click node_rule_models "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/models.py"
click node_task_worker "https://github.com/prathameshdeshpande99/software-tool/blob/main/worker.py"
click node_celery "https://github.com/prathameshdeshpande99/software-tool/blob/main/celery_app.py"
click node_vanilla "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/analyzer.py"
click node_advanced "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/audit.py"
click node_chunker "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/semantic_chunker.py"
click node_vector "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/vector_store.py"
click node_report "https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/models.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_ingestion,node_loader,node_user toneBlue
class node_rule_input,node_pdf_extract,node_yaml_rules,node_rule_models,node_qdrant,node_redis toneAmber
class node_vanilla,node_advanced,node_chunker,node_vector,node_report toneMint
class node_task_worker,node_celery toneRose
class node_fastapi,node_flask,node_cli,node_webapp,node_gemini toneIndigo
```

## Components

### Audit Intake

- [Codebase Intake](https://github.com/prathameshdeshpande99/software-tool/blob/main/main.py): `main.py`
- [Local/GitHub Loader](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/codebase_loader.py): `src/compliance_checker/codebase_loader.py`

### Rule Processing

- [Rule Input](https://github.com/prathameshdeshpande99/software-tool/blob/main/main.py): `main.py`
- [PDF Rule Extractor](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/pdf_rule_extractor.py): `src/compliance_checker/pdf_rule_extractor.py`
- [YAML Rule Loader](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/rules_loader.py): `src/compliance_checker/rules_loader.py`
- [Rules Schema](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/models.py): `src/compliance_checker/models.py`

### Compliance Analysis

- [Vanilla Analyzer](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/analyzer.py): `src/compliance_checker/analyzer.py`
- [Advanced Audit](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/audit.py): `src/audit.py`
- [Semantic Chunker](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/semantic_chunker.py): `src/semantic_chunker.py`
- [Incremental Vector Store](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/vector_store.py): `src/compliance_checker/vector_store.py`
- [Compliance Report](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/models.py): `src/compliance_checker/models.py`

### Background Jobs

- [Analysis Worker](https://github.com/prathameshdeshpande99/software-tool/blob/main/worker.py): `worker.py`
- [Celery App](https://github.com/prathameshdeshpande99/software-tool/blob/main/celery_app.py): `celery_app.py`

### User Interfaces

- [Web API](https://github.com/prathameshdeshpande99/software-tool/blob/main/main.py): `main.py`
- [Flask API](https://github.com/prathameshdeshpande99/software-tool/blob/main/server.py): `server.py`
- [CLI](https://github.com/prathameshdeshpande99/software-tool/blob/main/src/compliance_checker/cli.py): `src/compliance_checker/cli.py`
- [Web UI](https://github.com/prathameshdeshpande99/software-tool/tree/main/webapp): `webapp`

### Other components

- **User**
- **Qdrant**
- **Google Gemini**
- **Redis**

## Connections

- User → Web UI: submits audit (evidence: `README.md`)
- User → CLI: runs scan (evidence: `README.md`)
- Web UI → Web API: sends request
- User → Flask API: uses interface (evidence: `README.md`)
- CLI → YAML Rule Loader: loads rules (evidence: `src/compliance_checker/cli.py`)
- CLI → Local/GitHub Loader: loads codebase (evidence: `src/compliance_checker/cli.py`)
- CLI → Vanilla Analyzer: runs analysis (evidence: `src/compliance_checker/cli.py`)
- Web API → Codebase Intake: accepts input (evidence: `main.py`)
- Web API → Rule Input: parses rules (evidence: `main.py`)
- Web API → Analysis Worker: dispatches task (evidence: `main.py`)
- Web API → Celery App: reads task status (evidence: `main.py`)
- Flask API → Codebase Intake: accepts input (evidence: `server.py`)
- Flask API → Rule Input: parses rules (evidence: `server.py`)
- Flask API → Local/GitHub Loader: loads GitHub code (evidence: `server.py`)
- Flask API → Advanced Audit: runs advanced audit (evidence: `server.py`)
- Flask API → Vanilla Analyzer: runs vanilla audit (evidence: `server.py`)
- Rule Input → PDF Rule Extractor: extracts PDF rules (evidence: `main.py`)
- PDF Rule Extractor → Rules Schema: validates rules (evidence: `src/compliance_checker/pdf_rule_extractor.py`)
- YAML Rule Loader → Rules Schema: creates schema (evidence: `src/compliance_checker/rules_loader.py`)
- Codebase Intake → Local/GitHub Loader: fetches GitHub (evidence: `main.py`)
- Analysis Worker → Advanced Audit: runs advanced audit (evidence: `worker.py`)
- Analysis Worker → Vanilla Analyzer: runs vanilla audit
- Analysis Worker → Celery App: updates task state (evidence: `worker.py`)
- Celery App → Redis: stores task state
- Advanced Audit → Semantic Chunker: chunks Python (evidence: `src/audit.py`)
- Advanced Audit → Incremental Vector Store: syncs codebase (evidence: `src/audit.py`)
- Incremental Vector Store → Qdrant: indexes chunks (evidence: `src/compliance_checker/vector_store.py`)
- Advanced Audit → Google Gemini: queries violations (evidence: `src/audit.py`)
- Vanilla Analyzer → Google Gemini: requests analysis (evidence: `src/compliance_checker/analyzer.py`)
- Advanced Audit → Compliance Report: returns report (evidence: `src/audit.py`)
- Vanilla Analyzer → Compliance Report: returns report (evidence: `src/compliance_checker/analyzer.py`)
