sagnik-santra17/fastapi-realtime-chat-api ? reverse-engineered prompt
Reverse engineered prompt
Build me a backend for a real time chat app with FastAPI.
I want users to be able to register, log in, and manage their own profile with JWT auth. After that they should be able to create chat rooms, list them, edit or delete only the rooms they own, and join a room to send and receive live messages over a WebSocket connection. Also include a simple REST endpoint to fetch recent room messages and send a message that gets saved too.
Please store users, rooms, and message history in PostgreSQL, use Redis for caching recent messages and for basic rate limiting, and make the WebSocket setup work cleanly for live broadcast style chat. Keep the code organized in layers so the HTTP routes stay thin and the business logic is separate from database access.
Add migrations, Docker support, and tests for the main flows like auth, room actions, message history, caching, rate limiting, and WebSocket connect and send behavior. If you need to, look up current docs online for FastAPI or WebSockets.
Are you gonna build this?
make sure you review the code using coderabbit