DEV Community

Cover image for I Made a Java Chat App in One Night (Because I Had No Projects)
zenoguy
zenoguy

Posted on • Edited on

I Made a Java Chat App in One Night (Because I Had No Projects)

So hereโ€™s the thing: I wanted to apply for a Java internship.

But I had a problem.

๐Ÿ‘‰ I had literally zero Java projects.

So like any rational dev in a crunch, I built a full 1-on-1 chat app in Java โ€” in a single night โ€” using:

  • Raw sockets ๐Ÿงต
  • MySQL via JDBC ๐Ÿ’พ
  • A UI built with... Swing (yes, I suffered)

Realtime Chat with DB storing

๐Ÿ’ฌ How It Works

Itโ€™s a basic 1-on-1 chat system:

  • One client sends a message
  • Server catches it
  • Stores it in MySQL
  • Relays it to the other client
  • Repeat until one of them rage quits

I tested it with two terminals pretending to be people. Worked fine.

(Wasn't weird. Youโ€™re weird.)


๐Ÿง  What Broke My Brain

Two things:

  1. Swing UI โ€“ now I understand why no one uses it in 2025
  2. Message storing โ€“ I had the DB, I had the connection, but somehow chat history just would not cooperate

๐Ÿงช What Iโ€™d Improve (If I Had Time or Sanity)

  • Add a homepage to select/chat with users
  • Group chat support (so it feels more like WhatsApp and less like Notepad wars)
  • Possibly deploy it โ€” but lol

๐Ÿงฑ Tech Stack

  • Java
  • MySQL
  • JDBC
  • Java Sockets (multithreaded)
  • Java Swing (regrettably)

Server side vs Client Side

๐Ÿ”— github.com/Zenoguy/ChatApp-Java

Forked from a tutorial by Code for Interview, but heavily modified โ€” I added:

  • Message persistence
  • UI wiring
  • DB syncing
  • Tons of tweaks, logs, and near-tears

๐Ÿงƒ Final Thoughts

Was it a mess? Yes.

Did I learn Java networking, JDBC, and that Swing is cursed? Also yes.

Would I do it again?

Probably. But next time, with JavaFX. Or better yet... not Java.


If you're building something similar, feel free to use the repo โ€” or just laugh at my struggle.

And if youโ€™ve got tips for improving the UI or DB layer, drop them below ๐Ÿ‘‡

Top comments (0)