I built a Kafka Coffee Ordering app in Go

I built a Kafka Coffee Ordering app in Go

Hey snow crew! ❄️
404Yeti here, and today we’re grinding some beans and processing some streams — Kafka streams, that is.

Ever wonder what happens when you mix caffeine, microservices, and Go? You get a blazingly efficient, message-driven coffee ordering system, fueled by Flippers, Go routines, and far too much Cold Brew.

🧠 So... What Even Is Kafka?

“Kafka is like a snow chute for data. Once you send something down the pipe, it slides through your whole system with glorious speed and zero small talk.” – 404Yeti

In plain terms:
Apache Kafka is an open-source, distributed messaging platform designed for real-time stream processing. Think: pub-sub model on steroids.

🎯 My Goal

I wanted to build something that felt realistic for a modern business, but also teach myself how Kafka works under the hood. So here's what I set out to create:

1.Accept coffee orders via HTTP
2.Publish them to a Kafka topic
3.Visual order form for user interaction
4.Log it all with a Kafka consumer ("worker")

🧰 Tech Stack Breakdown

  1. GO
  2. Kafka
  3. Docker
  4. Postman
  5. HTML/JS

☕ How It Works (In Yeti Terms)

The Producer

The producer listens on POST /order and expects JSON like this:

{
  "customer_name": "404Yeti",
  "coffee_type": "Cold Brew"
}

Using Sarama (a Kafka client for Go), it serializes that order and publishes it to the coffee_orders topic.

The Worker

The worker is a consumer that listens for new orders and logs them like this:

Coffee Order Consumer Started
Received order #1 | Message({"customer_name":"Robbie","coffee_type":"Cold Brew"})
Brewing Coffee for order: 404Yeti

Basically, it simulates a backend service that might trigger actual brewing IRL (or at least an LED light on your office espresso machine).

The Order Form

Simple, clean UI with HTML + JavaScript to send the order like this:

try {
        const res = await fetch('http://localhost:3000/order', {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json'
          },
          body: JSON.stringify(payload)
        });

This is where the user submits their caffeine craving. Kafka does the rest.

🧠 Lessons Learned

“Kafka’s steep at first, but once you connect the pipes — it’s like magic with timestamps.”
  • Kafka is powerful — but don’t expect to master it in one sitting
  • Go is incredible for backend tasks — fast, clean, readable
  • Message-based architecture is addictive — watching data flow is like snow through a pipe
  • Docker Compose = your best friend for complex local services

📺 Demo Time

Yes, I recorded a quick demo of the system in action. You'll see:

  • User submits an order
  • Kafka receives it
  • Worker logs it like a barista on a mission
0:00
/0:22

🧊 Final Thoughts from the Icebox

This project taught me more than just Kafka — it showed me how scalable, event-driven systems actually behave in the wild.

Kafka isn’t just for data nerds. It’s for any dev who wants to:

  • Design resilient apps
  • Process data efficiently
  • Think in terms of real-time systems

If you’re serious about AppSec, DevOps, or backend development, Kafka is a core skill worth having.

📦 Check Out the Code

You can browse, clone, or contribute right here:

GitHub - 404Yeti/coffee-kafka
Contribute to 404Yeti/coffee-kafka development by creating an account on GitHub.

Feel free to file issues, fork it, or remix it into a tea-ordering system if that’s your vibe

Thanks for hanging out in the Icebox again. 🧊
Follow me for more projects in Go, Kafka, AppSec, and Cloud — all with a frosty twist.

Until next time,
404Yeti out. 🐾