# 🌙 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 …