# tharunpalle/truth-lens architecture

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

- Interactive diagram: https://gitdiagram.com/tharunpalle/truth-lens
- Repository: https://github.com/tharunpalle/truth-lens

## Overview

Truth Lens is a Flask application foundation, not yet a verification product: its principal workflow is an HTTP request entering the app, being handled by a registered page route or health endpoint, and receiving a page or JSON response. The scaffold also provides configuration, reusable component and model bases, a service contract, and shared utilities. The README documents public assets and UI partials, but this foundation does not show them wired to a verification pipeline. Links for unsampled capabilities follow README statements; implementation details are not inferred.

Main entry points: [`src/app.py`](https://github.com/tharunpalle/truth-lens/blob/main/src/app.py) (Flask App), [`src/pages/routes.py`](https://github.com/tharunpalle/truth-lens/blob/main/src/pages/routes.py) (Page Routes), [`src/utils/logger.py`](https://github.com/tharunpalle/truth-lens/blob/main/src/utils/logger.py) (Logging), [`src/config/settings.py`](https://github.com/tharunpalle/truth-lens/blob/main/src/config/settings.py) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Runtime"]
  node_app["Flask App<br/>[app.py]"]
  node_routes["Page Routes<br/>[routes.py]"]
  node_public["Public Files"]
end

subgraph group_foundation["Application Foundation"]
  node_settings["Settings<br/>[settings.py]"]
  node_components["UI Components<br/>[base_component.py]"]
  node_models["Base Models<br/>[base_model.py]"]
  node_services["Base Services<br/>[base_service.py]"]
end

subgraph group_shared["Shared Primitives"]
  node_helpers["Response Helpers<br/>[helpers.py]"]
  node_logger["Logging<br/>[logger.py]"]
end

node_visitor(("HTTP Client"))

node_visitor -->|"sends request"| node_app
node_app -->|"registers blueprint"| node_routes
node_visitor -->|"requests page"| node_routes
node_routes -->|"serves landing page"| node_public
node_app -->|"serves static files"| node_public
node_app -->|"loads settings"| node_settings
node_app -->|"gets logger"| node_logger
node_app -->|"shapes responses"| node_helpers
node_routes -->|"reads settings"| node_settings
node_routes -->|"shapes responses"| node_helpers
node_models -->|"gets timestamp"| node_helpers
node_services -->|"gets logger"| node_logger
node_logger -->|"reads log level"| node_settings

click node_app "https://github.com/tharunpalle/truth-lens/blob/main/src/app.py"
click node_routes "https://github.com/tharunpalle/truth-lens/blob/main/src/pages/routes.py"
click node_public "https://github.com/tharunpalle/truth-lens/tree/main/public"
click node_settings "https://github.com/tharunpalle/truth-lens/blob/main/src/config/settings.py"
click node_components "https://github.com/tharunpalle/truth-lens/blob/main/src/components/base_component.py"
click node_models "https://github.com/tharunpalle/truth-lens/blob/main/src/models/base_model.py"
click node_services "https://github.com/tharunpalle/truth-lens/blob/main/src/services/base_service.py"
click node_helpers "https://github.com/tharunpalle/truth-lens/blob/main/src/utils/helpers.py"
click node_logger "https://github.com/tharunpalle/truth-lens/blob/main/src/utils/logger.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_routes,node_public,node_visitor toneBlue
class node_settings,node_components,node_models,node_services toneAmber
class node_helpers,node_logger toneMint
```

## Components

### Web Runtime

- [Flask App](https://github.com/tharunpalle/truth-lens/blob/main/src/app.py): `src/app.py`
- [Page Routes](https://github.com/tharunpalle/truth-lens/blob/main/src/pages/routes.py): `src/pages/routes.py`
- [Public Files](https://github.com/tharunpalle/truth-lens/tree/main/public): `public`

### Application Foundation

- [Settings](https://github.com/tharunpalle/truth-lens/blob/main/src/config/settings.py): `src/config/settings.py`
- [UI Components](https://github.com/tharunpalle/truth-lens/blob/main/src/components/base_component.py): `src/components/base_component.py`
- [Base Models](https://github.com/tharunpalle/truth-lens/blob/main/src/models/base_model.py): `src/models/base_model.py`
- [Base Services](https://github.com/tharunpalle/truth-lens/blob/main/src/services/base_service.py): `src/services/base_service.py`

### Shared Primitives

- [Response Helpers](https://github.com/tharunpalle/truth-lens/blob/main/src/utils/helpers.py): `src/utils/helpers.py`
- [Logging](https://github.com/tharunpalle/truth-lens/blob/main/src/utils/logger.py): `src/utils/logger.py`

### Other components

- **HTTP Client**

## Connections

- HTTP Client → Flask App: sends request (evidence: `README.md`)
- Flask App → Page Routes: registers blueprint (evidence: `src/app.py`)
- HTTP Client → Page Routes: requests page (evidence: `README.md`)
- Page Routes → Public Files: serves landing page (evidence: `src/pages/routes.py`)
- Flask App → Public Files: serves static files (evidence: `README.md`)
- Flask App → Settings: loads settings (evidence: `src/app.py`)
- Flask App → Logging: gets logger (evidence: `src/app.py`)
- Flask App → Response Helpers: shapes responses (evidence: `src/app.py`)
- Page Routes → Settings: reads settings (evidence: `src/pages/routes.py`)
- Page Routes → Response Helpers: shapes responses (evidence: `src/pages/routes.py`)
- Base Models → Response Helpers: gets timestamp (evidence: `src/models/base_model.py`)
- Base Services → Logging: gets logger (evidence: `src/services/base_service.py`)
- Logging → Settings: reads log level (evidence: `src/utils/logger.py`)
