Skip to content
avarenoPublic

About

A REST API for a calulator using kafka and java

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

Calculator API - Java Assessment

This project implements a RESTful calculator API with operations: sum, subtraction, multiplication, and division. It uses Spring Boot with Kafka for inter-module communication.


Prerequisites

  • Java 17+ (or compatible with your Spring Boot version)
  • Gradle
  • Docker & Docker Compose installed
  • Linux environment (sudo access required for Docker commands)

Running the Application

1. Start Docker services first

Before running the application, navigate to the docker folder and start Kafka and related services:

cd docker
sudo docker compose up -d

2. Build the project

From the root source folder, run:

./gradlew build

3. Run the Spring Boot application

./gradlew bootRun

Testing the API

Test the endpoints using a web browser or tools like curl or Postman:

GET http://localhost:8080/sum?a=5&b=3

Expected response:

{
  "result": "8"
}

Logging

Application logs are saved at:

/home/avareno/Proj/wit/demo/logs/wit-app.log

Configured with Logback file appender.

Notes

Make sure Docker is running before starting the Spring Boot app.

Kafka must be up for proper inter-module communication.

About

A REST API for a calulator using kafka and java

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages