TrustPOS Tanzania — an offline-first, vendor-side payment verification and liquidity system that secures USSD-based mobile money transactions, blocks high-risk activity in real time, and helps street vendors manage and cash out their daily earnings.
# TrustPOS Tanzania
**Merchant-side trust and liquidity infrastructure for informal mobile money payments in Tanzania.**
TrustPOS is a vendor-only smart payment terminal system designed for street vendors. Customers pay via USSD from any phone (feature phone or smartphone), and vendors verify payments through a rugged POS terminal with real-time risk assessment.
---
## Architecture
```
Customer (Feature Phone) Vendor (POS Terminal)
│ │
│ USSD *150*00# │
│ ─────────────► │
│ ┌────────────┤
│ │ Payment │
│ ◄─── 6-digit ────┤ Orchestrator
│ code │ │
│ │ ┌──────────┤
│ "Tell vendor │ │ Risk │
│ the code" │ │ Engine │
│ │ │ │
│ │ │ ┌────────┤
│ │ │ │ Event │
│ │ │ │ Trace │
└────────────────────┴─┴─┴────────┘
FastAPI Backend
PostgreSQL + Redis
```
## Tech Stack
| Layer | Technology |
|-------|-----------|
| Frontend | Next.js (App Router), TypeScript, Tailwind CSS |
| Backend | Python FastAPI |
| Database | PostgreSQL 16 |
| Cache/Realtime | Redis 7 |
| AI Layer | Ollama (local LLM) |
## Quick Start
### Prerequisites
- Docker & Docker Compose
- Node.js 18+
- Python 3.11+
- Ollama (optional, for AI features)
### 1. Start Infrastructure
```bash
cd trustpos-tanzania
docker-compose up -d
```
This starts PostgreSQL (port 5432) and Redis (port 6379).
### 2. Setup Backend
```bash
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Seed demo data
python seed.py
# Start the API server
uvicorn app.main:app --reload --port 8000
```
### 3. Setup Frontend
```bash
cd frontend
# Install dependencies (already done if you followed setup)
npm install
# Start dev server
npm run …