# maniteja-godugu/ai-text-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/maniteja-godugu/ai-text-analyzer
- Repository: https://github.com/maniteja-godugu/ai-text-analyzer

## Overview

ai-text-analyzer is a FastAPI text-analysis service. A client submits text, the API validates the request, obtains structured analysis from Gemini, stores selected fields, and returns the analysis. Separate history endpoints list, retrieve, and delete stored records. The graph also shows request/response models, SQLite access, and logging setup. Relationships are based on the provided excerpts; no additional behavior is inferred from unsampled files.

Main entry points: [`app/api.py`](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/api.py) (API routes), [`app/LLM.py`](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/LLM.py) (LLM analysis call), [`app/operations.py`](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/operations.py) (History operations), [`app/db_connection.py`](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/db_connection.py) (SQLite connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_api_routes["API routes<br/>[api.py]"]
  node_request_models["Request models<br/>[validation.py]"]
  node_logging["Logging setup<br/>[logging_config.py]"]
end

subgraph group_analysis["Analysis"]
  node_llm_call["LLM analysis call<br/>[LLM.py]"]
  node_analysis_schema["Analysis schema<br/>[LLM.py]"]
end

subgraph group_history["History and storage"]
  node_history_ops["History operations<br/>[operations.py]"]
  node_db_connection["SQLite connection<br/>[db_connection.py]"]
  node_sqlite_store[("SQLite database")]
end

node_client(("Client"))
node_gemini{{"Gemini API"}}

node_client -->|"submits requests"| node_api_routes
node_api_routes -->|"validates input"| node_request_models
node_api_routes -->|"requests analysis"| node_llm_call
node_llm_call -->|"sends prompt"| node_gemini
node_llm_call -->|"validates result"| node_analysis_schema
node_api_routes -->|"stores and retrieves"| node_history_ops
node_history_ops -->|"opens connection"| node_db_connection
node_db_connection -->|"creates and connects"| node_sqlite_store
node_api_routes -->|"configures logging"| node_logging

click node_api_routes "https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/api.py"
click node_request_models "https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/validation.py"
click node_logging "https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/logging_config.py"
click node_llm_call "https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/LLM.py"
click node_analysis_schema "https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/LLM.py"
click node_history_ops "https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/operations.py"
click node_db_connection "https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/db_connection.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_api_routes,node_request_models,node_logging,node_client toneBlue
class node_llm_call,node_analysis_schema toneAmber
class node_history_ops,node_db_connection,node_sqlite_store,node_gemini toneMint
```

## Components

### API

- [API routes](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/api.py): `app/api.py`
- [Request models](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/validation.py): `app/validation.py`
- [Logging setup](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/logging_config.py): `app/logging_config.py`

### Analysis

- [LLM analysis call](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/LLM.py): `app/LLM.py`
- [Analysis schema](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/LLM.py): `app/LLM.py`

### History and storage

- [History operations](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/operations.py): `app/operations.py`
- [SQLite connection](https://github.com/maniteja-godugu/ai-text-analyzer/blob/main/app/db_connection.py): `app/db_connection.py`
- **SQLite database**

### Other components

- **Client**
- **Gemini API**

## Connections

- Client → API routes: submits requests (evidence: `app/api.py`)
- API routes → Request models: validates input (evidence: `app/api.py`)
- API routes → LLM analysis call: requests analysis (evidence: `app/api.py`)
- LLM analysis call → Gemini API: sends prompt (evidence: `app/LLM.py`)
- LLM analysis call → Analysis schema: validates result (evidence: `app/LLM.py`)
- API routes → History operations: stores and retrieves (evidence: `app/api.py`)
- History operations → SQLite connection: opens connection (evidence: `app/operations.py`)
- SQLite connection → SQLite database: creates and connects (evidence: `app/db_connection.py`)
- API routes → Logging setup: configures logging (evidence: `app/api.py`)
