# soumya9679/codeflow2026-neural-nexus-cortex-finance architecture

> Architecture diagram of the GitHub repository soumya9679/codeflow2026-neural-nexus-cortex-finance, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/soumya9679/codeflow2026-neural-nexus-cortex-finance
- Repository: https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance

## Overview

1. **Repository shape**
   - This is a monorepo with three client surfaces and one shared backend: a **React web app**, a **React Native/Expo mobile app**, and a **FastAPI Python backend**.
   - The backend is the system-of-record for statement ingestion, analytics, and AI responses.

2. **Backend entrypoint and API boundary**
   - `app/main.py` is the FastAPI bootstrap point.
   - The backend is organized by route boundaries: `auth`, `upload`, `dashboard`, `insights`, and `chat`.
   - These routes expose the domain API that both web and mobile clients consume.

3. **Statement ingestion pipeline**
   - Uploaded bank statements enter through the `upload` route.
   - Parsing is split by file type in `app/services/csv_parser.py` and `app/services/pdf_parser.py`.
   - Raw records are normalized and cleaned in `cleaner.py`, then classified/mapped into finance categories via `category_mapper.py`.

4. **Analytics and transaction intelligence**
   - Once transactions are normalized, `analytics.py` computes the user-facing metrics.
   - `recurring_detector.py` identifies repeated payments such as subscriptions or EMIs.
   - `anomaly_detector.py` flags unusual spending patterns, likely using the isolation-forest approach described in the README.

5. **AI generation layer**
   - The `app/ai` package contains the LLM-facing generators: `summary_generator.py`, `insight_generator.py`, and `gemini_classifier.py`.
   - This layer turns transaction aggregates and detected patterns into narrative summaries and financial insights.
   - `app/utils/ollama_client.py` indicates there is also an abstraction for local/model-server access, separate from the Gemini-backed flows.

6. **RAG chatbot subsystem**
   - `app/rag/chatbot.py`, `retriever.py`, and `vector_store.py` form a standalone conversational financial assistant.
   - A prebuilt FAISS index lives under `app/rag/faiss_index/`, showing the RAG corpus is persisted locally rather than computed on every request.
   - The chatbot route likely queries this retrieval layer with transaction context and then uses Gemini to generate the final answer.

7. **Persistence and shared data model**
   - `app/database/db.py` centralizes database access for the backend.
   - `app/models/schemas.py` defines the request/response contracts shared across endpoints.
   - The repo README references SQLite, while the presence of a Neon test suggests the database layer is abstracted enough to support a managed SQL backend as well.

8. **Authentication and security boundary**
   - Auth is separated into `app/routes/auth.py` and utility helpers in `app/utils/auth.py`.
   - The backend likely issues or validates tokens before allowing access to chat, upload, and analytics endpoints.
   - Tests such as `test_auth_backend.py` and `test_chat_endpoint_auth.py` indicate auth is a first-class boundary, not an afterthought.

9. **Web frontend architecture**
   - `cortex-finance-frontend` is a React SPA with page-level views in `src/pages` and reusable UI pieces in `src/components`.
   - It includes dashboard, upload, login/signup, settings, landing, and chatbot screens, mirroring the backend domain areas.
   - `src/api/mockService.js` suggests the UI can run against mocked data, which helps decouple UI development from backend availability.

10. **Mobile app architecture**
   - `cortex-finance-mobile` is an Expo/React Native app using the `app/` router structure plus shared components in `src/components`.
   - It has its own auth context, storage utilities, and API service layer in `src/services`.
   - This client is a separate presentation layer, but it depends on the same backend concepts: authentication, transactions, dashboard views, and chat.

11. **End-to-end data flow**
   - The main flow is: **upload statement → parse/clean/categorize → persist transactions → compute analytics → generate insights/summaries → answer chat questions via RAG**.
   - Dashboard and insight pages consume computed aggregates, while the chatbot consumes both the transaction corpus and the FAISS retrieval index.
   - Web and mobile are thin clients over this backend pipeline.

