# 🔧 GarageManager > Application de gestion de garage automobile — suivi véhicules, interventions et pièces. [![Python](https://img.shields.io/badge/Python-3.11-blue)](https://python.org) [![FastAPI](https://img.shields.io/badge/FastAPI-latest-009688)](https://fastapi.tiangolo.com) [![Docker](https://img.shields.io/badge/Docker-compose-2496ED)](https://docs.docker.com/compose/) --- ## ✨ Fonctionnalités - **Véhicules** — Enregistrement complet (immatriculation, VIN, kilométrage, marque/modèle/année) - **Interventions** — Historique par véhicule avec date, kilométrage, technicien, coûts main d'œuvre - **Pièces** — Suivi par intervention avec référence, marque, prix, quantité et photo optionnelle - **Clients** — Gestion des propriétaires de véhicules - **Infos & Notes** — Ajout de textes, URLs et photos sur chaque véhicule - **Dashboard** — Vue d'ensemble : stats globales, dernières interventions ## 🎨 Design Thème sombre futuriste inspiré du projet `location` de Perco : - Fond noir (`#0a0f1a`) avec dégradés subtils cyan/jaune - Accents électriques : cyan `#00d4ff` et volt `#facc15` - Police [Outfit](https://fonts.google.com/specimen/Outfit) + [JetBrains Mono](https://www.jetbrains.com/lp/mono/) pour les références/immatriculations - Sidebar dark avec navigation intuitive ## 🚀 Démarrage rapide ```bash # Lancer le service cd /opt/container/garagemanager docker compose up -d # Rebuild complet (après modif templates/code) docker compose build --no-cache && docker compose up -d # Logs docker compose logs -f ``` ## 🏗️ Architecture ``` garagemanager/ ├── app/ │ ├── __init__.py │ └── main.py # FastAPI routes + SQLite logic ├── templates/ # Jinja2 templates (thème dark) │ ├── base.html # Layout sidebar + variables CSS │ ├── dashboard.html # Stats cards + tableau récent │ ├── vehicules.html # Liste véhicules │ ├── vehicule_form.html │ ├── vehicule_detail.html # Interventions + pièces + infos │ ├── interventions.html │ ├── intervention_form.html │ ├── intervention_detail.html # Détail + gestion pièces │ ├── clients.html │ ├── client_form.html │ └── client_detail.html ├── data/ │ └── garage.db # Base SQLite (volume Docker) ├── Dockerfile ├── docker-compose.yml └── requirements.txt ``` ## 🔌 API REST FastAPI génère automatiquement la documentation : - **Swagger UI** : https://garage.nas.percolouco.com/docs - **ReDoc** : https://garage.nas.percolouco.com/redoc ### Endpoints principaux | Méthode | Route | Description | |---------|-------|-------------| | `GET` | `/` | Dashboard | | `GET` | `/vehicules` | Liste des véhicules | | `POST` | `/vehicules/new` | Créer un véhicule | | `GET` | `/vehicules/{id}` | Détail véhicule | | `GET` | `/interventions` | Liste des interventions | | `POST` | `/interventions/new` | Créer une intervention | | `POST` | `/interventions/{id}/pieces/add` | Ajouter une pièce | ## 🗃️ Modèle de données (SQLite) ```sql -- Clients CREATE TABLE clients ( id TEXT PRIMARY KEY, nom TEXT NOT NULL, prenom TEXT NOT NULL, telephone TEXT, email TEXT, adresse TEXT, created_at TEXT ); -- Véhicules CREATE TABLE vehicules ( id TEXT PRIMARY KEY, immatriculation TEXT NOT NULL, marque TEXT NOT NULL, modele TEXT NOT NULL, annee INTEGER, kilometrage INTEGER, vin TEXT, client_id TEXT REFERENCES clients(id), created_at TEXT ); -- Interventions CREATE TABLE interventions ( id TEXT PRIMARY KEY, vehicule_id TEXT NOT NULL REFERENCES vehicules(id), description TEXT NOT NULL, date_intervention TEXT, kilometrage_intervention INTEGER, cout_main_oeuvre REAL DEFAULT 0, technicien TEXT, notes TEXT, created_at TEXT ); -- Pièces CREATE TABLE pieces ( id TEXT PRIMARY KEY, intervention_id TEXT NOT NULL REFERENCES interventions(id), nom TEXT NOT NULL, reference TEXT, marque TEXT, prix REAL DEFAULT 0, quantite INTEGER DEFAULT 1, photo TEXT, created_at TEXT ); ``` ## ⚙️ Configuration | Variable d'env | Défaut | Description | |----------------|--------|-------------| | `DB_PATH` | `/data/garage.db` | Chemin vers la base SQLite | ## 🌐 Accès - **Production** : https://garage.nas.percolouco.com - **Réseau interne** : via Traefik sur le réseau Docker `proxy` --- *Développé par l'équipe Perco — Design Luca, Backend intégré FastAPI*