- Introduction
- Project Goals
- Reactive Programming with Spring Boot
- How It Works
- Technologies Used
- Getting Started
- App Screenshots
- Support
- License
Live Score App, an application that delivers real-time sports scores using reactive programming principles. This project showcases the power of Spring Boot's reactive 🍃 capabilities combined with a modern frontend with Vaadin's Hilla ⚛️ project.
💡 This application is not business oriented and my focus is mostly on technical part, I just want to implement a sample app that uses reactive programming with Spring Boot to put in practice what I have learned.
🌀 This Application is in-progress and I will add some improvements and features over time 🌀
The primary objectives of this project are:
- To demonstrate the implementation of reactive programming in a real-world application.
- To create a user-friendly interface for accessing live sports scores.
- To serve as an educational resource for developers interested in reactive programming with Spring Boot.
Reactive programming is a paradigm focused on building asynchronous, non-blocking, and event-driven applications that can scale effectively. It's particularly well-suited for applications that deal with streams of data or require high concurrency.
Key concepts in reactive programming include:
- 🔄 Asynchronous data streams
- 🚫 Non-blocking operations
- 🧮 Functional-style programming
Reactive programming offers several advantages:
- Improved Scalability: Reactive applications can handle more concurrent users with less hardware.
- Enhanced Responsiveness: Non-blocking operations ensure that the application remains responsive under high load.
- Resilience: Built-in error handling and recovery mechanisms make reactive systems more robust.
- Resource Efficiency: Reactive systems can do more with less, optimizing CPU and memory usage.
Spring Boot leverages the Project Reactor library to implement reactive programming. Key components include:
- WebFlux: Spring's reactive-stack web framework, an alternative to Spring MVC.
- Reactive Streams: A specification for asynchronous stream processing with non-blocking backpressure.
- Reactor Core: Provides reactive types like Mono (for 0 or 1 element) and Flux (for 0 to N elements).
In Live Score App, we use these technologies to create a reactive pipeline from the data source to the client, ensuring efficient and scalable real-time updates.
- Data Fetching: The application periodically fetches live score data from an external API API-FOOTBALL from RapidAPI using WebClient, a non-blocking HTTP client.
- Data Processing: Incoming data is processed reactively using Flux and Mono operators.
- Frontend Integration: The frontend, built with React and TypeScript, consumes the reactive API and updates the UI in real-time.
- Backend:
- Spring Boot 3.3.2 🍃
- Spring WebFlux 🌊
- Project Reactor ⚛️
- Java 21 ☕
- Frontend:
- React ⚛️
- TypeScript 📘
- Tailwind CSS 🎨
- External APIs:
- API-FOOTBALL from RapidAPI 🏟️
- Build Tool: Maven 🛠️
To run the application locally, follow these steps:
- Clone the repository from GitHub:
git clone https://github.com/miliariadnane/live-score-reactive-spring-boot.git
- Navigate to the project directory:
cd live-score-reactive-spring-boot
- Open the project in your favorite IDE.
- Open
application.yml
and add your API key for API-FOOTBALL from RapidAPI. - Run
mvn clean install
to build the project. - Run the
LiveScoreApplication
class to start the Spring Boot application. - Open your browser and navigate to
http://localhost:8080
to view the app.
- ⭐️️ Star this repository if you find it useful.
- 🐛️ If you find a bug, raise an issue or fix it and send a pull request.
- 📢️ If you have any feature requests, raise an issue or send a pull request.
- 🤲 If you have a moment, don't forget to make a duaa for me and my parents.
This project is licensed under the MIT License - see the LICENSE.md file for details.