12. **Operational notes**
   - The backend is container-ready via `Dockerfile`.
   - Tests are present for auth, chat auth, database connectivity, classifier behavior, and indexing, which reflects the major subsystem boundaries.
   - The repo is optimized for a hackathon-style AI finance product: relatively small service surface, explicit AI/RAG components, and precomputed retrieval assets.

Main entry points: [`cortex-finance-backend/app/main.py`](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/main.py) (API app), [`cortex-finance-frontend/src/App.js`](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/App.js) (Web app), [`cortex-finance-backend/app/routes/chat.py`](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/chat.py) (Chat API), [`cortex-finance-backend/app/services/analytics.py`](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/analytics.py) (Analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Backend"]
  node_main["API app<br/>fastapi bootstrap<br/>[main.py]"]
  node_auth_route["Auth API<br/>route<br/>[auth.py]"]
  node_upload_route["Upload API<br/>route<br/>[upload.py]"]
  node_dashboard_route["Dashboard API<br/>route<br/>[dashboard.py]"]
  node_insights_route["Insights API<br/>route<br/>[insights.py]"]
  node_chat_route["Chat API<br/>route<br/>[chat.py]"]
  node_parsing["Parsers<br/>ingestion stage"]
  node_csv_parser["CSV parser<br/>[csv_parser.py]"]
  node_pdf_parser["PDF parser<br/>[pdf_parser.py]"]
  node_cleaner["Cleaner<br/>normalizer<br/>[cleaner.py]"]
  node_category_mapper["Category mapper<br/>classifier<br/>[category_mapper.py]"]
  node_analytics["Analytics<br/>metrics engine<br/>[analytics.py]"]
  node_recurring_detector["Recurring detector<br/>pattern detector"]
  node_anomaly_detector["Anomaly detector<br/>outlier model"]
  node_ai_layer["AI layer<br/>llm generation"]
  node_summary_generator["Summary gen<br/>generator"]
  node_insight_generator["Insight gen<br/>generator"]
  node_gemini_classifier["Gemini classifier<br/>llm classifier"]
  node_rag_chatbot["RAG chatbot<br/>retrieval assistant<br/>[chatbot.py]"]
  node_retriever["Retriever<br/>retrieval<br/>[retriever.py]"]
  node_vector_store[("Vector store<br/>index store<br/>[vector_store.py]")]
  node_db[("Database<br/>persistence<br/>[db.py]")]
  node_schemas["Schemas<br/>contracts<br/>[schemas.py]"]
end

subgraph group_web["Web App"]
  node_web_app["Web app<br/>react spa<br/>[App.js]"]
  node_web_pages["Pages<br/>views<br/>[Dashboard.js]"]
  node_web_components["UI components<br/>[Charts.js]"]
  node_web_mock["Mock service<br/>api mock<br/>[mockService.js]"]
end

subgraph group_mobile["Mobile App"]
  node_mobile_app["Mobile app<br/>expo client<br/>[App.tsx]"]
  node_mobile_routes["App routes<br/>navigator<br/>[_layout.tsx]"]
  node_mobile_auth["Auth context<br/>state<br/>[AuthContext.tsx]"]
  node_mobile_api["API service<br/>client api<br/>[api.ts]"]
end

node_main -->|"mounts"| node_auth_route
node_main -->|"mounts"| node_upload_route
node_main -->|"mounts"| node_dashboard_route
node_main -->|"mounts"| node_insights_route
node_main -->|"mounts"| node_chat_route
node_upload_route -->|"starts"| node_parsing
node_parsing -->|"uses"| node_csv_parser
node_parsing -->|"uses"| node_pdf_parser
node_csv_parser -->|"feeds"| node_cleaner
node_pdf_parser -->|"feeds"| node_cleaner
node_cleaner -->|"feeds"| node_category_mapper
node_category_mapper -->|"outputs"| node_analytics
node_analytics -->|"invokes"| node_recurring_detector
node_analytics -->|"invokes"| node_anomaly_detector
node_analytics -->|"feeds"| node_ai_layer
node_ai_layer -->|"includes"| node_summary_generator
node_ai_layer -->|"includes"| node_insight_generator
node_ai_layer -->|"includes"| node_gemini_classifier
node_chat_route -->|"delegates"| node_rag_chatbot
node_rag_chatbot -->|"uses"| node_retriever
node_retriever -->|"reads"| node_vector_store
node_chat_route -->|"uses"| node_ai_layer
node_dashboard_route -->|"serves"| node_analytics
node_insights_route -->|"serves"| node_ai_layer
node_auth_route -->|"uses"| node_db
node_dashboard_route -->|"uses"| node_db
node_chat_route -->|"uses"| node_db
node_main -->|"shares"| node_schemas
node_web_app -->|"navigates"| node_web_pages
node_web_pages -->|"renders"| node_web_components
node_web_app -.->|"falls back"| node_web_mock
node_web_app -->|"consumes"| node_dashboard_route
node_web_app -->|"consumes"| node_upload_route
node_web_app -->|"consumes"| node_chat_route
node_web_app -->|"consumes"| node_auth_route
node_mobile_app -->|"navigates"| node_mobile_routes
node_mobile_app -->|"uses"| node_mobile_auth
node_mobile_app -->|"consumes"| node_mobile_api
node_mobile_api -->|"calls"| node_auth_route
node_mobile_api -->|"calls"| node_dashboard_route
node_mobile_api -->|"calls"| node_chat_route

click node_main "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/main.py"
click node_auth_route "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/auth.py"
click node_upload_route "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/upload.py"
click node_dashboard_route "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/dashboard.py"
click node_insights_route "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/insights.py"
click node_chat_route "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/chat.py"
click node_csv_parser "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/csv_parser.py"
click node_pdf_parser "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/pdf_parser.py"
click node_cleaner "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/cleaner.py"
click node_category_mapper "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/category_mapper.py"
click node_analytics "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/analytics.py"
click node_recurring_detector "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/recurring_detector.py"
click node_anomaly_detector "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/anomaly_detector.py"
click node_summary_generator "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/ai/summary_generator.py"
click node_insight_generator "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/ai/insight_generator.py"
click node_gemini_classifier "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/ai/gemini_classifier.py"
click node_rag_chatbot "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/rag/chatbot.py"
click node_retriever "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/rag/retriever.py"
click node_vector_store "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/rag/vector_store.py"
click node_db "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/database/db.py"
click node_schemas "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/models/schemas.py"
click node_web_app "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/App.js"
click node_web_pages "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/pages/Dashboard.js"
click node_web_components "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/components/Charts.js"
click node_web_mock "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/api/mockService.js"
click node_mobile_app "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/App.tsx"
click node_mobile_routes "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/app/_layout.tsx"
click node_mobile_auth "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/src/context/AuthContext.tsx"
click node_mobile_api "https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/src/services/api.ts"

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_main,node_auth_route,node_upload_route,node_dashboard_route,node_insights_route,node_chat_route,node_parsing,node_csv_parser,node_pdf_parser,node_cleaner,node_category_mapper,node_analytics,node_recurring_detector,node_anomaly_detector,node_ai_layer,node_summary_generator,node_insight_generator,node_gemini_classifier,node_rag_chatbot,node_retriever,node_vector_store,node_db,node_schemas toneBlue
class node_web_app,node_web_pages,node_web_components,node_web_mock toneAmber
class node_mobile_app,node_mobile_routes,node_mobile_auth,node_mobile_api toneMint
```

## Components

### Backend

FastAPI system-of-record for ingestion, analytics, auth, and AI responses.

- [API app](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/main.py): fastapi bootstrap · Backend entrypoint that wires routes and application startup. · `cortex-finance-backend/app/main.py`
- [Auth API](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/auth.py): route · Authentication boundary for login and token validation. · `cortex-finance-backend/app/routes/auth.py`
- [Upload API](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/upload.py): route · Accepts statement uploads and starts ingestion. · `cortex-finance-backend/app/routes/upload.py`
- [Dashboard API](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/dashboard.py): route · Serves aggregated metrics for the dashboard views. · `cortex-finance-backend/app/routes/dashboard.py`
- [Insights API](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/insights.py): route · Exposes narrative insights and summaries. · `cortex-finance-backend/app/routes/insights.py`
- [Chat API](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/routes/chat.py): route · Conversation endpoint backed by retrieval and AI generation. · `cortex-finance-backend/app/routes/chat.py`
- **Parsers**: ingestion stage · File-type specific statement parsing for uploads.
- [CSV parser](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/csv_parser.py): parser · Parses CSV statements into raw transaction records. · `cortex-finance-backend/app/services/csv_parser.py`
- [PDF parser](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/pdf_parser.py): parser · Extracts statement data from PDF uploads. · `cortex-finance-backend/app/services/pdf_parser.py`
- [Cleaner](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/cleaner.py): normalizer · Cleans and normalizes raw transactions. · `cortex-finance-backend/app/services/cleaner.py`
- [Category mapper](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/category_mapper.py): classifier · Maps cleaned transactions to finance categories. · `cortex-finance-backend/app/services/category_mapper.py`
- [Analytics](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/analytics.py): metrics engine · Computes user-facing spending and account metrics. · `cortex-finance-backend/app/services/analytics.py`
- [Recurring detector](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/recurring_detector.py): pattern detector · Finds subscriptions, EMIs, and repeated payments. · `cortex-finance-backend/app/services/recurring_detector.py`
- [Anomaly detector](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/services/anomaly_detector.py): outlier model · Flags unusual spending patterns. · `cortex-finance-backend/app/services/anomaly_detector.py`
- **AI layer**: llm generation · Generates summaries, insights, and transaction classifications.
- [Summary gen](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/ai/summary_generator.py): generator · Turns aggregates into financial summaries. · `cortex-finance-backend/app/ai/summary_generator.py`
- [Insight gen](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/ai/insight_generator.py): generator · Produces narrative insights from detected patterns. · `cortex-finance-backend/app/ai/insight_generator.py`
- [Gemini classifier](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/ai/gemini_classifier.py): llm classifier · LLM-backed categorization and classification helper. · `cortex-finance-backend/app/ai/gemini_classifier.py`
- [RAG chatbot](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/rag/chatbot.py): retrieval assistant · Standalone conversational finance assistant for questions over indexed corpus. · `cortex-finance-backend/app/rag/chatbot.py`
- [Retriever](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/rag/retriever.py): retrieval · Fetches relevant context for chat answers. · `cortex-finance-backend/app/rag/retriever.py`
- [Vector store](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/rag/vector_store.py): index store · Manages the persisted FAISS-backed retrieval index. · `cortex-finance-backend/app/rag/vector_store.py`
- [Database](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/database/db.py): persistence · Central database access layer for backend state. · `cortex-finance-backend/app/database/db.py`
- [Schemas](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-backend/app/models/schemas.py): contracts · Shared request and response models. · `cortex-finance-backend/app/models/schemas.py`

### Web App

React SPA for dashboard, upload, and chat experiences.

- [Web app](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/App.js): react spa · Primary browser client for finance dashboard and chat. · `cortex-finance-frontend/src/App.js`
- [Pages](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/pages/Dashboard.js): views · Page-level views for dashboard, auth, upload, and settings. · `cortex-finance-frontend/src/pages/Dashboard.js`
- [UI components](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/components/Charts.js): components · Reusable dashboard and interaction components. · `cortex-finance-frontend/src/components/Charts.js`
- [Mock service](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-frontend/src/api/mockService.js): api mock · Frontend-local API/data stub for decoupled UI development. · `cortex-finance-frontend/src/api/mockService.js`

### Mobile App

Expo/React Native client with auth, tabs, and API access.

- [Mobile app](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/App.tsx): expo client · React Native presentation layer for the same finance domain. · `cortex-finance-mobile/App.tsx`
- [App routes](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/app/_layout.tsx): navigator · Expo router screens and navigation groups. · `cortex-finance-mobile/app/_layout.tsx`
- [Auth context](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/src/context/AuthContext.tsx): state · Client auth state and session handling. · `cortex-finance-mobile/src/context/AuthContext.tsx`
- [API service](https://github.com/soumya9679/codeflow2026-neural-nexus-cortex-finance/blob/main/cortex-finance-mobile/src/services/api.ts): client api · Backend API access layer for the mobile app. · `cortex-finance-mobile/src/services/api.ts`

## Connections

- API app → Auth API: mounts · Bootstraps the authentication route.
- API app → Upload API: mounts · Bootstraps the upload route.
- API app → Dashboard API: mounts · Bootstraps the dashboard route.
- API app → Insights API: mounts · Bootstraps the insights route.
- API app → Chat API: mounts · Bootstraps the chat route.
- Upload API → Parsers: starts · Triggers ingestion for uploaded statements.
- Parsers → CSV parser: uses · Handles CSV statement files.
- Parsers → PDF parser: uses · Handles PDF statement files.
- CSV parser → Cleaner: feeds · Parsed rows are normalized next.
- PDF parser → Cleaner: feeds · Extracted records are normalized next.
- Cleaner → Category mapper: feeds · Cleaned transactions are categorized.
- Category mapper → Analytics: outputs · Categorized transactions feed analytics.
- Analytics → Recurring detector: invokes · Detects repeated payments from normalized data.
- Analytics → Anomaly detector: invokes · Detects unusual spending patterns.
- Analytics → AI layer: feeds · Aggregates are passed to generation layer.
- AI layer → Summary gen: includes · Produces statement summaries.
- AI layer → Insight gen: includes · Produces financial insights.
- AI layer → Gemini classifier: includes · Supports LLM-based classification.
- Chat API → RAG chatbot: delegates · Chat requests are handled by the RAG assistant.
- RAG chatbot → Retriever: uses · Retrieves relevant contextual passages.
- Retriever → Vector store: reads · Queries the persisted FAISS index.
- Chat API → AI layer: uses · Final answers are generated through AI services.
- Dashboard API → Analytics: serves · Dashboard reads computed metrics.
- Insights API → AI layer: serves · Insights are generated from the AI layer.
- Auth API → Database: uses · Auth state is validated or stored via database access.
- Dashboard API → Database: uses · Reads persisted finance data.
- Chat API → Database: uses · Chat may use stored user context.
- API app → Schemas: shares · API contracts are shared across routes.
- Web app → Pages: navigates · Main SPA composes page-level views.
- Pages → UI components: renders · Pages reuse shared UI components.
- Web app → Mock service: falls back · Supports mocked data during frontend development.
- Web app → Dashboard API: consumes · Dashboard requests backend metrics.
- Web app → Upload API: consumes · Upload flow sends statements to backend.
- Web app → Chat API: consumes · Chat screen queries the assistant API.
- Web app → Auth API: consumes · Login and signup use auth endpoints.
- Mobile app → App routes: navigates · App shell is organized by router screens.
- Mobile app → Auth context: uses · Shares authentication state across screens.
- Mobile app → API service: consumes · Mobile screens call the backend through a service layer.
- API service → Auth API: calls · Mobile auth flow uses the backend auth API.
- API service → Dashboard API: calls · Dashboard data is fetched from backend.
- API service → Chat API: calls · Mobile chat uses the assistant API.
