A personal finance tracking backend designed for clean architecture, demo-friendly access, and scalable SaaS features. Built with FastAPI and Firestore, FinanceFlow provides APIs for recording transactions, managing categories, and generating monthly financial summaries.
FinanceFlow is the backend service for a personal finance web application.
It enables users to manually track income and expenses, view monthly summaries, and explore the product instantly using a frictionless Demo Mode — all without creating an account.
This backend is designed with multi-tenant architecture from day one, supporting both demo users and future authenticated users.
- No signup required
- One button generates a temporary demo session
- Fully isolated demo user environment
- Safe to test all features without affecting others
- Data stored under
demo_users/{demo_id}
- Create, list, and delete categories
- Income categories (e.g., Salary)
- Expense categories (e.g., Rent, Groceries)
- Record income and expenses manually
- Fields include:
- amount
- type: INCOME / EXPENSE
- category
- date
- description (optional)
- List transactions by month
/reports/monthly?year=YYYY&month=MM- Returns:
- total income
- total expenses
- net savings
- breakdown by category
- daily spending timeline
- Frontend handles charts (no PDF in MVP)
FinanceFlow follows a clean, service-oriented backend structure using Firestore for storage and FastAPI for REST APIs.
Client (Frontend)
↓
[FastAPI Backend]
├─ Auth Middleware (Demo / User Mode)
├─ Services (Reports, Transactions, Categories)
├─ Repositories (Firestore)
└─ Models (Pydantic)
↓
Firestore
├─ demo_users/{demo_id}
└─ users/{uid} (future)
- Demo users →
demo_users/{demo_id} - Future real users →
users/{uid} - Shared business logic, isolated data paths
The backend offers an instant, passwordless demo experience.
Creates a temporary user with:
demo_id- Default categories
- Optional sample transactions
- A signed session token
expires_atmetadata
Demo users can:
- Add transactions
- Manage categories
- View monthly reports
- Use the full application experience
This allows new users or recruiters to explore FinanceFlow immediately.
POST /auth/demo— Create demo session
GET /categoriesPOST /categoriesDELETE /categories/{id}
GET /transactions?year=YYYY&month=MMPOST /transactions
GET /reports/monthly?year=YYYY&month=MM
FinanceFlow--BE/
├─ app.py # FastAPI entrypoint
├─ db/
│ └─ db_connector.py # Firestore initialization + shared client
│
├─ src/
│ ├─ api/ # Routers
│ │ ├─ auth.py
│ │ ├─ categories.py
│ │ ├─ transactions.py
│ │ └─ reports.py
│ │
│ ├─ services/ # Business logic
│ │ ├─ auth_service.py
│ │ ├─ category_service.py
│ │ ├─ transaction_service.py
│ │ └─ report_service.py
│ │
│ ├─ repos/ # Database access layer
│ │ ├─ category_repo.py
│ │ ├─ transaction_repo.py
│ │ └─ base_repo.py # (optional shared repo utils)
│ │
│ ├─ models/ # Pydantic models (schemas)
│ │ ├─ transaction.py
│ │ ├─ category.py
│ │ └─ auth.py
│ │
│ ├─ core/ # Auth, config, middlewares, utils
│ │ ├─ config.py
│ │ ├─ auth.py # JWT verification (demo mode)
│ │ └─ exceptions.py
│ │
│ └─ __init__.py
│
├─ requirements.txt
└─ README.md
- Demo Mode backend session
- Categories API
- Transactions API
- Monthly report service
- FastAPI skeleton + routers
- Firestore integration
- Basic frontend dashboard (separate repo)
- Real user authentication (Firebase Auth)
- PDF report export (fpdf2)
- Receipt upload (optional)
- Settings (currency, timezone)
- Cron job for automated monthly summaries
- Advanced analytics
- Budget goals + limits
- Import from CSV / bank exports
- Notifications
- Backend: FastAPI (Python)
- Database: Firestore (NoSQL)
- Auth: JWT-based demo sessions (Firebase Auth for future users)
- Deployment: TBD (Cloud Run / Render / etc.)
- Frontend: Host separately (Netlify)
© DreamRootLabs