# challengelotus/checkpoint4-cyber-sast-platform architecture

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

- Interactive diagram: https://gitdiagram.com/challengelotus/checkpoint4-cyber-sast-platform
- Repository: https://github.com/challengelotus/checkpoint4-cyber-sast-platform

## Overview

A Python SAST platform takes users from dashboard access and code upload through authenticated API analysis, optional premium AI review, and persisted findings; the dashboard then presents reports, history, and metrics. The README also describes AST checks, Semgrep taint analysis, SQLite history, and PDF reporting. Unsampled home and plans views are included as documented dashboard capabilities; their internal behavior is not inferred.

Main entry points: [`api/main.py`](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/main.py) (API routes), [`dashboard/app.py`](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/app.py) (Dashboard router), [`dashboard/views/panel.py`](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/panel.py) (Audit and metrics), [`api/core/security.py`](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/core/security.py) (Authentication security)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Streamlit dashboard"]
  node_app["Dashboard router<br/>[app.py]"]
  node_authview["Login and signup<br/>[auth.py]"]
  node_home["Home page<br/>[home.py]"]
  node_plans["Plan information<br/>[planos.py]"]
  node_panel["Audit and metrics<br/>[panel.py]"]
end

subgraph group_api["API and identity"]
  node_api_main["API routes<br/>[main.py]"]
  node_security["Authentication security<br/>[security.py]"]
  node_config["Application settings<br/>[config.py]"]
  node_logger["Structured logging<br/>[logger.py]"]
end

subgraph group_analysis["Analysis engines"]
  node_ast["AST scanner<br/>[parser.py]"]
  node_semgrep_runner["Taint scanner<br/>[semgrep_runner.py]"]
  node_semgrep_rules["Taint rules<br/>[taint_rules.yml]"]
  node_ai["AI remediation<br/>[analyzer.py]"]
end

subgraph group_storage["Persistence"]
  node_db[("SQLite scan store<br/>[database.py]")]
end

node_user(("User"))
node_semgrep["Semgrep executable"]
node_ollama["Ollama LLM"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_plans
node_app -->|"routes to"| node_authview
node_app -->|"routes to"| node_panel
node_authview -->|"calls auth routes"| node_api_main
node_panel -->|"uploads code"| node_api_main
node_panel -->|"requests history"| node_api_main
node_api_main -->|"uses auth helpers"| node_security
node_api_main -->|"reads settings"| node_config
node_api_main -->|"logs requests"| node_logger
node_api_main -->|"runs AST scan"| node_ast
node_api_main -->|"runs taint scan"| node_semgrep_runner
node_api_main -->|"requests premium review"| node_ai
node_api_main -->|"stores and reads scans"| node_db
node_security -->|"queries users"| node_db
node_security -->|"uses token settings"| node_config
node_ai -->|"requests generation"| node_ollama
node_ai -->|"logs AI activity"| node_logger
node_semgrep_runner -->|"runs scan"| node_semgrep
node_semgrep_runner -->|"configures scan"| node_semgrep_rules
node_api_main -->|"creates schema"| node_db

click node_app "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/app.py"
click node_authview "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/auth.py"
click node_home "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/home.py"
click node_plans "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/planos.py"
click node_panel "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/panel.py"
click node_api_main "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/main.py"
click node_security "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/core/security.py"
click node_config "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/core/config.py"
click node_logger "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/core/logger.py"
click node_ast "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/engine/parser.py"
click node_semgrep_runner "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/engine/semgrep_runner.py"
click node_semgrep_rules "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/engine/taint_rules.yml"
click node_ai "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/ai_module/analyzer.py"
click node_db "https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/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_app,node_authview,node_home,node_plans,node_panel,node_user toneBlue
class node_api_main,node_security,node_config,node_logger toneAmber
class node_ast,node_semgrep_runner,node_semgrep_rules,node_ai toneMint
class node_db toneRose
class node_semgrep,node_ollama toneIndigo
```

## Components

### Streamlit dashboard

- [Dashboard router](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/app.py): `dashboard/app.py`
- [Login and signup](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/auth.py): `dashboard/views/auth.py`
- [Home page](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/home.py): `dashboard/views/home.py`
- [Plan information](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/planos.py): `dashboard/views/planos.py`
- [Audit and metrics](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/dashboard/views/panel.py): `dashboard/views/panel.py`

### API and identity

- [API routes](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/main.py): `api/main.py`
- [Authentication security](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/core/security.py): `api/core/security.py`
- [Application settings](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/core/config.py): `api/core/config.py`
- [Structured logging](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/core/logger.py): `api/core/logger.py`

### Analysis engines

- [AST scanner](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/engine/parser.py): `engine/parser.py`
- [Taint scanner](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/engine/semgrep_runner.py): `engine/semgrep_runner.py`
- [Taint rules](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/engine/taint_rules.yml): `engine/taint_rules.yml`
- [AI remediation](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/ai_module/analyzer.py): `ai_module/analyzer.py`

### Persistence

- [SQLite scan store](https://github.com/challengelotus/checkpoint4-cyber-sast-platform/blob/main/api/database.py): `api/database.py`

### Other components

- **User**
- **Semgrep executable**
- **Ollama LLM**

## Connections

- User → Dashboard router: uses (evidence: `README.md`)
- Dashboard router → Home page: routes to (evidence: `dashboard/app.py`)
- Dashboard router → Plan information: routes to (evidence: `dashboard/app.py`)
- Dashboard router → Login and signup: routes to (evidence: `dashboard/app.py`)
- Dashboard router → Audit and metrics: routes to (evidence: `dashboard/app.py`)
- Login and signup → API routes: calls auth routes (evidence: `dashboard/views/auth.py`)
- Audit and metrics → API routes: uploads code (evidence: `dashboard/views/panel.py`)
- Audit and metrics → API routes: requests history (evidence: `dashboard/views/panel.py`)
- API routes → Authentication security: uses auth helpers (evidence: `api/main.py`)
- API routes → Application settings: reads settings (evidence: `api/main.py`)
- API routes → Structured logging: logs requests (evidence: `api/main.py`)
- API routes → AST scanner: runs AST scan (evidence: `api/main.py`)
- API routes → Taint scanner: runs taint scan (evidence: `api/main.py`)
- API routes → AI remediation: requests premium review (evidence: `api/main.py`)
- API routes → SQLite scan store: stores and reads scans (evidence: `api/main.py`)
- Authentication security → SQLite scan store: queries users (evidence: `api/core/security.py`)
- Authentication security → Application settings: uses token settings (evidence: `api/core/security.py`)
- AI remediation → Ollama LLM: requests generation (evidence: `ai_module/analyzer.py`)
- AI remediation → Structured logging: logs AI activity (evidence: `ai_module/analyzer.py`)
- Taint scanner → Semgrep executable: runs scan (evidence: `engine/semgrep_runner.py`)
- Taint scanner → Taint rules: configures scan (evidence: `README.md`)
- API routes → SQLite scan store: creates schema (evidence: `api/main.py`)
