Get the distributed voting system running locally in 5 minutes.
- Docker and Docker Compose installed
- 4GB+ available RAM
- Ports 5432, 5672, 6379, 8000, 9090, 3001, 15672 available
# 1. Start all services
make up
# 2. Wait ~30 seconds, then initialize the system
make init
# 3. Check service health
make health
# 4. View service URLs
make urls
# 5. View logs
make logs# 1. Start all services
docker-compose up -d
# 2. Wait ~30 seconds for services to be healthy
docker-compose ps
# 3. Initialize the system
./scripts/init_system.sh
# 4. Check services are running
docker-compose ps# Using Make
make health
# Or manually
curl http://localhost:8000/health
curl -u guest:guest http://localhost:15672/api/overview
docker-compose exec redis redis-cli ping
docker-compose exec postgres psql -U voting_user -d voting -c "SELECT 1"- API Documentation: http://localhost:8000/docs
- RabbitMQ Management: http://localhost:15672 (guest/guest)
- Grafana Dashboards: http://localhost:3001 (admin/admin)
- Prometheus: http://localhost:9090
# Submit a vote via API
curl -X POST http://localhost:8000/api/v1/vote \
-H "Content-Type: application/json" \
-d '{
"nas": "123456789",
"code": "ABC123",
"law_id": "LAW001",
"vote": "oui"
}'# Check validation queue
curl -u guest:guest http://localhost:15672/api/queues/%2F/validation_queue
# Check database for votes
docker-compose exec postgres psql -U voting_user -d voting \
-c "SELECT * FROM vote_results;"
# Check Redis for hash count
docker-compose exec redis redis-cli SCARD valid_hashes# Scale validation workers to 5
make scale-workers WORKERS=5
# Or with docker-compose
docker-compose up -d --scale validation-worker=5# All services
make logs
# Specific service
make logs-api
make logs-worker
# Or with docker-compose
docker-compose logs -f ingestion-apimake help # Show all available commands
make stats # Show system statistics
make ps # Show running containers
make restart # Restart all services
make down # Stop all services
make urls # Show service URLs# Generate 1000 sample hashes
cd services/hash_generator
python generate_hashes.py --count 1000 --output ../../data/hashes/sample.json
# Load into Redis
python ../../scripts/load_hashes_to_redis.pySee data/samples/ directory for sample vote data.
- Open http://localhost:3001
- Login: admin/admin
- Navigate to Dashboards
- View "Voting System Overview"
- Votes/second: Current ingestion rate
- Queue depth: Messages waiting to be processed
- Duplicate rate: Percentage of duplicate votes
- Response time: API latency
# Check logs
make logs
# Check Docker resources
docker system df
# Restart services
make restartEdit docker-compose.yml and change host ports:
ports:
- "8001:8000" # Change 8000 to 8001# Check PostgreSQL logs
docker-compose logs postgres
# Verify database is initialized
docker-compose exec postgres psql -U voting_user -d voting -c "\dt"# Check Redis is running
docker-compose exec redis redis-cli ping
# Check Redis logs
docker-compose logs redis- Load Production Hashes: Generate and load your full hash database
- Configure Monitoring: Set up Grafana dashboards and alerts
- Run Load Tests: Test system under peak load
- Deploy to Kubernetes: See
k8s/directory for production deployment - Read Architecture: Review
ARCHITECTURE.mdfor system design
# Stop (keep data)
make down
# Stop and remove all data
make down-clean # WARNING: Deletes all volumes!- Check service logs:
make logs - View health status:
make health - See statistics:
make stats - Read detailed docs:
DOCKER_SETUP.md - Review architecture:
ARCHITECTURE.md
For development with hot-reload:
# Start in development mode
make dev
# This starts all services plus:
# - Source code mounted as volumes
# - Auto-reload on code changes
# - Debug logging enabled
# - Additional monitoring exporters
# - Adminer for database management