This is a buggy, AI-generated, real-time chat app. Practice your AI-copiloting by completing the tasks below.
Use Google's Antigravity chat, or your IDE/coding assistant of choice, to complete this task.
Simply run npm run dev, and open http://localhost:8080/ on two separate browser windows to see the chat interface
Fork the repo and complete the following locally:
-
Fix the bug
- The main "live chat" feature only works on the first message. Ensure that any time any user types, their text appears in real time on the other client
- See the bug here
- Note: the bug only occurs if you leave the username fields empty
-
Refactor the code
- The client logic is all crammed into one big class. Break it up, name things clearly, remove duplication, and make it easier to follow
-
New feature
- Currently anyone who opens the app joins the same chat session
- Implement one-to-one direct messages, so you can start a chat with a single other user (like sending a message to a friend on Whatsapp)
- No need to implement group chats
- These instructions are deliberatly missing technical details, which you need to figure out - but remember: you do not need expertise in real-time applications to implement this feature. Consult with the LLM. Plan. Work in small iterations
While the goal is for you to practice using your coding copilot (claude, gemini, codex - whichever), remember that you are the captain; guide the LLM.
It was blindly trusting an LLM that created this messy codebase in the first place, so let's not make the same mistake ;)