# tejanvk43/taxiq architecture

> Architecture diagram of the GitHub repository tejanvk43/taxiq, 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/tejanvk43/taxiq
- Repository: https://github.com/tejanvk43/taxiq

## Overview

TaxIQ is a GST-compliance and personal-tax intelligence platform with a Streamlit interface, FastAPI backend, optional asynchronous ingestion, and demo-capable storage/integrations. Users submit invoices or financial data, then receive structured filings, reconciliation and fraud findings, vendor risk results, tax recommendations, notices, and recovery tracking. The graph preserves the README’s major modules, including cross-layer deduction discovery, investment planning, audit trails, and WhatsApp filing. Some links reflect documented capabilities; sampled source confirms invoice processing and selected service wiring, but most domain engines and page implementations were not inspected.

Main entry points: [`backend/main.py`](https://github.com/tejanvk43/taxiq/blob/main/backend/main.py) (FastAPI backend), [`frontend/app.py`](https://github.com/tejanvk43/taxiq/blob/main/frontend/app.py) (Streamlit app), [`frontend/pages/3_📊_Tax_Saver.py`](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/3_%F0%9F%93%8A_Tax_Saver.py) (Tax saver), [`backend/agents/gst_agent.py`](https://github.com/tejanvk43/taxiq/blob/main/backend/agents/gst_agent.py) (Invoice intake)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User experience"]
  node_streamlit["Streamlit app<br/>[app.py]"]
  node_gst_filing["GST filing<br/>[1_📸_GST_Filing.py]"]
  node_fraud_view["Fraud graph"]
  node_tax_view["Tax saver<br/>[3_📊_Tax_Saver.py]"]
  node_recon_view["Reconciliation"]
  node_vendor_view["Vendor scores"]
  node_notice_view["Notice generator"]
  node_recovery_view["ITC recovery"]
  node_ingest_view["Data ingestion"]
  node_audit_view["Audit trail"]
  node_risk_view["Predictive risk"]
end

subgraph group_api["API and intake"]
  node_backend["FastAPI backend<br/>[main.py]"]
  node_invoice_intake["Invoice intake<br/>[gst_agent.py]"]
  node_ocr_parser["OCR and parsing<br/>[invoice_parser.py]"]
  node_ocr_engine["OCR engine<br/>[ocr_pipeline.py]"]
end

subgraph group_gst["GST intelligence"]
  node_gst_graph["Invoice graph<br/>[graph_builder.py]"]
  node_fraud_engine["Fraud detection<br/>[fraud_detector.py]"]
  node_reconciliation["GSTR reconciliation"]
  node_vendor_scoring["Vendor scoring<br/>[nexus_scorer.py]"]
  node_notice_engine["Notice drafting"]
  node_recovery_engine["ITC recovery<br/>[itc_recovery.py]"]
end

subgraph group_tax["Tax planning"]
  node_tax_agent["Tax saver agent<br/>[tax_saver_agent.py]"]
  node_tax_classifier["Transaction classifier<br/>[classifier.py]"]
  node_cross_layer["GST deduction discovery"]
  node_investment_calendar["Investment calendar"]
end

subgraph group_platform["Services and state"]
  node_gstn["GSTN service<br/>[gstn_client.py]"]
  node_whatsapp["WhatsApp bot<br/>[whatsapp_bot.py]"]
  node_llm["Gemini LLM client<br/>[llm_client.py]"]
  node_postgres[("PostgreSQL<br/>[postgres_client.py]")]
  node_neo4j[("Neo4j graph store<br/>[neo4j_client.py]")]
  node_celery["Async task queue<br/>[celery_app.py]"]
end

node_taxpayer(("Taxpayer"))

node_taxpayer -->|"uses"| node_streamlit
node_streamlit -->|"offers"| node_gst_filing
node_streamlit -->|"offers"| node_fraud_view
node_streamlit -->|"offers"| node_tax_view
node_streamlit -->|"offers"| node_recon_view
node_streamlit -->|"offers"| node_vendor_view
node_streamlit -->|"offers"| node_notice_view
node_streamlit -->|"offers"| node_recovery_view
node_streamlit -->|"offers"| node_ingest_view
node_streamlit -->|"offers"| node_audit_view
node_streamlit -->|"offers"| node_risk_view
node_gst_filing -.->|"submits invoice"| node_backend
node_fraud_view -.->|"requests analysis"| node_backend
node_tax_view -.->|"requests analysis"| node_backend
node_recon_view -.->|"requests matching"| node_backend
node_vendor_view -.->|"requests scores"| node_backend
node_notice_view -.->|"requests draft"| node_backend
node_recovery_view -.->|"requests pipeline"| node_backend
node_ingest_view -.->|"requests ingestion"| node_backend
node_audit_view -.->|"requests trail"| node_backend
node_risk_view -.->|"requests risk"| node_backend
node_backend -->|"routes invoice"| node_invoice_intake
node_invoice_intake -->|"parses invoice"| node_ocr_parser
node_ocr_parser -->|"extracts text"| node_ocr_engine
node_ocr_parser -->|"extracts fields"| node_llm
node_invoice_intake -->|"loads invoice graph"| node_gst_graph
node_invoice_intake -->|"stores invoice"| node_postgres
node_fraud_view -.->|"detects rings"| node_fraud_engine
node_recon_view -.->|"compares returns"| node_reconciliation
node_vendor_view -.->|"scores vendors"| node_vendor_scoring
node_notice_view -.->|"drafts notice"| node_notice_engine
node_recovery_view -.->|"tracks recovery"| node_recovery_engine
node_tax_view -.->|"analyzes finances"| node_tax_agent
node_tax_agent -.->|"classifies transactions"| node_tax_classifier
node_tax_view -.->|"finds deductions"| node_cross_layer
node_tax_view -.->|"plans investments"| node_investment_calendar
node_ingest_view -.->|"fetches tax data"| node_gstn
node_backend -->|"routes webhook"| node_whatsapp
node_whatsapp -->|"parses invoice"| node_ocr_parser
node_backend -.->|"queues ingestion"| node_celery
node_gst_graph -.->|"persists topology"| node_neo4j

click node_streamlit "https://github.com/tejanvk43/taxiq/blob/main/frontend/app.py"
click node_gst_filing "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/1_%F0%9F%93%B8_GST_Filing.py"
click node_fraud_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/2_%F0%9F%95%B8%EF%B8%8F_Fraud_Graph.py"
click node_tax_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/3_%F0%9F%93%8A_Tax_Saver.py"
click node_recon_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/4_%F0%9F%94%84_Reconciliation.py"
click node_vendor_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/5_%F0%9F%8F%A2_Vendor_Scores.py"
click node_notice_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/6_%F0%9F%93%A8_Notice_Generator.py"
click node_recovery_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/7_%F0%9F%93%8B_ITC_Recovery.py"
click node_ingest_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/8_%F0%9F%93%A5_Data_Ingestion.py"
click node_audit_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/9_%F0%9F%94%8D_Audit_Trail.py"
click node_risk_view "https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/10_%F0%9F%93%88_Predictive_Risk.py"
click node_backend "https://github.com/tejanvk43/taxiq/blob/main/backend/main.py"
click node_invoice_intake "https://github.com/tejanvk43/taxiq/blob/main/backend/agents/gst_agent.py"
click node_ocr_parser "https://github.com/tejanvk43/taxiq/blob/main/backend/pipelines/invoice_parser.py"
click node_ocr_engine "https://github.com/tejanvk43/taxiq/blob/main/backend/pipelines/ocr_pipeline.py"
click node_gst_graph "https://github.com/tejanvk43/taxiq/blob/main/backend/graph/graph_builder.py"
click node_fraud_engine "https://github.com/tejanvk43/taxiq/blob/main/backend/core/fraud_detector.py"
click node_reconciliation "https://github.com/tejanvk43/taxiq/blob/main/backend/core/reconciliation_engine.py"
click node_vendor_scoring "https://github.com/tejanvk43/taxiq/blob/main/backend/core/nexus_scorer.py"
click node_notice_engine "https://github.com/tejanvk43/taxiq/blob/main/backend/core/notice_generator.py"
click node_recovery_engine "https://github.com/tejanvk43/taxiq/blob/main/backend/core/itc_recovery.py"
click node_tax_agent "https://github.com/tejanvk43/taxiq/blob/main/backend/agents/tax_saver_agent.py"
click node_tax_classifier "https://github.com/tejanvk43/taxiq/blob/main/backend/tax_engine/classifier.py"
click node_cross_layer "https://github.com/tejanvk43/taxiq/blob/main/backend/tax_engine/cross_layer_enricher.py"
click node_investment_calendar "https://github.com/tejanvk43/taxiq/blob/main/backend/tax_engine/investment_calendar.py"
click node_gstn "https://github.com/tejanvk43/taxiq/blob/main/backend/services/gstn_client.py"
click node_whatsapp "https://github.com/tejanvk43/taxiq/blob/main/backend/utils/whatsapp_bot.py"
click node_llm "https://github.com/tejanvk43/taxiq/blob/main/backend/utils/llm_client.py"
click node_postgres "https://github.com/tejanvk43/taxiq/blob/main/backend/database/postgres_client.py"
click node_neo4j "https://github.com/tejanvk43/taxiq/blob/main/backend/graph/neo4j_client.py"
click node_celery "https://github.com/tejanvk43/taxiq/blob/main/backend/tasks/celery_app.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_streamlit,node_gst_filing,node_fraud_view,node_tax_view,node_recon_view,node_vendor_view,node_notice_view,node_recovery_view,node_ingest_view,node_audit_view,node_risk_view toneBlue
class node_backend,node_invoice_intake,node_ocr_parser,node_ocr_engine toneAmber
class node_gst_graph,node_fraud_engine,node_reconciliation,node_vendor_scoring,node_notice_engine,node_recovery_engine toneMint
class node_tax_agent,node_tax_classifier,node_cross_layer,node_investment_calendar toneRose
class node_gstn,node_whatsapp,node_llm,node_postgres,node_neo4j,node_celery,node_taxpayer toneIndigo
```

## Components

### User experience

- [Streamlit app](https://github.com/tejanvk43/taxiq/blob/main/frontend/app.py): `frontend/app.py`
- [GST filing](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/1_%F0%9F%93%B8_GST_Filing.py): `frontend/pages/1_📸_GST_Filing.py`
- [Fraud graph](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/2_%F0%9F%95%B8%EF%B8%8F_Fraud_Graph.py): `frontend/pages/2_🕸️_Fraud_Graph.py`
- [Tax saver](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/3_%F0%9F%93%8A_Tax_Saver.py): `frontend/pages/3_📊_Tax_Saver.py`
- [Reconciliation](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/4_%F0%9F%94%84_Reconciliation.py): `frontend/pages/4_🔄_Reconciliation.py`
- [Vendor scores](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/5_%F0%9F%8F%A2_Vendor_Scores.py): `frontend/pages/5_🏢_Vendor_Scores.py`
- [Notice generator](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/6_%F0%9F%93%A8_Notice_Generator.py): `frontend/pages/6_📨_Notice_Generator.py`
- [ITC recovery](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/7_%F0%9F%93%8B_ITC_Recovery.py): `frontend/pages/7_📋_ITC_Recovery.py`
- [Data ingestion](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/8_%F0%9F%93%A5_Data_Ingestion.py): `frontend/pages/8_📥_Data_Ingestion.py`
- [Audit trail](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/9_%F0%9F%94%8D_Audit_Trail.py): `frontend/pages/9_🔍_Audit_Trail.py`
- [Predictive risk](https://github.com/tejanvk43/taxiq/blob/main/frontend/pages/10_%F0%9F%93%88_Predictive_Risk.py): `frontend/pages/10_📈_Predictive_Risk.py`

### API and intake

- [FastAPI backend](https://github.com/tejanvk43/taxiq/blob/main/backend/main.py): `backend/main.py`
- [Invoice intake](https://github.com/tejanvk43/taxiq/blob/main/backend/agents/gst_agent.py): `backend/agents/gst_agent.py`
- [OCR and parsing](https://github.com/tejanvk43/taxiq/blob/main/backend/pipelines/invoice_parser.py): `backend/pipelines/invoice_parser.py`
- [OCR engine](https://github.com/tejanvk43/taxiq/blob/main/backend/pipelines/ocr_pipeline.py): `backend/pipelines/ocr_pipeline.py`

### GST intelligence

- [Invoice graph](https://github.com/tejanvk43/taxiq/blob/main/backend/graph/graph_builder.py): `backend/graph/graph_builder.py`
- [Fraud detection](https://github.com/tejanvk43/taxiq/blob/main/backend/core/fraud_detector.py): `backend/core/fraud_detector.py`
- [GSTR reconciliation](https://github.com/tejanvk43/taxiq/blob/main/backend/core/reconciliation_engine.py): `backend/core/reconciliation_engine.py`
- [Vendor scoring](https://github.com/tejanvk43/taxiq/blob/main/backend/core/nexus_scorer.py): `backend/core/nexus_scorer.py`
- [Notice drafting](https://github.com/tejanvk43/taxiq/blob/main/backend/core/notice_generator.py): `backend/core/notice_generator.py`
- [ITC recovery](https://github.com/tejanvk43/taxiq/blob/main/backend/core/itc_recovery.py): `backend/core/itc_recovery.py`

### Tax planning

- [Tax saver agent](https://github.com/tejanvk43/taxiq/blob/main/backend/agents/tax_saver_agent.py): `backend/agents/tax_saver_agent.py`
- [Transaction classifier](https://github.com/tejanvk43/taxiq/blob/main/backend/tax_engine/classifier.py): `backend/tax_engine/classifier.py`
- [GST deduction discovery](https://github.com/tejanvk43/taxiq/blob/main/backend/tax_engine/cross_layer_enricher.py): `backend/tax_engine/cross_layer_enricher.py`
- [Investment calendar](https://github.com/tejanvk43/taxiq/blob/main/backend/tax_engine/investment_calendar.py): `backend/tax_engine/investment_calendar.py`

### Services and state

- [GSTN service](https://github.com/tejanvk43/taxiq/blob/main/backend/services/gstn_client.py): `backend/services/gstn_client.py`
- [WhatsApp bot](https://github.com/tejanvk43/taxiq/blob/main/backend/utils/whatsapp_bot.py): `backend/utils/whatsapp_bot.py`
- [Gemini LLM client](https://github.com/tejanvk43/taxiq/blob/main/backend/utils/llm_client.py): `backend/utils/llm_client.py`
- [PostgreSQL](https://github.com/tejanvk43/taxiq/blob/main/backend/database/postgres_client.py): `backend/database/postgres_client.py`
- [Neo4j graph store](https://github.com/tejanvk43/taxiq/blob/main/backend/graph/neo4j_client.py): `backend/graph/neo4j_client.py`
- [Async task queue](https://github.com/tejanvk43/taxiq/blob/main/backend/tasks/celery_app.py): `backend/tasks/celery_app.py`

### Other components

- **Taxpayer**

## Connections

- Taxpayer → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → GST filing: offers (evidence: `README.md`)
- Streamlit app → Fraud graph: offers (evidence: `README.md`)
- Streamlit app → Tax saver: offers (evidence: `README.md`)
- Streamlit app → Reconciliation: offers (evidence: `README.md`)
- Streamlit app → Vendor scores: offers (evidence: `README.md`)
- Streamlit app → Notice generator: offers (evidence: `README.md`)
- Streamlit app → ITC recovery: offers (evidence: `README.md`)
- Streamlit app → Data ingestion: offers (evidence: `README.md`)
- Streamlit app → Audit trail: offers (evidence: `README.md`)
- Streamlit app → Predictive risk: offers (evidence: `README.md`)
- GST filing → FastAPI backend: submits invoice (evidence: `README.md`)
- Fraud graph → FastAPI backend: requests analysis (evidence: `README.md`)
- Tax saver → FastAPI backend: requests analysis (evidence: `README.md`)
- Reconciliation → FastAPI backend: requests matching (evidence: `README.md`)
- Vendor scores → FastAPI backend: requests scores (evidence: `README.md`)
- Notice generator → FastAPI backend: requests draft (evidence: `README.md`)
- ITC recovery → FastAPI backend: requests pipeline (evidence: `README.md`)
- Data ingestion → FastAPI backend: requests ingestion (evidence: `README.md`)
- Audit trail → FastAPI backend: requests trail (evidence: `README.md`)
- Predictive risk → FastAPI backend: requests risk (evidence: `README.md`)
- FastAPI backend → Invoice intake: routes invoice (evidence: `backend/main.py`)
- Invoice intake → OCR and parsing: parses invoice (evidence: `backend/agents/gst_agent.py`)
- OCR and parsing → OCR engine: extracts text (evidence: `backend/pipelines/invoice_parser.py`)
- OCR and parsing → Gemini LLM client: extracts fields (evidence: `backend/pipelines/invoice_parser.py`)
- Invoice intake → Invoice graph: loads invoice graph (evidence: `backend/agents/gst_agent.py`)
- Invoice intake → PostgreSQL: stores invoice (evidence: `backend/agents/gst_agent.py`)
- Fraud graph → Fraud detection: detects rings (evidence: `README.md`)
- Reconciliation → GSTR reconciliation: compares returns (evidence: `README.md`)
- Vendor scores → Vendor scoring: scores vendors (evidence: `README.md`)
- Notice generator → Notice drafting: drafts notice (evidence: `README.md`)
- ITC recovery → ITC recovery: tracks recovery (evidence: `README.md`)
- Tax saver → Tax saver agent: analyzes finances (evidence: `README.md`)
- Tax saver agent → Transaction classifier: classifies transactions (evidence: `README.md`)
- Tax saver → GST deduction discovery: finds deductions (evidence: `README.md`)
- Tax saver → Investment calendar: plans investments (evidence: `README.md`)
- Data ingestion → GSTN service: fetches tax data (evidence: `README.md`)
- FastAPI backend → WhatsApp bot: routes webhook (evidence: `backend/main.py`)
- WhatsApp bot → OCR and parsing: parses invoice (evidence: `backend/utils/whatsapp_bot.py`)
- FastAPI backend → Async task queue: queues ingestion (evidence: `README.md`)
- Invoice graph → Neo4j graph store: persists topology (evidence: `README.md`)
