A web-based system that helps small and local businesses in Tanzania record stock, sales and expenses and visualise their performance through interactive analytics replacing manual book-keeping with simple, accessible digital workflows.
# Web-Based Sales Data Analysis System
A web-based system that helps small and micro businesses in Tanzania record stock, sales, and expenses, and visualise their performance through interactive analytics — replacing manual bookkeeping with simple, accessible digital workflows.
## Architecture
This is a **decoupled web application** with two parts:
```
┌─────────────────────────────────────────────────────────┐
│ USER'S BROWSER │
│ React 18 SPA (frontend/) │
│ ─ Vite + Tailwind CSS │
│ ─ React Router for client-side navigation │
│ ─ Axios + JWT for API calls │
│ ─ Chart.js for analytics visualisations │
│ ─ i18next (English + Swahili) │
└──────────────────────┬──────────────────────────────────┘
│ HTTPS, JSON
▼
┌─────────────────────────────────────────────────────────┐
│ FLASK JSON API (backend/) │
│ ─ Python 3.11 + Flask 3 │
│ ─ JWT authentication (Flask-JWT-Extended) │
│ ─ Modular blueprints (auth, stock, sales, expenses, │
│ analytics, reports, dashboard, payments, │
│ notifications) │
│ ─ ReportLab for PDF generation │
│ ─ openpyxl for Excel export │
│ ─ ClickPesa API for mobile money (USSD push) │
└──────────────────────┬──────────────────────────────────┘
│ SQLAlchemy (PyMySQL)
▼
┌─────────────────────────────────────────────────────────┐
│ MySQL DATABASE │
│ ─ Users, Products, Sales, SaleItems, Expenses │
│ ─ Payments, Notifications, PasswordResets │
└─────────────────────────────────────────────────────────┘
```
## Functional Coverage
The system implements all 25 functional requirements …