This is a Spring Boot application written in Kotlin that uses Redis to store and rank pizza toppings based on user requests. The application stores these choices in a Redis data store (configured to persist data on disk) using the ZSET data structure, which automatically ranks items based on a score. When users submit their pizza toppings preferences, the application updates the score of each topping accordingly, and retrieves the toppings sorted by their scores.
- Spring Boot
- Kotlin
- Redis
- Docker
- Users can submit their preferred pizza toppings.
- The application stores these toppings and their occurrences in Redis.
- The application can return a ranking of pizza toppings.
The app is live at http://143.42.18.135/. Enjoy and have fun! 🚀😎
https://www.youtube.com/watch?v=2dRLwXHLdIU
- 🔍 Add speed parameter
- 🔍 Coins balance per user
- 🔍 Add leaderboard for coin accumulation across users
- 🔍 Add blockchain based elements distribution
Make sure you have the following installed:
- Java 17
- Gradle
- Docker
- Clone the repository:
git clone https://github.com/maxb2718/pizza-toppings-ranking.git
- Navigate to the project directory:
cd pizza-toppings-ranking
- Build the app
./build.sh
- Run the app
./run.sh
Now the application should be running at http://localhost:8080 and the toppings dashboard is accessible at http://localhost:8888.
POST /toppings
: Submit a new pizza topping request.GET /toppings
: Get a ranking of pizza toppings.
curl -X POST -H "Content-Type: application/json" -d '{"email": "test@example.com", "toppingsContent": "Pepperoni, Onions, Mushrooms"}' http://localhost:8080/toppings
You can then view the rankings:
curl http://localhost:8080/toppings
You can send dozens test requests and populate the DB by using following command.
./add_toppings.sh