contains a machine learning model for predicting house prices in Tunisia using various algorithms and data analysis techniques. It includes a Jupyter notebook for data cleaning and analysis, as well as instructions for setting up and running the code. The project was originally intended for deployment on a website but was not successful.
# Tunisia House Price Predictor
A full-stack web application for predicting house prices in Tunisia using machine learning.
## 🏗️ Architecture
This project follows a **Hexagonal Architecture** (Ports & Adapters) pattern:
- **Frontend**: React + TypeScript + Vite + TanStack Query
- **Backend**: FastAPI (async) with hexagonal architecture
- **Model**: Safe artifact loading with Safetensors (no pickle)
- **Deployment Ready**: Containerizable, serverless-compatible
## 🚀 Quick Start
### Prerequisites
- Python 3.11+
- Node.js 18+
- npm
### Backend Setup
```bash
# Install Python dependencies
pip install -r requirements.txt
# Start the FastAPI server (from project root)
python -m uvicorn backend.main:app --reload --port 8000
```
The API will be available at `
localhost` with interactive docs at `
localhost`.
### Frontend Setup
```bash
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
```
The frontend will be available at `
localhost`.
## 📁 Project Structure
**Organized & Clean**: This repository follows clear separation of concerns with all files in logical folders.
See docs/PROJECT_STRUCTURE.md for detailed folder organization and design principles.
### Quick Overview
```
├── backend/ # FastAPI backend (hexagonal architecture)
│ ├── domain/ # Core business logic
│ │ ├── predictor.py # Prediction service
│ │ └── vectorizer.py # Feature vectorization
│ ├── adapters/ # External interfaces
│ │ ├── api/ # FastAPI routes & schemas
│ │ └── inference/ # Model loading (Safetensors)
│ └── main.py # Application entry point
├── frontend/ # React + TypeScript + Vite SPA
│ ├── src/
│ │ ├── api/ # API client (native fetch)
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom hooks (TanSt …