DEV Community

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

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)