- Added HistoriquePage component to display user's voting history with detailed statistics and vote cards. - Created UpcomingVotesPage component to show upcoming elections with a similar layout. - Developed CSS styles for both pages to enhance visual appeal and responsiveness. - Integrated API calls to fetch user's votes and upcoming elections. - Added a rebuild script for Docker environment setup and data restoration. - Created a Python script to populate the database with sample data for testing.
58 lines
1.8 KiB
Makefile
58 lines
1.8 KiB
Makefile
.PHONY: help build up down logs logs-frontend logs-backend test clean restore-db
|
|
|
|
help:
|
|
@echo "E-Voting System - Post-Quantum Cryptography"
|
|
@echo ""
|
|
@echo "🚀 MAIN COMMAND"
|
|
@echo " make build 🔨 Build frontend + deploy (RECOMMANDÉ)"
|
|
@echo ""
|
|
@echo "📦 PRODUCTION"
|
|
@echo " make up 🔄 Redémarrer (sans rebuild)"
|
|
@echo " make down ⏹️ Arrêter les conteneurs"
|
|
@echo " make restore-db 🗄️ Restaurer les données de test"
|
|
@echo ""
|
|
@echo "📊 LOGS"
|
|
@echo " make logs-frontend 📝 Logs du frontend"
|
|
@echo " make logs-backend 📝 Logs du backend"
|
|
@echo ""
|
|
@echo "🧪 TESTS"
|
|
@echo " make test 🧪 Tester (pytest)"
|
|
@echo " make clean 🗑️ Nettoyer complètement"
|
|
|
|
# Commande principale: build + deploy + restore DB
|
|
build:
|
|
./build.sh
|
|
@echo "⏳ Attendre le démarrage de la base de données (5 secondes)..."
|
|
@sleep 5
|
|
@echo "🗄️ Restauration des données de test..."
|
|
@python3 restore_data.py
|
|
|
|
# Redémarrage simple (utilise l'image existante)
|
|
up:
|
|
cd build && docker-compose up -d 2>/dev/null || docker-compose up -d
|
|
|
|
down:
|
|
cd build && docker-compose down 2>/dev/null || docker-compose down
|
|
|
|
# Restauration des données de test uniquement
|
|
restore-db:
|
|
@echo "🗄️ Restauration des données de test..."
|
|
@python3 restore_data.py
|
|
|
|
# Logs
|
|
logs-frontend:
|
|
cd build && docker-compose logs -f frontend 2>/dev/null || echo "Conteneurs non trouvés. Lancez: make build"
|
|
|
|
logs-backend:
|
|
cd build && docker-compose logs -f backend 2>/dev/null || echo "Conteneurs non trouvés. Lancez: make build"
|
|
|
|
# Tests
|
|
test:
|
|
pytest tests/ -v
|
|
|
|
# Cleanup
|
|
clean:
|
|
rm -rf build/ frontend/build/ frontend/node_modules/.cache/ 2>/dev/null || true
|
|
docker system prune -f 2>/dev/null || true
|
|
docker image rm build-frontend build-backend 2>/dev/null || true
|