✨ Features: - Backend FastAPI complete (25 Python files) - 5 SQLAlchemy models (Device, HardwareSnapshot, Benchmark, Link, Document) - Pydantic schemas for validation - 4 API routers (benchmark, devices, links, docs) - Authentication with Bearer token - Automatic score calculation - File upload support - Frontend web interface (13 files) - 4 HTML pages (Dashboard, Devices, Device Detail, Settings) - 7 JavaScript modules - Monokai dark theme CSS - Responsive design - Complete CRUD operations - Client benchmark script (500+ lines Bash) - Hardware auto-detection - CPU, RAM, Disk, Network benchmarks - JSON payload generation - Robust error handling - Docker deployment - Optimized Dockerfile - docker-compose with 2 services - Persistent volumes - Environment variables - Documentation & Installation - Automated install.sh script - README, QUICKSTART, DEPLOYMENT guides - Complete API documentation - Project structure documentation 📊 Stats: - ~60 files created - ~5000 lines of code - Full MVP feature set implemented 🚀 Ready for production deployment! 🤖 Generated with Claude Code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Linux BenchTools - Backend
Backend API FastAPI pour Linux BenchTools.
Structure
backend/
├── app/
│ ├── api/ # Endpoints API
│ ├── core/ # Configuration et sécurité
│ ├── models/ # Modèles SQLAlchemy
│ ├── schemas/ # Schémas Pydantic
│ ├── db/ # Configuration base de données
│ ├── utils/ # Utilitaires
│ └── main.py # Application principale
├── data/ # Base SQLite (gitignored)
├── Dockerfile
└── requirements.txt
Installation locale (développement)
# Créer un environnement virtuel
python3 -m venv venv
source venv/bin/activate
# Installer les dépendances
pip install -r requirements.txt
# Définir les variables d'environnement
export API_TOKEN="your-secret-token"
export DATABASE_URL="sqlite:///./backend/data/data.db"
export UPLOAD_DIR="./uploads"
# Lancer le serveur
uvicorn app.main:app --reload --host 0.0.0.0 --port 8007
Endpoints API
Benchmarks
POST /api/benchmark- Soumettre un benchmark (auth required)GET /api/benchmarks/{id}- Détails d'un benchmark
Devices
GET /api/devices- Liste des devices (pagination + recherche)GET /api/devices/{id}- Détails d'un deviceGET /api/devices/{id}/benchmarks- Historique benchmarksPUT /api/devices/{id}- Modifier un device
Links
GET /api/devices/{id}/links- Liens d'un devicePOST /api/devices/{id}/links- Ajouter un lienPUT /api/links/{id}- Modifier un lienDELETE /api/links/{id}- Supprimer un lien
Documents
GET /api/devices/{id}/docs- Documents d'un devicePOST /api/devices/{id}/docs- Upload documentGET /api/docs/{id}/download- Télécharger documentDELETE /api/docs/{id}- Supprimer document
Autres
GET /api/health- Health checkGET /api/stats- Statistiques globales
Documentation interactive
Une fois le serveur lancé, accédez à :
- Swagger UI : http://localhost:8007/docs
- ReDoc : http://localhost:8007/redoc
Variables d'environnement
| Variable | Description | Défaut |
|---|---|---|
API_TOKEN |
Token d'authentification | CHANGE_ME |
DATABASE_URL |
URL de la base SQLite | sqlite:///./backend/data/data.db |
UPLOAD_DIR |
Répertoire des uploads | ./uploads |
CORS_ORIGINS |
Origins CORS autorisées | ["*"] |
Authentification
L'API utilise un token Bearer simple pour l'endpoint POST /api/benchmark :
Authorization: Bearer YOUR_API_TOKEN
Base de données
SQLite avec 5 tables principales :
devices- Machineshardware_snapshots- Snapshots hardwarebenchmarks- Résultats de benchmarksmanufacturer_links- Liens constructeursdocuments- Documents uploadés
Développement
# Linter
flake8 app/
# Format code
black app/
# Type checking
mypy app/