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 β¦