# vineshf1/prova architecture

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

- Interactive diagram: https://gitdiagram.com/vineshf1/prova
- Repository: https://github.com/vineshf1/prova

## Overview

Prova turns a user’s PDFs into searchable, page-cited answers and extracted deadlines, then supports tasks, notifications, sharing, and approval-gated actions. The main workflow runs from upload through asynchronous parsing and indexing to chat retrieval and cited responses. The graph also shows account access, task/notification management, and billing and privacy capabilities documented in the README. Some routes and integrations are represented only by their enclosing source directories because their implementations were not sampled; those links are omitted where wiring is uncertain.

Main entry points: [`frontend/src/lib/api.ts`](https://github.com/vineshf1/prova/blob/main/frontend/src/lib/api.ts) (API client), [`backend/app/tasks/ingestion.py`](https://github.com/vineshf1/prova/blob/main/backend/app/tasks/ingestion.py) (Ingestion pipeline), [`backend/app/agent/tools.py`](https://github.com/vineshf1/prova/blob/main/backend/app/agent/tools.py) (Search and tools), [`frontend/src/app/page.tsx`](https://github.com/vineshf1/prova/blob/main/frontend/src/app/page.tsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_chat_ui["Chat pane<br/>[ChatPane.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_stream_client["Chat SSE client<br/>[sse.ts]"]
end

subgraph group_ingestion["Document ingestion"]
  node_document_routes["Document routes<br/>[documents.py]"]
  node_worker["Ingestion worker<br/>[worker.py]"]
  node_ingestion_task["Ingestion pipeline<br/>[ingestion.py]"]
  node_parser["PDF parsing<br/>[ingestion.py]"]
end

subgraph group_answers["Search and answers"]
  node_chat_routes["Chat routes<br/>[chat.py]"]
  node_agent_loop["Agent loop<br/>[loop.py]"]
  node_agent_graph["Approval graph<br/>[graph.py]"]
  node_agent_tools["Search and tools<br/>[tools.py]"]
end

subgraph group_actions["Tasks and approvals"]
  node_task_routes["Task management<br/>[tasks.py]"]
  node_pending_routes["Pending actions<br/>[pending_actions.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
end

subgraph group_account["Account and services"]
  node_auth_routes["Authentication<br/>[auth.py]"]
  node_billing["Billing<br/>[billing.py]"]
  node_sharing["Document sharing"]
  node_privacy["Privacy controls<br/>[privacy.py]"]
  node_database_layer["Tenant data access<br/>[database.py]"]
end

node_user(("User"))
node_nim{{"NVIDIA NIM"}}
node_db[("Postgres and pgvector")]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"calls API"| node_api_client
node_dashboard -->|"opens chat"| node_chat_ui
node_chat_ui -->|"streams chat"| node_stream_client
node_api_client -->|"auth requests"| node_auth_routes
node_api_client -->|"document requests"| node_document_routes
node_api_client -->|"chat requests"| node_chat_routes
node_api_client -->|"task requests"| node_task_routes
node_api_client -->|"approval requests"| node_pending_routes
node_api_client -->|"notification requests"| node_notifications
node_api_client -->|"billing requests"| node_billing
node_api_client -->|"privacy requests"| node_privacy
node_document_routes -->|"dispatches async job"| node_worker
node_worker -->|"runs pipeline"| node_ingestion_task
node_ingestion_task -->|"parses and chunks"| node_parser
node_ingestion_task -->|"embeds and extracts"| node_nim
node_ingestion_task -->|"writes document data"| node_db
node_ingestion_task -->|"drafts deadline task"| node_task_routes
node_ingestion_task -->|"publishes updates"| node_notifications
node_chat_routes -->|"runs conversation"| node_agent_graph
node_agent_graph -->|"dispatches turn"| node_agent_loop
node_agent_loop -->|"invokes tools"| node_agent_tools
node_agent_loop -->|"requests answer"| node_nim
node_agent_tools -->|"searches documents"| node_db
node_agent_tools -->|"embeds queries"| node_nim
node_agent_tools -->|"creates pending actions"| node_pending_routes
node_agent_graph -.->|"checkpoints state"| node_db
node_database_layer -->|"scopes tenant access"| node_db
node_task_routes -->|"reads and updates tasks"| node_db
node_pending_routes -->|"stores decisions"| node_db
node_notifications -->|"reads notifications"| node_db
node_sharing -->|"stores share access"| node_db
node_billing -.->|"optional payment integration"| node_nim
node_chat_ui -->|"renders progress"| node_stream_client

click node_dashboard "https://github.com/vineshf1/prova/blob/main/frontend/src/app/page.tsx"
click node_chat_ui "https://github.com/vineshf1/prova/blob/main/frontend/src/components/ChatPane.tsx"
click node_api_client "https://github.com/vineshf1/prova/blob/main/frontend/src/lib/api.ts"
click node_stream_client "https://github.com/vineshf1/prova/blob/main/frontend/src/lib/sse.ts"
click node_auth_routes "https://github.com/vineshf1/prova/blob/main/backend/app/routers/auth.py"
click node_document_routes "https://github.com/vineshf1/prova/blob/main/backend/app/routers/documents.py"
click node_worker "https://github.com/vineshf1/prova/blob/main/backend/app/tasks/worker.py"
click node_ingestion_task "https://github.com/vineshf1/prova/blob/main/backend/app/tasks/ingestion.py"
click node_parser "https://github.com/vineshf1/prova/blob/main/backend/app/ingestion.py"
click node_chat_routes "https://github.com/vineshf1/prova/blob/main/backend/app/routers/chat.py"
click node_agent_loop "https://github.com/vineshf1/prova/blob/main/backend/app/agent/loop.py"
click node_agent_graph "https://github.com/vineshf1/prova/blob/main/backend/app/agent/graph.py"
click node_agent_tools "https://github.com/vineshf1/prova/blob/main/backend/app/agent/tools.py"
click node_task_routes "https://github.com/vineshf1/prova/blob/main/backend/app/routers/tasks.py"
click node_pending_routes "https://github.com/vineshf1/prova/blob/main/backend/app/routers/pending_actions.py"
click node_notifications "https://github.com/vineshf1/prova/blob/main/backend/app/routers/notifications.py"
click node_billing "https://github.com/vineshf1/prova/blob/main/backend/app/routers/billing.py"
click node_sharing "https://github.com/vineshf1/prova/tree/main/backend/app/routers"
click node_privacy "https://github.com/vineshf1/prova/blob/main/backend/app/routers/privacy.py"
click node_database_layer "https://github.com/vineshf1/prova/blob/main/backend/app/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_dashboard,node_chat_ui,node_api_client,node_stream_client,node_user toneBlue
class node_document_routes,node_worker,node_ingestion_task,node_parser,node_db toneAmber
class node_chat_routes,node_agent_loop,node_agent_graph,node_agent_tools toneMint
class node_task_routes,node_pending_routes,node_notifications toneRose
class node_auth_routes,node_billing,node_sharing,node_privacy,node_database_layer,node_nim toneIndigo
```

## Components

### User experience

- [Dashboard](https://github.com/vineshf1/prova/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Chat pane](https://github.com/vineshf1/prova/blob/main/frontend/src/components/ChatPane.tsx): `frontend/src/components/ChatPane.tsx`
- [API client](https://github.com/vineshf1/prova/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Chat SSE client](https://github.com/vineshf1/prova/blob/main/frontend/src/lib/sse.ts): `frontend/src/lib/sse.ts`

### Document ingestion

- [Document routes](https://github.com/vineshf1/prova/blob/main/backend/app/routers/documents.py): `backend/app/routers/documents.py`
- [Ingestion worker](https://github.com/vineshf1/prova/blob/main/backend/app/tasks/worker.py): `backend/app/tasks/worker.py`
- [Ingestion pipeline](https://github.com/vineshf1/prova/blob/main/backend/app/tasks/ingestion.py): `backend/app/tasks/ingestion.py`
- [PDF parsing](https://github.com/vineshf1/prova/blob/main/backend/app/ingestion.py): `backend/app/ingestion.py`

### Search and answers

- [Chat routes](https://github.com/vineshf1/prova/blob/main/backend/app/routers/chat.py): `backend/app/routers/chat.py`
- [Agent loop](https://github.com/vineshf1/prova/blob/main/backend/app/agent/loop.py): `backend/app/agent/loop.py`
- [Approval graph](https://github.com/vineshf1/prova/blob/main/backend/app/agent/graph.py): `backend/app/agent/graph.py`
- [Search and tools](https://github.com/vineshf1/prova/blob/main/backend/app/agent/tools.py): `backend/app/agent/tools.py`

### Tasks and approvals

- [Task management](https://github.com/vineshf1/prova/blob/main/backend/app/routers/tasks.py): `backend/app/routers/tasks.py`
- [Pending actions](https://github.com/vineshf1/prova/blob/main/backend/app/routers/pending_actions.py): `backend/app/routers/pending_actions.py`
- [Notifications](https://github.com/vineshf1/prova/blob/main/backend/app/routers/notifications.py): `backend/app/routers/notifications.py`

### Account and services

- [Authentication](https://github.com/vineshf1/prova/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Billing](https://github.com/vineshf1/prova/blob/main/backend/app/routers/billing.py): `backend/app/routers/billing.py`
- [Document sharing](https://github.com/vineshf1/prova/tree/main/backend/app/routers): `backend/app/routers`
- [Privacy controls](https://github.com/vineshf1/prova/blob/main/backend/app/routers/privacy.py): `backend/app/routers/privacy.py`
- [Tenant data access](https://github.com/vineshf1/prova/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **User**
- **NVIDIA NIM**
- **Postgres and pgvector**

## Connections

- User → Dashboard: uses
- Dashboard → API client: calls API
- Dashboard → Chat pane: opens chat
- Chat pane → Chat SSE client: streams chat
- API client → Authentication: auth requests
- API client → Document routes: document requests
- API client → Chat routes: chat requests
- API client → Task management: task requests
- API client → Pending actions: approval requests
- API client → Notifications: notification requests
- API client → Billing: billing requests
- API client → Privacy controls: privacy requests
- Document routes → Ingestion worker: dispatches async job
- Ingestion worker → Ingestion pipeline: runs pipeline
- Ingestion pipeline → PDF parsing: parses and chunks
- Ingestion pipeline → NVIDIA NIM: embeds and extracts
- Ingestion pipeline → Postgres and pgvector: writes document data
- Ingestion pipeline → Task management: drafts deadline task
- Ingestion pipeline → Notifications: publishes updates
- Chat routes → Approval graph: runs conversation
- Approval graph → Agent loop: dispatches turn
- Agent loop → Search and tools: invokes tools
- Agent loop → NVIDIA NIM: requests answer
- Search and tools → Postgres and pgvector: searches documents
- Search and tools → NVIDIA NIM: embeds queries
- Search and tools → Pending actions: creates pending actions
- Approval graph → Postgres and pgvector: checkpoints state
- Tenant data access → Postgres and pgvector: scopes tenant access
- Task management → Postgres and pgvector: reads and updates tasks
- Pending actions → Postgres and pgvector: stores decisions
- Notifications → Postgres and pgvector: reads notifications
- Document sharing → Postgres and pgvector: stores share access
- Billing → NVIDIA NIM: optional payment integration
- Chat pane → Chat SSE client: renders progress
