A data-driven lottery prediction website built with Python Flask backend, Vue.js frontend, and LangChain integration. Features historical data analysis, multiple prediction algorithms, and strict ethical compliance with responsible gambling requirements.
- Historical Data Analysis: Comprehensive analysis of lottery draw patterns and trends
- Multiple Prediction Methods:
- Weighted frequency analysis
- Markov chains modeling
- Ensemble methods
- LangChain AI integration with explainable reasoning
- Ethical AI Compliance:
- Confidence scores capped at 85% (constitutional requirement)
- Mandatory responsible gambling messaging
- Statistical validation with >90% test coverage
- Full transparency and explainability
This project adheres to strict ethical AI principles:
- Data-Driven Approach: Only uses historical lottery data, no superstitions
- Responsible AI Ethics: Confidence capped at 85%, prominent disclaimers required
- Statistical Rigor: Cross-validation, overfitting prevention, uncertainty quantification
- Transparency: Model explanations, confidence intervals, methodology documentation
- Continuous Testing: >90% test coverage with statistical validation
- Framework: Flask with application factory pattern
- Database: SQLite (development), PostgreSQL (production)
- Machine Learning: scikit-learn, pandas, numpy, matplotlib
- AI Integration: LangChain for explainable predictions
- Testing: pytest with >90% coverage requirement
- Framework: Vue.js 3 with Composition API
- State Management: Pinia
- UI Components: Element Plus
- Data Visualization: Chart.js with vue-chartjs
- Build Tool: Vite
βββ backend/ # Flask API backend
β βββ src/
β β βββ models/ # Database models
β β βββ services/ # Business logic
β β βββ api/ # API endpoints
β β βββ ml/ # Machine learning models
β β βββ utils/ # Utilities and helpers
β βββ tests/ # Test suite
β βββ templates/ # HTML templates
β βββ config/ # Configuration
β βββ requirements.txt # Python dependencies
βββ frontend/ # Vue.js frontend
β βββ src/
β β βββ components/ # Vue components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ utils/ # Utilities
β βββ public/ # Static assets
β βββ package.json # Node.js dependencies
βββ docs/ # Documentation
βββ .github/workflows/ # CI/CD configuration
βββ docker-compose.yml # Development environment
- Python 3.11+
- Node.js 18+
- Docker (optional)
-
Clone the repository
git clone <repository-url> cd lottery-prediction-website
-
Backend Setup
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt flask run
-
Frontend Setup
cd frontend npm install npm run dev -
Environment Configuration
cp .env.example .env # Edit .env with your configuration
# Start all services
docker-compose up
# Production build
docker-compose --profile production upcd backend
pytest --cov=src --cov-report=htmlcd frontend
npm run test# Backend - must maintain >90% coverage
cd backend && pytest --cov-fail-under=90
# Frontend
cd frontend && npm run test:coverage- Maximum Allowed: 85%
- Constitutional Requirement: Confidence scores cannot exceed 85%
- Implementation: Automatically capped in all prediction models
- Mandatory Disclaimers: All prediction pages include responsible gambling messaging
- Help Resources: Links to problem gambling support services
- User Education: Information about lottery randomness and responsible play
- Test Coverage: >90% required
- Cross-Validation: 5-fold cross-validation for all ML models
- Confidence Intervals: Required for all predictions
- Performance Monitoring: Continuous validation of model performance
See .env.example for all available configuration options.
Key constitutional compliance settings:
MAX_PREDICTION_CONFIDENCE=0.85 # Do not change - constitutional requirement
RESPONSIBLE_GAMBLING_REQUIRED=true # Do not change - ethical requirement
ETHICAL_DISCLAIMERS_ENABLED=true # Do not change - compliance requirement- Prediction Generation: < 3 seconds
- Data Access: < 30 seconds
- API Response: < 1 second
- System Uptime: > 99%
- Input validation and sanitization
- SQL injection prevention
- XSS protection
- Secure session management
- Environment variable configuration
- Regular security audits
- Follow constitutional compliance requirements
- Maintain >90% test coverage
- Include ethical disclaimers
- Ensure statistical validation
- Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- National Problem Gambling Helpline: 1-800-522-4700
- Online Support: National Council on Problem Gambling
- Create an issue for bug reports
- Check documentation for common questions
- Review ethical guidelines before contributing