Time window 24 hours. Suggested effort about 5 hours.
Context
A small team wants a self-hosted chat: a few rooms, live messages, who is online, and history that is there when you come back in the morning.
Core requirements
- Pick a display name (no passwords needed) and join one or more rooms; create new rooms.
- Messages are delivered live to everyone in the room over WebSockets.
- History: joining a room loads the last 50 messages, and older ones load on scroll (cursor pagination).
- Presence: each room shows who is online, updated as people connect and disconnect (multiple tabs count once).
- Typing indicator ("Ana is typing...") that clears itself.
- Messages persist (SQLite or Postgres).
Acceptance criteria
- Messages from one sender arrive in the order they were sent, and each carries a server-assigned id and timestamp.
- A client that drops its connection reconnects automatically and receives the messages it missed, without duplicates.
- Message text is rendered safely:
<script>in a message shows as text. - Server-side validation: maximum message length, room names, and a simple per-connection rate limit.
- Tests cover the message store, the pagination cursor and a two-client socket conversation.
Stretch goals (optional)
- Unread counts per room.
- Edit and delete own messages, broadcast to everyone.
- Direct messages between two people.
Constraints
- Any stack. Suggested: Node (ws or Socket.IO) + React or Svelte, or Python (FastAPI) + any front end.
Deliverables (every project)
- Source code committed in this repository (the grader diffs against the first commit).
README.mdthat replaces the stub, with: how to install, run and test it (copy-pasteable commands); the decisions and trade-offs you made; what you would do next with more time; and a short note on how you used the AI agent (what you delegated, what you checked or rewrote).- Automated tests that run with a single command (
npm test,pytest,go test ./...orcargo test). - No secrets in the repository. Anything configurable reads from environment variables with safe defaults.
Ground rules
- The 24-hour clock is a window, not a workload. Stop at roughly the suggested effort, then write down what you would do next. A small, finished, tested core beats a large unfinished one.
- Use the AI agent as much or as little as you like: every prompt is recorded and the report shows how it was used. You are judged on the result and on whether you understood and verified what the agent produced.
- The work is yours. PraxisAI uses it only to produce your assessment report.