# davguzm20/axionlabs architecture

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

- Interactive diagram: https://gitdiagram.com/davguzm20/axionlabs
- Repository: https://github.com/davguzm20/axionlabs

## Overview

KhipuBot is a personal-finance web app and AI-assisted messaging bot for recording finances through text, voice and images. In the web workflow, a user signs in, enters the chat, and sends transaction input; backend transaction logic extracts and validates it, assigns a category and persists the transaction while updating the wallet balance. The app also exposes classification, history, wallets, budgets, settings and notifications. Edges below are limited to relationships shown in excerpts, the source index or README; unsampled feature wiring is not assumed.

Main entry points: [`Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx) (Route map), [`Desarrollo/KPB/Implementacion/Frontend/src/lib/api.ts`](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/lib/api.ts) (API client), [`Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py`](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py) (Transaction workflow), [`Desarrollo/KPB/Implementacion/Frontend/src/features/chat/ChatPage.tsx`](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/chat/ChatPage.tsx) (Finance chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_app["App provider<br/>[App.tsx]"]
  node_routes["Route map<br/>[router.tsx]"]
  node_wallets["Wallet management"]
  node_budgets["Budgets"]
  node_notifications["Notifications"]
  node_settings["Settings<br/>[SettingsPage.tsx]"]
end

subgraph group_transaction["Transactions"]
  node_chat["Finance chat<br/>[ChatPage.tsx]"]
  node_inputs["Voice and receipts"]
  node_classification["Classification"]
  node_history["Transaction history<br/>[HistoryPage.tsx]"]
  node_txrouter["Transaction routes<br/>[router.py]"]
  node_txservice["Transaction workflow<br/>[service.py]"]
  node_extractor["AI extractor<br/>[extractor.py]"]
  node_txrepo["Transaction repository<br/>[repository.py]"]
end

subgraph group_identity["Identity"]
  node_login["Sign-in<br/>[LoginPage.tsx]"]
  node_authrouter["Auth routes<br/>[router.py]"]
  node_authservice["Auth service<br/>[service.py]"]
  node_security["Token security<br/>[security.py]"]
  node_sessions["Sessions and lockout<br/>[sessions.py]"]
end

subgraph group_platform["Data and integrations"]
  node_api["API client<br/>[api.ts]"]
  node_backend["API application<br/>[main.py]"]
  node_entities["Finance entities<br/>[entities.py]"]
  node_database[("PostgreSQL access<br/>[database.py]")]
  node_redis[("Redis")]
end

node_user(("User"))

node_user -->|"opens"| node_routes
node_app -->|"renders"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_chat
node_routes -->|"routes to"| node_classification
node_routes -->|"routes to"| node_history
node_routes -->|"routes to"| node_wallets
node_routes -->|"routes to"| node_budgets
node_routes -->|"routes to"| node_notifications
node_routes -->|"routes to"| node_settings
node_chat -.->|"uses"| node_inputs
node_chat -.->|"submits"| node_api
node_classification -.->|"requests"| node_api
node_history -->|"requests"| node_api
node_wallets -->|"requests"| node_api
node_budgets -.->|"requests"| node_api
node_notifications -.->|"requests"| node_api
node_api -.->|"HTTP requests"| node_backend
node_backend -->|"registers"| node_authrouter
node_backend -->|"registers"| node_txrouter
node_authrouter -.->|"delegates to"| node_authservice
node_authservice -->|"uses"| node_security
node_authservice -->|"manages sessions"| node_sessions
node_sessions -->|"reads and writes"| node_redis
node_txrouter -->|"delegates to"| node_txservice
node_txservice -->|"extracts input"| node_extractor
node_txservice -->|"reads and persists"| node_txrepo
node_txservice -->|"creates transaction"| node_entities
node_txrepo -.->|"uses entities"| node_entities
node_txrouter -->|"gets database session"| node_database

click node_app "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/App.tsx"
click node_routes "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx"
click node_login "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/auth/LoginPage.tsx"
click node_chat "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/chat/ChatPage.tsx"
click node_inputs "https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/chat"
click node_classification "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/classification/pages/ClassificationPage.tsx"
click node_history "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/history/pages/HistoryPage.tsx"
click node_wallets "https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/wallets"
click node_budgets "https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/budgets"
click node_notifications "https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/notifications"
click node_settings "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/settings/pages/SettingsPage.tsx"
click node_api "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/lib/api.ts"
click node_backend "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/main.py"
click node_authrouter "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/auth/router.py"
click node_authservice "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/auth/service.py"
click node_security "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/core/security.py"
click node_sessions "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/integrations/redis/sessions.py"
click node_txrouter "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/router.py"
click node_txservice "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py"
click node_extractor "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/integrations/ai/extractor.py"
click node_txrepo "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/repository.py"
click node_entities "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/entities.py"
click node_database "https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/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_app,node_routes,node_wallets,node_budgets,node_notifications,node_settings,node_user toneBlue
class node_chat,node_inputs,node_classification,node_history,node_txrouter,node_txservice,node_extractor,node_txrepo toneAmber
class node_login,node_authrouter,node_authservice,node_security,node_sessions toneMint
class node_api,node_backend,node_entities,node_database,node_redis toneRose
```

## Components

### Web app

- [App provider](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/App.tsx): `Desarrollo/KPB/Implementacion/Frontend/src/App.tsx`
- [Route map](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx): `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`
- [Wallet management](https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/wallets): `Desarrollo/KPB/Implementacion/Frontend/src/features/wallets`
- [Budgets](https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/budgets): `Desarrollo/KPB/Implementacion/Frontend/src/features/budgets`
- [Notifications](https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/notifications): `Desarrollo/KPB/Implementacion/Frontend/src/features/notifications`
- [Settings](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/settings/pages/SettingsPage.tsx): `Desarrollo/KPB/Implementacion/Frontend/src/features/settings/pages/SettingsPage.tsx`

### Transactions

- [Finance chat](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/chat/ChatPage.tsx): `Desarrollo/KPB/Implementacion/Frontend/src/features/chat/ChatPage.tsx`
- [Voice and receipts](https://github.com/davguzm20/axionlabs/tree/main/Desarrollo/KPB/Implementacion/Frontend/src/features/chat): `Desarrollo/KPB/Implementacion/Frontend/src/features/chat`
- [Classification](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/classification/pages/ClassificationPage.tsx): `Desarrollo/KPB/Implementacion/Frontend/src/features/classification/pages/ClassificationPage.tsx`
- [Transaction history](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/history/pages/HistoryPage.tsx): `Desarrollo/KPB/Implementacion/Frontend/src/features/history/pages/HistoryPage.tsx`
- [Transaction routes](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/router.py): `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/router.py`
- [Transaction workflow](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py): `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py`
- [AI extractor](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/integrations/ai/extractor.py): `Desarrollo/KPB/Implementacion/Backend/app/integrations/ai/extractor.py`
- [Transaction repository](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/repository.py): `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/repository.py`

### Identity

- [Sign-in](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/features/auth/LoginPage.tsx): `Desarrollo/KPB/Implementacion/Frontend/src/features/auth/LoginPage.tsx`
- [Auth routes](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/auth/router.py): `Desarrollo/KPB/Implementacion/Backend/app/modules/auth/router.py`
- [Auth service](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/modules/auth/service.py): `Desarrollo/KPB/Implementacion/Backend/app/modules/auth/service.py`
- [Token security](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/core/security.py): `Desarrollo/KPB/Implementacion/Backend/app/core/security.py`
- [Sessions and lockout](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/integrations/redis/sessions.py): `Desarrollo/KPB/Implementacion/Backend/app/integrations/redis/sessions.py`

### Data and integrations

- [API client](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Frontend/src/lib/api.ts): `Desarrollo/KPB/Implementacion/Frontend/src/lib/api.ts`
- [API application](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/main.py): `Desarrollo/KPB/Implementacion/Backend/app/main.py`
- [Finance entities](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/entities.py): `Desarrollo/KPB/Implementacion/Backend/app/entities.py`
- [PostgreSQL access](https://github.com/davguzm20/axionlabs/blob/main/Desarrollo/KPB/Implementacion/Backend/app/database.py): `Desarrollo/KPB/Implementacion/Backend/app/database.py`
- **Redis**

### Other components

- **User**

## Connections

- User → Route map: opens (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- App provider → Route map: renders (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/App.tsx`)
- Route map → Sign-in: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Route map → Finance chat: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Route map → Classification: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Route map → Transaction history: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Route map → Wallet management: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Route map → Budgets: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Route map → Notifications: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Route map → Settings: routes to (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/app/router.tsx`)
- Finance chat → Voice and receipts: uses
- Finance chat → API client: submits
- Classification → API client: requests
- Transaction history → API client: requests
- Wallet management → API client: requests (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/features/wallets/services/walletService.ts`)
- Budgets → API client: requests (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/features/budgets/services/budgetService.ts`)
- Notifications → API client: requests (evidence: `Desarrollo/KPB/Implementacion/Frontend/src/features/notifications/services/notificationService.ts`)
- API client → API application: HTTP requests
- API application → Auth routes: registers (evidence: `Desarrollo/KPB/Implementacion/Backend/app/main.py`)
- API application → Transaction routes: registers (evidence: `Desarrollo/KPB/Implementacion/Backend/app/main.py`)
- Auth routes → Auth service: delegates to (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/auth/router.py`)
- Auth service → Token security: uses (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/auth/service.py`)
- Auth service → Sessions and lockout: manages sessions (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/auth/service.py`)
- Sessions and lockout → Redis: reads and writes (evidence: `Desarrollo/KPB/Implementacion/Backend/app/integrations/redis/sessions.py`)
- Transaction routes → Transaction workflow: delegates to (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/router.py`)
- Transaction workflow → AI extractor: extracts input (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py`)
- Transaction workflow → Transaction repository: reads and persists (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py`)
- Transaction workflow → Finance entities: creates transaction (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/service.py`)
- Transaction repository → Finance entities: uses entities (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/repository.py`)
- Transaction routes → PostgreSQL access: gets database session (evidence: `Desarrollo/KPB/Implementacion/Backend/app/modules/transactions/router.py`)
