# π Aminu AI β Hausa Intelligent Assistant
A full-stack, production-grade Hausa AI chatbot with voice support.
```
Stack: Python Β· FastAPI Β· Next.js Β· PostgreSQL Β· Qwen2.5-7B Β· Hugging Face Β· RunPod Β· Whisper STT Β· Coqui TTS
```
---
## Architecture Overview
```
Browser (Next.js 14)
β
βββ Text message βββΊ POST /api/chat βββΊ LLM Service
β β
βββ Voice message βββΊ POST /api/voice βββ RunPod (primary, GPU)
β β βββ Ollama local (fallback)
β Whisper STT
β (transcribe audio)
β
βββ TTS reply βββ Coqui TTS / gTTS
FastAPI βββΊ PostgreSQL (sessions + messages)
βββΊ Redis (optional caching)
```
---
## Project Structure
```
aminu-ai/
βββ backend/
β βββ app/
β β βββ main.py # FastAPI app entry point
β β βββ api/chat.py # All API routes
β β βββ core/
β β β βββ config.py # Settings (pydantic-settings)
β β β βββ schemas.py # Pydantic request/response models
β β βββ db/base.py # SQLAlchemy async engine + Base
β β βββ models/chat.py # ORM models (Session, Message)
β β βββ services/
β β βββ llm.py # RunPod + Ollama LLM service
β β βββ stt.py # Whisper speech-to-text
β β βββ tts.py # Coqui / gTTS text-to-speech
β βββ requirements.txt
β βββ Dockerfile
β βββ .env.example
βββ frontend/
β βββ app/
β β βββ layout.tsx
β β βββ page.tsx # Main chat UI
β β βββ globals.css
β βββ components/
β β βββ ChatMessage.tsx # Message bubble
β β βββ VoiceButton.tsx # Mic record/stop UI
β β βββ AudioPlayer.tsx # TTS audio playback
β βββ lib/
β β βββ api.ts # Axios API client
β β βββ useVoiceRecorder.ts # MediaRecorder hook
β βββ .env.example
βββ deployment/
β βββ runpod_handler.py # RunPod serverless handler
β βββ Dockerfile.runpod # RunPod GPU β¦