Core Integration: - Create API client with TypeScript types for all endpoints - Implement authentication context provider for user state management - Add protected route component for dashboard access control - Connect login/register pages to backend authentication endpoints - Implement user session persistence with localStorage tokens Authentication: - Login page now connects to /api/auth/login endpoint - Register page connects to /api/auth/register with validation - Password strength requirements (min 8 chars) - Form validation and error handling - Automatic redirect to dashboard on successful auth - Logout functionality with session cleanup Protected Routes: - Dashboard pages require authentication - Non-authenticated users redirected to login - Loading spinner during auth verification - User name displayed in dashboard header - Proper session management Election/Vote APIs: - Dashboard fetches active elections from /api/elections/active - Display real election data with candidates count - Handle loading and error states - Skeleton loaders for better UX Type Safety: - Full TypeScript interfaces for all API responses - Proper error handling with try-catch blocks - API response types: AuthToken, VoterProfile, Election, Candidate, Vote, VoteHistory Environment: - API URL configurable via NEXT_PUBLIC_API_URL env variable - Default to http://localhost:8000 for local development 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
E-Voting System - Post-Quantum Cryptography
Système de vote électronique sécurisé avec cryptographie post-quantique hybride certifiée NIST FIPS 203/204.
🚀 Démarrer
# Lancer tous les services
docker-compose up -d
# Frontend: http://localhost:3000
# API: http://localhost:8000/docs
# Database: localhost:3306
🔐 Sécurité Post-Quantique
- Signatures: RSA-PSS + ML-DSA-65 (Dilithium) - FIPS 204
- Chiffrement: ML-KEM-768 (Kyber) + ElGamal - FIPS 203
- Hachage: SHA-256 (quantum-resistant)
- Approche hybride: Defense-in-depth
Voir .claude/POSTQUANTUM_CRYPTO.md pour les détails.
📁 Structure
.
├── docker/ # Configuration Docker
├── src/
│ ├── backend/ # API FastAPI
│ ├── crypto/ # Cryptographie classique + PQC
│ └── frontend/ # Interface web
├── tests/ # Tests unitaires
├── docker-compose.yml
└── README.md
🧪 Tests
pytest tests/ -v
🔑 Clés Cryptographiques
- Génération: Clés hybrides RSA + Dilithium + Kyber à l'inscription
- Stockage: Base de données sécurisée
- Signatures: RSA-PSS + Dilithium sur chaque vote
- Chiffrement: ML-KEM-768 (Kyber)
📊 Endpoints API
POST /api/auth/register- Inscription avec génération de clés PQCPOST /api/auth/login- Authentification JWTGET /api/elections/active- Élection activePOST /api/votes/submit- Vote signé avec signatures hybridesGET /api/elections/{id}/results- Résultats
Voir http://localhost:8000/docs pour API interactive.
Production-ready post-quantum e-voting system 🔐 MIT