Logo Lanfrica

Jomar77/Tunisia-House-Price-Predictor

Domain:

socioeconomic
Creator:
Jom
Host:
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 …