The QuPot quantum lottery platform development is underway, with the Quantum Service being the primary focus at present. This document summarizes the current setup and outlines the next steps.
-
Turborepo Configuration
- Root package.json with workspace setup for monorepo management
- Turborepo pipeline configuration in turbo.json for efficient builds
- Command structure for running all or selected services
- Dependencies and scripts for development workflows
-
Quantum Service
- FastAPI application with quantum random number generation using Qiskit
- Virtual environment management through npm scripts
- Port configured to 8002 for local development
- Environment check script to verify Python setup
- Interactive API documentation with Swagger UI
- Custom HTML landing page with explanations and visualizations
- Quantum circuit visualization capabilities
- Testing and client utilities
-
Docker Setup
- Docker Compose configuration for all planned services
- Individual Dockerfiles for each service
- Shared network and volume setup for inter-service communication
- Updated port configuration and environment variables
-
Documentation
- Project README.md with overview information
- DEV_GUIDE.md with detailed development instructions
- Service-specific documentation for the quantum service
- Consistent documentation structure across files
npm run dev# Run just the quantum service
npm run dev -- --filter=quantum-service
# Run multiple specific services
npm run dev -- --filter=quantum-service --filter=api-gateway# Start all services
npm run docker:up
# Stop all services
npm run docker:down| Service | URL | Technology Stack | Status |
|---|---|---|---|
| API Gateway | http://localhost:8000 | NestJS | |
| Quantum Service | http://localhost:8002 | FastAPI, Qiskit | ✅ Functional |
| Lottery Service | http://localhost:8003 | NestJS, PostgreSQL | |
| Blockchain Service | http://localhost:8004 | NestJS, Solidity | |
| Auth Service | http://localhost:8003 | NestJS, JWT |
The Quantum Service currently provides:
-
Random Number Generation
- Endpoint:
POST /api/v1/random - Uses quantum computing principles via Qiskit
- Configurable parameters (range, count, uniqueness)
- Returns cryptographically secure random numbers
- Endpoint:
-
Quantum Circuit Information
- Endpoint:
GET /api/v1/quantum-circuit - Returns details about the quantum circuit used
- Includes measurement statistics and explanations
- Endpoint:
-
Documentation and Visualization
- Interactive API docs at
/docs - Custom HTML documentation at
/ - Visualization scripts for quantum circuits
- Interactive API docs at
-
Enhanced Quantum Service
- Connect to IBM Quantum cloud for real quantum hardware execution
- Add more complex quantum circuit options
- Implement authentication for the API
- Add comprehensive unit and integration tests
-
API Gateway Implementation
- Connect to the Quantum Service
- Implement proper routing and authentication
- Add rate limiting and monitoring
-
Lottery Service Development
- Create database schema for draws and tickets
- Implement draw management and ticket purchasing
- Connect to Quantum Service for random number generation
-
Blockchain Integration
- Connect to Ethereum network (Mumbai testnet)
- Deploy and interact with the QuantumLottery smart contract
- Implement verification of lottery results on-chain
-
Authentication Service
- Implement JWT authentication
- Add wallet authentication for Web3 integration
- Create user management functionality
-
Frontend Development
- Create a web application to interact with the services
- Implement MetaMask integration for blockchain interactions
- Build interactive lottery UI with real-time draw information
For all future development:
-
Follow the Established Patterns
- Use the same folder structure and naming conventions
- Match the documentation style in README files
- Update port information in relevant documentation
-
Ensure Cross-Service Integration
- All services should be ready to communicate with each other
- Use consistent data formats across services
- Document API contract changes
-
Maintain Test Coverage
- Write unit tests for all new functionality
- Include integration tests for service interactions
- Use environment check scripts for dependencies
-
Keep Documentation Updated
- Update this document with new service information
- Maintain service-specific README files
- Document API endpoints in both code and docs