Portfolio-ready demo that combines:
- ChatGPT-style financial Q&A
- Finance KPI dashboard
- Invoice analysis from uploaded CSV data
- FastAPI backend with rule-based financial copilot (no OpenAI dependency)
- CSV upload and active dataset management
- KPI summary API (
/summary) - Invoice listing API (
/invoices) - Natural language copilot API (
/ask) - Enterprise-style frontend with:
- Sidebar navigation
- Dashboard page
- Admin Upload page
- Financial Copilot page
- Quick action buttons
- Answer panel and matching records table
backend/
main.py
services/
data_loader.py
financial_analyzer.py
data/
uploads/
frontend/
index.html
style.css
app.js
The uploaded CSV must include (or alias to) these columns:
customer_nameinvoice_amount_duedue_datestatusregionrisk_scoreaging_bucket
Common alias headers (like amount_due, customer, due date, risk) are supported.
- Create and activate virtualenv (optional but recommended)
- Install dependencies:
pip install -r requirements.txtStart backend:
uvicorn backend.main:app --reloadServe frontend (separate static server):
python3 -m http.server 5500 --directory frontendOpen:
- Frontend:
http://127.0.0.1:5500 - Finance Team Copilot Page:
http://127.0.0.1:5500/team-copilot.html - API docs:
http://127.0.0.1:8000/docs
The Financial Copilot now supports OpenAI-powered query planning with conversation memory.
Set environment variables before starting backend:
export OPENAI_API_KEY="your_key_here"
export OPENAI_MODEL="gpt-4.1-mini"If OPENAI_API_KEY is not set, the Copilot uses a local dynamic fallback planner (still session-aware).
GET /healthGET /summaryGET /invoicesPOST /upload-csvPOST /ask
- What is the total due amount?
- Show overdue invoices
- Which customers are high risk?
- Which region has highest outstanding balance?
- Show invoices above $50,000
- Give me collection priority customers