# đŸ—łïž SystĂšme de Vote Électronique - DĂ©ploiement ✅ ## Status: EN PRODUCTION ✅ **Date:** 5 novembre 2025 **Branche:** `paul/evoting` sur gitea.vidoks.fr **DerniĂšre version:** Commit `15a52af` --- ## 🚀 DĂ©marrage rapide ```bash # Lancer les services Docker docker-compose up -d # ArrĂȘter les services docker-compose down # Voir les logs du backend docker logs evoting_backend # Voir les logs de la BDD docker logs evoting_db ``` --- ## 🌐 AccĂšs | Service | URL | Port | |---------|-----|------| | **Frontend** | http://localhost:3000 | 3000 | | **API Backend** | http://localhost:8000 | 8000 | | **Docs API** | http://localhost:8000/docs | 8000 | | **Base de donnĂ©es** | mariadb:3306 | 3306 | --- ## 📩 Services Docker ```bash ✅ evoting-frontend : Node.js 20 + http-server ✅ evoting-backend : Python 3.12 + FastAPI ✅ evoting_db : MariaDB 11.4 ``` **VĂ©rifier le status:** ```bash docker ps ``` --- ## 🔐 Post-Quantum Cryptography (PQC) ### ImplĂ©mentation Active ✅ - **ML-DSA-65 (Dilithium)** - Signatures post-quantiques (FIPS 204) - **ML-KEM-768 (Kyber)** - Chiffrement post-quantique (FIPS 203) - **RSA-PSS** - Signatures classiques (dĂ©fense en profondeur) - **ElGamal** - Chiffrement classique (dĂ©fense en profondeur) **Code:** `/src/crypto/pqc_hybrid.py` (275 lignes) ### Mode d'utilisation Le code PQC est prĂȘt mais fonctionne en mode dĂ©gradĂ©: - **Sans liboqs:** Uses classical crypto only (RSA-PSS + ElGamal) - **Avec liboqs:** Activate hybrid (RSA + Dilithium + Kyber + ElGamal) #### Activer la PQC complĂšte: ```bash # Option 1: Installation locale pip install liboqs-python # Option 2: Docker avec support PQC # Éditer Dockerfile.backend pour ajouter: # RUN pip install liboqs-python # Puis: docker-compose up -d --build ``` --- ## 📊 API Endpoints ### Élections ``` GET /api/elections/active - Élection active GET /api/elections//results - RĂ©sultats ``` ### Vote ``` POST /api/votes/submit - Soumettre un vote GET /api/votes/verify/ - VĂ©rifier un vote ``` ### Voter ``` POST /api/voters/register - Enregistrer voter GET /api/voters/check - VĂ©rifier si voter existe ``` --- ## đŸ§Ș Tests ```bash # Lancer tous les tests pytest # Tests crypto classiques pytest tests/test_crypto.py # Tests PQC (si liboqs disponible) pytest tests/test_pqc.py # Avec couverture pytest --cov=src tests/ ``` --- ## đŸ—„ïž Base de DonnĂ©es ### Tables - `voters` - Enregistrement des votants - `elections` - Élections avec dates - `candidates` - Candidats par Ă©lection - `votes` - Votes avec signatures - `audit_logs` - Journal d'audit ### DonnĂ©es initiales - 1 Ă©lection active: "Élection PrĂ©sidentielle 2025" - 4 candidats: Alice, Bob, Charlie, Diana - Dates: 3-10 novembre 2025 --- ## 📝 Configuration Fichier `.env`: ```env DB_HOST=mariadb DB_PORT=3306 DB_NAME=evoting_db DB_USER=evoting_user DB_PASSWORD=evoting_pass123 SECRET_KEY=dev-secret-key-change-in-production-12345 DEBUG=false BACKEND_PORT=8000 FRONTEND_PORT=3000 ``` ⚠ **Production:** Changez tous les secrets ! --- ## 🔧 DĂ©pannage ### Backend ne dĂ©marre pas ```bash # VĂ©rifier les logs docker logs evoting_backend # Reconstruire l'image docker-compose down docker-compose up -d --build ``` ### Base de donnĂ©es non disponible ```bash # VĂ©rifier MariaDB docker logs evoting_db # RĂ©initialiser la BD docker-compose down -v # Attention: supprime les donnĂ©es docker-compose up -d ``` ### CORS ou connexion API ```bash # VĂ©rifier que backend rĂ©pond curl http://localhost:8000/api/elections/active # VĂ©rifier que frontend accĂšde Ă  l'API # (DevTools > Network) ``` --- ## 📂 Structure du projet ``` . ├── docker/ │ ├── Dockerfile.backend │ ├── Dockerfile.frontend │ └── init.sql ├── src/ │ ├── backend/ # FastAPI (11 modules) │ ├── crypto/ # Crypto classique + PQC (5 modules) │ └── frontend/ # HTML5 SPA (1 fichier) ├── tests/ # test_crypto.py, test_pqc.py ├── rapport/ # main.typ (Typst) ├── docker-compose.yml # Orchestration ├── pyproject.toml # DĂ©pendances Python ├── .env # Configuration ├── Makefile # Commandes rapides └── README.md # Guide technique PQC ``` --- ## 🎯 Prochain pas 1. ✅ **Site fonctionnel** - COMPLÉTÉ 2. ✅ **Post-quantum prĂȘt** - COMPLÉTÉ 3. ⏳ **IntĂ©gration PQC dans endpoints** - À faire (code prĂȘt) 4. ⏳ **Tests end-to-end PQC** - À faire --- ## 📞 Support Voir `.claude/POSTQUANTUM_CRYPTO.md` pour dĂ©tails cryptographiques. --- **DerniĂšre mise Ă  jour:** 5 novembre 2025 **Statut:** Production Ready âœ