Skip to content

cosmo95/B_TEA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

B_TEA - Intelligent Expense Analysis Platform

License: MIT Python 3.10+ FastAPI React 18+

🎯 Overview

B_TEA is an AI-powered financial analysis platform that transforms raw expense data into actionable insights. Upload your financial documents (CSV/PDF) and get professional-grade analysis, visualization, and forecastingβ€”automatically.

Problem

Users struggle to understand their spending patterns without tedious manual analysis.

Solution

One-click upload β†’ Comprehensive analytics dashboard with insights a financial analyst would provide.

Why B_TEA?

  • βœ… Better than Splitwise: Automatic parsing, real insights (vs manual logging)
  • βœ… Better than Bank Apps: Privacy-first, smarter analysis, actionable recommendations
  • βœ… Affordable: $5/month vs $500+ for real analyst

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Python 3.10+ (for local development)
  • Node 18+ (for frontend development)

Option 1: Docker (Recommended)

# Clone the repo
git clone https://github.com/cosmo95/B_TEA.git
cd B_TEA

# Start all services
docker-compose up --build

# Access:
# Frontend: http://localhost:3000
# Backend API: http://localhost:8000
# API Docs: http://localhost:8000/docs

Option 2: Local Development

Backend Setup:

cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python app/main.py

Frontend Setup:

cd frontend
npm install
npm start

πŸ“‹ Features (MVP - Phase 1)

✨ Core Capabilities

  • πŸ“€ File Upload: CSV & PDF parsing with auto-detection
  • 🧹 Data Cleaning: Standardization, deduplication, currency handling
  • πŸ€– Auto-Categorization: ML-powered transaction categorization
  • πŸ“Š Analytics Dashboard: Beautiful charts, spending breakdown, trends
  • πŸ’‘ Smart Insights: Subscriptions, anomalies, behavioral patterns
  • πŸ“ˆ Forecasting: Next month predictions with confidence intervals
  • πŸ’¬ Recommendations: Actionable suggestions to optimize spending
  • πŸ“„ Export: PDF reports & cleaned CSV data

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚
β”‚   (React 18)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ HTTP/REST API
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   FastAPI Backend                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Data Processing Pipeline:    β”‚   β”‚
β”‚  β”‚ β€’ Parser (CSV/PDF)           β”‚   β”‚
β”‚  β”‚ β€’ Cleaner                    β”‚   β”‚
β”‚  β”‚ β€’ Categorizer (ML)           β”‚   β”‚
β”‚  β”‚ β€’ Analyzer (Insights)        β”‚   β”‚
β”‚  β”‚ β€’ Forecaster                 β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                  β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”         β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
    β”‚   DB   β”‚         β”‚   Redis   β”‚
    β”‚(PostgreSQL)      β”‚ (Caching) β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Backend:

  • FastAPI (API framework)
  • Pandas & NumPy (data processing)
  • Scikit-learn (ML categorization)
  • pdfplumber (PDF parsing)
  • SQLAlchemy (ORM)
  • PostgreSQL (database)
  • Redis (caching)
  • Celery (async tasks)

Frontend:

  • React 18 (UI framework)
  • Recharts (data visualization)
  • TailwindCSS (styling)
  • Axios (API client)
  • TypeScript (type safety)

πŸ“ Project Structure

B_TEA/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py              # FastAPI app initialization
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/          # API endpoints
β”‚   β”‚   β”‚   └── models/          # Pydantic schemas
β”‚   β”‚   β”œβ”€β”€ database/            # SQLAlchemy models
β”‚   β”‚   └── utils/               # Config, logging, helpers
β”‚   β”œβ”€β”€ data_pipeline/
β”‚   β”‚   β”œβ”€β”€ parser.py            # CSV/PDF parsing
β”‚   β”‚   β”œβ”€β”€ cleaner.py           # Data cleaning
β”‚   β”‚   β”œβ”€β”€ categorizer.py       # Auto-categorization
β”‚   β”‚   └── analyzer.py          # Analytics & insights
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── .env.example
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ pages/               # Page components
β”‚   β”‚   β”œβ”€β”€ services/            # API calls
β”‚   β”‚   β”œβ”€β”€ types/               # TypeScript types
β”‚   β”‚   └── App.tsx
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── .env.example
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ PRD.txt                      # Product Requirements Document
└── README.md

πŸ”Œ API Endpoints (MVP)

Health Check

GET /health
β†’ Returns: { status: "healthy" }

File Upload & Analysis

POST /api/v1/analysis/upload
Body: { file: File }
β†’ Returns: { analysis_id: UUID, status: "processing" }

GET /api/v1/analysis/{analysis_id}
β†’ Returns: { transactions, metrics, status }

GET /api/v1/insights/{analysis_id}
β†’ Returns: { subscriptions, anomalies, trends, recommendations }

GET /api/v1/forecast/{analysis_id}
β†’ Returns: { predictions by category, confidence }

GET /api/v1/report/{analysis_id}
β†’ Returns: PDF file download

πŸ“Š Data Pipeline

1. File Upload
   ↓
2. Validation & Parsing (CSV/PDF)
   ↓
3. Data Cleaning (standardization, deduplication)
   ↓
4. Auto-Categorization (ML model)
   ↓
5. Analytics (metrics, patterns, anomalies)
   ↓
6. Forecasting (next month predictions)
   ↓
7. Report Generation (PDF + JSON)

πŸ’‘ Key Features Explained

Auto-Categorization

ML model trained on common transaction patterns automatically assigns categories:

  • Food & Dining
  • Transportation
  • Bills & Utilities
  • Entertainment
  • Shopping
  • Healthcare
  • Education
  • Personal Care
  • Subscriptions
  • Other

Smart Insights

  • Subscriptions: Detect recurring monthly charges (Netflix, Spotify, gym)
  • Anomalies: Flag unusual spending spikes
  • Trends: Show category growth/decline over time
  • Behavioral: Weekend vs weekday patterns
  • Recommendations: Actionable suggestions to save money

Forecasting

  • Next month spending prediction
  • Category-wise forecasts
  • Confidence intervals
  • Seasonal adjustment

πŸ” Security

  • βœ… Encrypted file upload (AES-256 at rest)
  • βœ… HTTPS for all communication
  • βœ… Automatic file deletion (30 days)
  • βœ… Rate limiting on API
  • βœ… Optional user authentication
  • βœ… GDPR-compliant data retention

πŸ“ˆ Roadmap

Phase 1 (MVP) - Months 1-2 ⚑

  • βœ… File parsing & cleaning
  • βœ… Auto-categorization
  • βœ… Analytics dashboard
  • βœ… Insights generation
  • βœ… PDF reports

Phase 2 (Polish) - Months 3-4 🎨

  • User accounts
  • Save/manage analyses
  • Mobile responsive
  • Performance optimization

Phase 3 (Monetization) - Months 5-6 πŸ’°

  • Freemium launch
  • Stripe integration
  • API for Business tier

Phase 4 (Growth) - Months 7+ πŸš€

  • Bank API integrations
  • Budget planning
  • Mobile apps
  • 10k+ users

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Cosmo - GitHub


πŸš€ Getting Help

  • πŸ“– Read the PRD.txt for detailed product specifications
  • πŸ› Report bugs in Issues
  • πŸ’¬ Discuss ideas in Discussions
  • πŸ“§ Contact via email (if available)

Made with ❀️ for open source

About

Personal Budget Tracker & Expense Analyzer (Beginner Portfolio Project). Track, analyze, and visualize personal finance and expenses using Python, Pandas, and Colab. Open source, guided for CV and portfolio.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors