PrettyGirlz Drop Zone QR Service Implementation Guide - Wiz-DevTech/prettygirllz GitHub Wiki
*Version 2.1 | Last Updated: 2024-06-15*
Service Overview
Prerequisites
Setup Instructions
Configuration
API Endpoints
Development Workflow
Testing
Deployment
Monitoring
Troubleshooting
Microservice handling QR code generation/validation for PrettyGirlz drop zone pickups.
Key Features:
🖨️ Dynamic QR generation with ZXing
📱 Online/offline validation modes
🔒 AES-256-GCM encrypted payloads
📊 Real-time activity auditing
Java 17+
MongoDB 5.0+
Redis 6.2+ (for offline cache)
Kubernetes (optional)
# Required export MONGODB_URI="mongodb://localhost:27017/qr-service" export REDIS_URL="redis://localhost:6379" export ENCRYPTION_KEY="base64-encoded-32-byte-key"# Optional export QR_OFFLINE_TTL="3600" # 1 hour cache
# Clone repository git clone https://github.com/prettygirlz/qr-service.git cd qr-service# Build with Maven mvn clean install
# Run service java -jar target/qr-service-2.1.jar
docker build -t prettygirlz/qr-service:2.1 . docker run -p 8080:8080 prettygirlz/qr-service:2.1
Edit application.yml
:
qr: code: size: 300x300 # QR dimensions expiry-hours: 24 # Code validitysecurity: encryption: algorithm: AES/GCM/NoPadding hmac: secret: ${HMAC_SECRET}
offline: enabled: true max-cached: 50 # QR codes per drop zone
Endpoint | Method | Description |
---|---|---|
/api/qr/generate | POST | Generate new QR code |
/api/qr/validate | POST | Validate scanned code |
/api/qr/audit | GET | Retrieve scan logs |
Log Location:/var/log/qr-service.log
Maintainers:
[email protected]
License: Proprietary
Scan to visit repository
Table of Contents Service Overview
Prerequisites
Setup Instructions
Configuration
API Endpoints
Development Workflow
Testing
Deployment
Monitoring
Troubleshooting
- Service Overview Microservice handling QR code generation/validation for PrettyGirlz drop zone pickups.
Key Features:
🖨️ Dynamic QR generation with ZXing
📱 Online/offline validation modes
🔒 AES-256-GCM encrypted payloads
📊 Real-time activity auditing
- Prerequisites Infrastructure Java 17+
MongoDB 5.0+
Redis 6.2+ (for offline cache)
Kubernetes (optional)
Environment Variables bash
export MONGODB_URI="mongodb://localhost:27017/qr-service" export REDIS_URL="redis://localhost:6379" export ENCRYPTION_KEY="base64-encoded-32-byte-key"
export QR_OFFLINE_TTL="3600" # 1 hour cache 3. Setup Instructions Local Development bash
git clone https://github.com/prettygirlz/qr-service.git cd qr-service
mvn clean install
java -jar target/qr-service-2.1.jar Docker bash docker build -t prettygirlz/qr-service:2.1 . docker run -p 8080:8080 prettygirlz/qr-service:2.1 4. Configuration Edit application.yml:
yaml qr: code: size: 300x300 # QR dimensions expiry-hours: 24 # Code validity
security: encryption: algorithm: AES/GCM/NoPadding hmac: secret: ${HMAC_SECRET}
offline: enabled: true max-cached: 50 # QR codes per drop zone 5. API Endpoints Endpoint Method Description /api/qr/generate POST Generate new QR code /api/qr/validate POST Validate scanned code /api/qr/audit GET Retrieve scan logs Sample Request:
bash
curl -X POST http://localhost:8080/api/qr/generate
-H "Content-Type: application/json"
-d '{"dropZoneId": "dz_123", "orderId": "ord_456"}'
6. Development Workflow
Branching Strategy
Diagram
Code
Code Standards
Google Java Style Guide
80% minimum test coverage
Javadoc for public methods
- Testing Run All Tests:
bash mvn test Test Types:
Unit: QR generation logic
Integration: MongoDB interactions
E2E: Full validation flow
- Deployment Kubernetes bash kubectl apply -f k8s/qr-deployment.yaml kubectl apply -f k8s/qr-service.yaml Health Checks /actuator/health
/actuator/prometheus
- Monitoring Key Metrics:
qr_generation_time_seconds
qr_validation_success_rate
offline_verification_requests
Grafana Dashboard: Dashboard Preview
- Troubleshooting Issue Solution QR validation fails Verify encryption keys match Offline mode not working Check Redis connection High latency Review MongoDB indexes Log Location: /var/log/qr-service.log
Maintainers: [email protected] License: Proprietary
QR Code Scan to visit repository