A web-based application for visualizing voter turnout data on interactive maps with multi-dataset support and advanced geocoding capabilities.
- Python 3.8+
- pip (Python package manager)
- Git
- Clone the repository
git clone https://github.com/Drew-CodeRGV/WhoVoted.git
cd WhoVoted- Install Python dependencies
cd backend
pip install -r requirements.txt- Configure environment (optional)
cp .env.example .env
# Edit .env with your settings- Start the application
Linux/Mac:
./start.shWindows:
start.batOr manually:
python backend/app.py- Access the application
- Public Map: http://localhost:5000
- Admin Dashboard: http://localhost:5000/admin
- Username:
admin - Password:
admin2026!
- Username:
- Interactive Map: Visualize voter locations on an interactive Leaflet map
- Multi-Dataset Support: Switch between multiple election datasets
- Party Filtering: Filter by Democratic, Republican, or All voters
- Year Display: Datasets show election year in the selector
- Search: Search for specific addresses or voters
- Precinct Boundaries: Optional precinct boundary overlays
- File Upload: Upload CSV/Excel voter roll files
- Real-time Processing: Monitor geocoding progress with two-color progress bar
- Green: Previously cached addresses (instant)
- Blue: Newly geocoded addresses (parallel processing)
- Multi-File Upload: Process multiple files simultaneously
- Duplicate Detection: Automatic detection and handling of duplicate datasets
- Job Monitoring: Track processing status and history
- Error Handling: Download error reports for failed geocoding
- Multi-Provider Fallback:
- Cache (77,000+ pre-geocoded addresses)
- AWS Location Service (Esri/HERE data)
- US Census Bureau
- Photon (OpenStreetMap)
- Nominatim (OpenStreetMap)
- 90%+ Cache Hit Rate: Most addresses geocoded instantly
- Parallel Processing: Configurable worker count (default: 20)
- Smart Caching: Persistent cache across sessions
WhoVoted/
βββ backend/ # Flask backend
β βββ app.py # Main Flask application
β βββ processor.py # Data processing pipeline
β βββ geocoder.py # Multi-provider geocoding
β βββ auth.py # Authentication
β βββ upload.py # File upload handling
β βββ config.py # Configuration
β βββ admin/ # Admin dashboard
β β βββ dashboard.html
β β βββ dashboard.js
β βββ requirements.txt # Python dependencies
βββ public/ # Frontend (served by Flask)
β βββ index.html # Main map interface
β βββ map.js # Map functionality
β βββ ui.js # UI components
β βββ data.js # Data loading
β βββ styles.css # Styles
βββ data/ # Backend data storage
β βββ geocoded_addresses.json # 77K+ cached addresses
β βββ map_data*.json # Processed datasets
β βββ metadata*.json # Dataset metadata
βββ uploads/ # Temporary upload storage
βββ logs/ # Application logs
βββ deprecated-v1/ # Old version (archived)
βββ tests/ # Test suite
Create a .env file in the backend/ directory:
# Admin Credentials
ADMIN_USERNAME=admin
ADMIN_PASSWORD=your-secure-password
# AWS Location Service (Optional)
AWS_LOCATION_PLACE_INDEX=WhoVotedPlaceIndex
AWS_DEFAULT_REGION=us-east-1
# Session Configuration
SECRET_KEY=your-secret-key-here
SESSION_TIMEOUT_HOURS=24
# Processing
MAX_FILE_SIZE_MB=100For improved geocoding accuracy, configure AWS Location Service:
- Create an AWS account
- Set up AWS Location Service Place Index
- Configure AWS credentials:
aws configureSee AWS_LOCATION_SERVICE_SETUP.md for detailed instructions.
Required columns:
ADDRESS- Street addressPRECINCT- Precinct numberBALLOT STYLE- Ballot style code
Optional columns:
VUID- Voter Unique IDCERT- Certificate numberFIRSTNAME,LASTNAME,MIDDLENAME,SUFFIX- Name componentsPARTY- Party affiliation (D/R)CHECK-IN- Check-in timeSITE- Voting site
See CSV_FORMAT.md for detailed specifications.
Run the test suite:
npm testRun specific tests:
npm test -- tests/unit/dataset-manager.test.js- ARCHITECTURE.md - System architecture
- QUICK_START_AWS.md - AWS setup guide
- DOCUMENTATION_INDEX.md - Complete documentation index
- CHANGELOG.md - Version history
- DEPRECATION_SUMMARY.md - v1.0 deprecation notice
- Admin dashboard requires authentication
- Session-based authentication with configurable timeout
- File upload validation and size limits
- CORS configuration for production deployment
- Secure password hashing (change default password!)
- Change default admin password in
.env - Generate secure SECRET_KEY:
import secrets
print(secrets.token_urlsafe(32))- Configure CORS_ORIGINS for your domain
- Set up HTTPS (required for production)
- Configure AWS credentials (if using AWS Location Service)
- Set LOG_LEVEL=WARNING for production
- Traditional Server: Run with gunicorn or uwsgi
- Docker: Create Dockerfile (see ARCHITECTURE.md)
- Cloud: Deploy to AWS, Google Cloud, or Azure
- GitHub Pages: Frontend only (requires separate backend)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Leaflet - Interactive mapping library
- OpenStreetMap - Map tiles and geocoding data
- AWS Location Service - Enhanced geocoding accuracy
- US Census Bureau - Geocoding API
- Flask - Python web framework
- Repository: https://github.com/Drew-CodeRGV/WhoVoted
- Issues: https://github.com/Drew-CodeRGV/WhoVoted/issues
- Backend-driven architecture with Flask
- Admin dashboard with real-time processing
- Multi-dataset support with visual selector
- Advanced geocoding with 77K+ cached addresses
- Two-color progress bar (cached vs new)
- Parallel processing for performance
- Single-page application
- Client-side data loading
- Basic geocoding
- Archived in
deprecated-v1/
Made with β€οΈ for civic engagement and voter transparency