Skip to content

rahuladream/cricket-commentary-kafka

Repository files navigation

Cricket Commentary Application

This project is a Dockerized FastAPI application designed for managing live cricket commentary. It consists of two separate FastAPI services:

  • Publish Service: Publishes cricket commentary to a Kafka topic.
  • Consume Service: Consumes and processes cricket commentary from the Kafka topic.

Both services are containerized using Docker and are configured to communicate with a Kafka broker running in a separate container. Zookeeper is also included as Kafka's dependency.

Prerequisites

  • Docker
  • Docker Compose

Setup and Running the Application

1. Clone the Repository

git clone [https://github.com/your-repo/cricket-commentary-app.git](https://github.com/rahuladream/cricket-commentary-kafka)
cd cricket-commentary-app

Build and Start the Docker Containers

Build the Docker images and start all the services using Docker Compose:

docker-compose build
docker-compose up

Access the Services

Testing the Services

curl -X POST "https://localhost:8001/v1/publish_commentary/" -H "Content-Type: application/json" -d "{\"commentary\": \"Player X hits a six!\"}"

Make sure to have websocket connection this WebSocket-Chrome

curl "https://localhost:8002/ws/commentary/"

About

Cricket Commentary Using Kafka, Websocket, FastAPI, Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published