Skip to content

☕ Kafka Coffee Order System: A Go-based project demonstrating event-driven architecture with Apache Kafka.

Notifications You must be signed in to change notification settings

ArjunDev17/brewline-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Kafka Coffee Order Processing System ☕

This project demonstrates how to build a Kafka-based order processing system using Golang. It includes a producer, a consumer, and additional components to handle coffee orders efficiently.


Project Overview

The project simulates a coffee shop's order management using Apache Kafka for message queuing and Go for implementation.

Components:

  1. Producer:
    • Accepts orders via a REST API.
    • Sends orders as messages to a Kafka topic.
  2. Consumer:
    • Listens to the Kafka topic.
    • Processes incoming coffee orders.

Getting Started

Prerequisites:

  • Go (1.18+ recommended)
  • Apache Kafka setup on localhost:9092
  • Git installed

Installation:

  1. Clone the repository:

    git clone https://github.com/ArjunDev17/brewline-backend
    cd kafka-coffee-order-system
  2. Switch to your desired branch:

    git branch
    git checkout <branch-name>
    • Available branches:
      • main: Main system setup.
      • producer: Contains producer code.
      • consumers: Contains consumer code.
      • addtional_theory: Extra resources and notes.
  3. Install dependencies:

    go mod tidy

Usage

Producer: Start the Server

Run the producer to accept coffee orders via a REST API:

go run producer.go
  • Endpoint: POST http://localhost:3000/order
  • Example request:
    {
        "customerName": "Kabir Singh",
        "coffeeType": "Milkyy"
    }

Consumer: Process Orders

Run the consumer to process coffee orders:

go run consumer.go
  • The consumer listens to the topic coffee_orders and logs processed orders.

Branches

  • main: Core system.
  • producer: REST API for sending orders to Kafka.
  • consumers: Processes messages from Kafka.
  • addtional_theory: Notes or extra material for deeper learning.

Feedback

Feel free to submit issues or pull requests. Your contributions are welcome!


About

☕ Kafka Coffee Order System: A Go-based project demonstrating event-driven architecture with Apache Kafka.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages