How sharegear01-lang/ai_accounting works
AIAcct is a personal/family bookkeeping assistant: users describe transactions or submit receipt screenshots, then the assistant extracts or reasons about transaction details, stores or queries records, and routes edits/deletions through human approval. The graph includes the Vue client, authenticated API, OCR and agent stages, transaction persistence, and session checkpoints. Edges are limited to relationships evidenced by excerpts, the source index, or README; several internal graph-node connections are not detailed in the sampled code.
Main entry points: chat.py Chat Route · index.js API Client · transactions.py Transaction Routes · crud.py Transaction Tools
Components 25
Vue Client
- Vue App
frontend/src/main.js - Chat Interface
frontend/src/components/ChatPanel.vue - Approval Card
frontend/src/components/ApprovalCard.vue - Transaction Views
frontend/src/views/Dashboard.vue - Transaction Form
frontend/src/components/TransactionFormDialog.vue - API Client
frontend/src/api/index.js
API and Identity
- Auth Routes
app/api/auth.py - Chat Route
app/api/chat.py - Transaction Routes
app/api/transactions.py - JWT Identity
app/auth/jwt.py - Auth Dependency
app/auth/dependencies.py
Assistant Workflow
- Agent Graph
app/agent/graph.py - Agent Reasoning
app/agent/nodes/agent.py - DeepSeek LLM
app/agent/nodes/llm.py - OCR Graph Node
app/agent/nodes/ocr.py - OCR Service
app/services/ocr_service.py - Image Processing
app/services/image.py - Transaction Tools
app/agent/tools/crud.py
Persistence
- User Records
app/models/user.py - Transaction Records
app/models/transaction.py - PostgreSQL
app/database.py - Conversation Checkpointer
app/checkpointer.py
External Services
- DeepSeek
- Dashscope OCR
Other components
- User
Connections 32
- User → Vue App: uses
README.md - Vue App → Chat Interface: renders
frontend/src/main.js - Chat Interface → API Client: requests
frontend/src/components/ChatPanel.vue - Chat Interface → Approval Card: shows review
frontend/src/components/ChatPanel.vue - User → Transaction Views: manages records
README.md - Transaction Views → API Client: requests
frontend/src/views/Dashboard.vue - Transaction Views → Transaction Form: opens form
frontend/src/views/Dashboard.vue - API Client → Chat Route: calls chat
README.md - API Client → Auth Routes: calls auth
README.md - API Client → Transaction Routes: calls records
- Auth Routes → JWT Identity: issues tokens
app/api/auth.py - Auth Routes → User Records: reads/writes
app/api/auth.py - Chat Route → Auth Dependency: requires identity
app/api/chat.py - Transaction Routes → Auth Dependency: requires identity
app/api/transactions.py - Auth Dependency → JWT Identity: validates token
app/auth/dependencies.py - Chat Route → Agent Graph: invokes graph
app/api/chat.py - Chat Route → Conversation Checkpointer: loads checkpoint
app/api/chat.py - Agent Graph → Agent Reasoning: dispatches nodes
app/agent/graph.py - Agent Reasoning → DeepSeek LLM: uses model
app/agent/nodes/agent.py - DeepSeek LLM → DeepSeek: calls model
app/agent/nodes/llm.py - DeepSeek LLM → Transaction Tools: binds tools
app/agent/nodes/llm.py - Chat Route → OCR Graph Node: handles image input
- OCR Graph Node → OCR Service: recognizes image
- OCR Service → Image Processing: compresses image
app/services/ocr_service.py - OCR Service → Dashscope OCR: calls OCR
app/services/ocr_service.py - Transaction Tools → PostgreSQL: queries/writes
app/agent/tools/crud.py - Transaction Tools → Transaction Records: uses model
app/agent/tools/crud.py - Transaction Routes → PostgreSQL: accesses records
app/api/transactions.py - Transaction Routes → Transaction Records: uses model
app/api/transactions.py - Chat Route → Transaction Tools: resumes approved tools
app/api/chat.py - User Records → PostgreSQL: maps table
app/models/user.py - Transaction Records → PostgreSQL: maps table
app/models/transaction.py