# 🏛️ HCP TTA Analytics Assistant
**Intelligent Analytical Assistant for Socio-Economic Data**
*Tanger-Tétouan-Al Hoceïma Region — Haut-Commissariat au Plan*
---
## 📋 Overview
A full-stack AI-powered analytics platform that enables natural language querying of official HCP (Haut-Commissariat au Plan) socio-economic datasets for the Tanger-Tétouan-Al Hoceïma region of Morocco.
Users ask questions in French natural language. The system interprets intent via an LLM, executes deterministic backend computations, and returns structured results with interactive charts, data tables, and professional PDF reports — **with zero hallucination by design**.
---
## ✨ Features
| Feature | Description |
|---------|-------------|
| **🤖 AI Analytics Engine** | Natural language → structured JSON → deterministic backend computation. The LLM never generates data — only selects functions. |
| **📊 Interactive Visualizations** | Bar charts, line charts, and data tables rendered via Recharts, driven entirely by backend-computed data. |
| **📄 PDF Report Export** | Professional branded PDF reports with high-fidelity SVG→Canvas chart capture, auto-formatted tables, and metadata. |
| **🔐 Auth & Admin Dashboard** | JWT-based authentication, user management, role-based access, and administrative analytics panel. |
| **📁 Dataset Upload System** | Upload and manage CSV datasets through a drag-and-drop interface with validation. |
| **💬 Chat History** | Persistent conversation storage with rename, delete, and reload — backed by SQLite. |
| **🔍 Smart Data Diagnostics** | When data is missing, the system explains *why* and suggests real alternatives from the dataset. |
| **🌗 Dark/Light Mode** | Premium glassmorphic UI with full theme switching and smooth animations. |
---
## 🏗️ Architecture
### System Design
```
┌─────────────────────────────────────────────────────────────────────┐
│ USER (French NL) │
│ "Quel es …