MobileMuuzaji is an offline-first Android inventory and sales management application built for small business owners in Kenya.
# MobileMuuzaji
## Table of Contents
1. Project Overview
2. System Architecture
3. Technology Stack
4. Repository Structure
5. Backend Setup
6. Android Setup
7. Database Schema
8. API Reference
9. Offline-First Architecture
10. Deployment
11. Known Issues & Limitations
12. Roadmap
---
## 1. Project Overview
MobileMuuzaji is an offline-first Android inventory and sales management application built for small business owners in Kenya. The app allows users to track stock levels, record sales, manage organizations and employees, and view financial summaries including gross income and profit — all without requiring a persistent internet connection.
The name "Muuzaji" means "seller" in Swahili.
---
## 2. System Architecture
```
┌─────────────────────────────────────────────┐
│ Android App (Kotlin) │
│ │
│ UI Layer (Activities) │
│ ↕ │
│ ViewModel Layer │
│ ↕ │
│ Repository Layer │
│ ↕ ↕ │
│ Room/SQLite Retrofit (HTTP) │
│ (local cache) (remote API) │
│ ↕ │
│ WorkManager (background sync) │
└──────────────────────┬──────────────────────┘
│ HTTPS
┌──────────────────────▼──────────────────────┐
│ FastAPI Backend (Python) │
│ │
│ Route Handlers │
│ ↕ │
│ SQLAlchemy ORM │
│ ↕ │
│ PostgreSQL (Supabase) │
└─────────────────────────────────────────────┘
```
### Data Flow
**Online operation:**
1. User action → Activity → API call via Retrofit
2. FastAPI processes request → commits to PostgreSQL
3 …