feat(backend): add response caching and user management

Replace USE_DATABASE toggle with USE_CACHE for smarter LLM response handling:
- Add prompt hashing for efficient cache lookups
- Cache API responses in database to reduce token usage
- Always store responses for analytics (cache or fresh)

Add user authentication infrastructure:
- User table with bcrypt password hashing
- CRUD operations for user management
- Role-based access control (admin/user)

Dependencies: add bcrypt and PyJWT for auth

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-03-14 13:40:34 -04:00
parent 0107691c90
commit af52107ed8
4 changed files with 442 additions and 79 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ psycopg2-binary
fastapi
uvicorn[standard]
httpx
streamlit
plotly
numpy
pandas
bcrypt
PyJWT