Logo Lanfrica

petermirithu/Mali-Mind-Backend

Domain:

socioeconomic

Record type:

software
Creator:
pet
Host:
Backend for an AI-powered Kenyan financial intelligence app that tracks real-world economic events (fuel, food, forex, taxes, electricity, etc.) and translates them into: “What this means for your daily cost of living and business.” It connects news + prices + macro data + AI reasoning to explain impact in simple terms. # Mali Backend Backend for an AI-powered Kenyan financial intelligence app that turns economic signals into simple, practical explanations for households and small businesses. The API combines scraped market data, Supabase storage, Firebase-authenticated user flows, and AI-generated summaries to answer one question clearly: what does this change mean for my day-to-day costs? ## What The Backend Does - Serves a FastAPI API for dashboard, impact analysis, feed, profile, auth, and AI chat features. - Stores operational data in Supabase Postgres. - Pulls economic inputs from fuel, forex, food, and feed fetchers. - Generates household-impact summaries with the AI insight pipeline. - Runs a background monthly archive job for user spending snapshots. - Supports protected mobile-app flows with Firebase ID token verification. ## Stack - FastAPI for the HTTP and WebSocket API. - Supabase for database access. - Firebase Admin SDK for token verification and password updates. - Google Gemini and OpenRouter in the insight pipeline. - Azure AI Foundry-backed chat model for the Mali chat agent. - APScheduler for recurring background jobs. - Azure for hosting. - GitHub Actions or cron callers for protected fetcher triggers. ## High-Level Architecture 1. Fetchers collect economic data such as fuel prices, forex rates, food basket values, and feed items. 2. The API persists and reads those records from Supabase. 3. The insight pipeline turns raw changes into plain-language summaries and impact scores. 4. Dashboard and impact endpoints aggregate that data into app-ready payloads. 5. Mali chat answers user questions through a tool-enabled agent that can query internal data and public web context. 6. A monthly scheduler archives spending snapshots for historical analysis. ## Project Layout ```text . ├── main.py # FastAPI application entrypoint ├── start.sh # Local dev start command ├── requirements.txt ├── core/ │ └── config.py …