spd-2026-2/chat-socket-tcp ? reverse-engineered prompt

Reverse engineered prompt

Build me a simple Java chat app that works with a client and a server over TCP.

I want the server to let multiple people connect at the same time, each using a nickname, and reject duplicate nicknames. The chat should support sending messages to everyone, sending a private message to just one person, and showing who is online. When someone joins or leaves, the other users should see a system message. Use JSON for the messages, one message per line, so it’s easy for the client and server to talk to each other.

The client should be a small Swing app where I can type the server IP, port, and my nickname, then connect and chat. It should keep listening for new messages in the background while I use the interface. Use localhost and port 6000 by default if that helps. If you need to look up current docs online, feel free to do that.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab