Files
DeveloperandClaude Opus 4.6 335f0fb8dc perf: add rate limiting, validation, logging, and error handling
- Add express-rate-limit with tiered rate limits per endpoint
- Add express-validator for input validation on all API routes
- Add winston + morgan for structured logging
- Add node-cache for lottery result caching (5min TTL, 1000 max keys)
- Convert OCR to async task queue with max 2 concurrent jobs
- Add global error handler middleware
- Add React ErrorBoundary for client-side error handling
- Fix memory leaks in OCR task queue and lottery cache
- Add per-item error handling in batch ticket updates
- Fix SQL UPDATE to include user_id in WHERE clause

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 11:35:12 +08:00

26 lines
579 B
JSON

{
"name": "lottery-server",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
},
"dependencies": {
"express": "^4.18.2",
"cors": "^2.8.5",
"better-sqlite3": "^9.4.3",
"bcryptjs": "^2.4.3",
"jsonwebtoken": "^9.0.2",
"multer": "^1.4.5-lts.1",
"tesseract.js": "^5.0.4",
"axios": "^1.6.7",
"cheerio": "^1.0.0-rc.12",
"express-rate-limit": "^7.1.5",
"express-validator": "^7.0.1",
"node-cache": "^5.1.2",
"winston": "^3.11.0",
"morgan": "^1.10.0"
}
}