An academic FastAPI project providing access to a rich collection of Tunisian proverbs and traditional wisdom.
# 🌟 7keyet-zmen (حكايات زمان) - Tunisian Proverbs API
An academic FastAPI project providing access to a rich collection of Tunisian proverbs and traditional wisdom.
## 📋 Project Overview
This RESTful API allows users to browse, search, and interact with over 1600 Tunisian proverbs. Built with FastAPI, it demonstrates modern API development practices including proper architecture, testing, documentation, and deployment.
## ✨ Features
- 📚 **Browse Proverbs**: Paginated list of all proverbs
- 🎲 **Random Proverb**: Get a random proverb for inspiration
- 🔍 **Search**: Full-text search in proverb content
- 📊 **Filtering & Sorting**: Advanced query capabilities
- 🤖 **ML Classification**: Automatic categorization of proverbs into 15 themes using supervised machine learning
- 🌐 **Auto-Translation**: Automatic Arabic-to-English translation using MyMemory API
- 🔐 **Authentication**: JWT-based auth for write operations
- 📖 **Auto-Generated Docs**: Swagger UI and ReDoc
- ✅ **Comprehensive Testing**: Unit and integration tests
- 🐳 **Docker Support**: Containerized deployment
## 🛠️ Tech Stack
- **Framework**: FastAPI 0.115.0
- **Database**: SQLite (dev) / PostgreSQL (prod)
- **ORM**: SQLAlchemy 2.0
- **Validation**: Pydantic V2
- **Machine Learning**: scikit-learn 1.8.0 (TF-IDF + Naive Bayes)
- **Testing**: pytest, httpx
- **Documentation**: Swagger UI, ReDoc
## 📁 Project Structure
```
7keyet-zmen/
├── app/
│ ├── main.py # FastAPI app entry point
│ ├── config.py # Configuration management
│ ├── database.py # Database setup
│ ├── models/ # SQLAlchemy models
│ ├── schemas/ # Pydantic schemas
│ ├── services/ # Business logic
│ ├── api/v1/ # API endpoints
│ ├── auth/ # Authentication
│ └── ml/ # Machine Learning classifier
├── tests/ # Test suite
├── data/ # Data files
│ ├── complete_proverbs.json # F …