How saumysingh01/binary-hacks-p10-prototype works
This is an AI-assisted expense approval service whose decisions are anchored to a local hash-linked ledger. A caller submits an expense to the API; the agent loads recent decisions for context, asks Groq for a decision, and appends the result to the chain. Separate API routes expose chain contents, integrity checks, and recent decisions, while the root route serves the dashboard. The supplied tree and excerpts support the API and ledger paths; frontend request wiring is not shown.
Main entry points: expense_agent.py Expense evaluation · routes.py REST API · chain.py Chain operations · chain.json Persistent chain
Components 10
API and startup
- Server startup
main.py - REST API
api/routes.py - Chain and decision queries
api/routes.py - Integrity annotation
api/routes.py
Decision agent
- Expense evaluation
agent/expense_agent.py
Blockchain ledger
- Chain operations
blockchain/chain.py - Persistent chain
data/chain.json
Dashboard
- Dashboard page
frontend/index.html
Other components
- Expense submitter
- Groq LLM
Connections 14
- Server startup → REST API: starts server
- Expense submitter → REST API: submits expense
- REST API → Expense evaluation: evaluates request
- Expense evaluation → Chain operations: loads history
- Chain operations → Persistent chain: reads chain
- Chain operations → Expense evaluation: returns history
- Expense evaluation → Groq LLM: requests decision
- Groq LLM → Expense evaluation: returns response
- Expense evaluation → Chain operations: appends decision
- Chain operations → Persistent chain: persists blocks
- REST API → Chain and decision queries: handles queries
- Chain and decision queries → Persistent chain: reads blocks
- Chain and decision queries → Integrity annotation: checks integrity
- REST API → Dashboard page: serves page