Application for football lovers
The purpose of Football Fan is to show the current score of live football matches from championships all over the world.
The scores are displayed to the users through a web page, and Thymeleaf is used for this purpose. Therefore, the front-end page is rendered on the backend side.
Bootstrap is used for the front-end components and styling of the application.
Although the data is near real-time on the backend, the web page requires manual refreshing to display live scores. As a follow-up step, a mechanism for automatic score refreshing on the page should be developed.
The data come from LiveScore through Rapid API marketplace. There is a prepared docker compose environment in the docker folder to run a kafka connector environment and request data from LiveScore and thus publish them into a kafka topic.
Unit and integration tests can be executed by ./mvnw test
from the project root path.
All the required services to run a local environment are configured in a Docker Compose file. There are two ways to execute the local environment: with sample data or real-time data.
Execute the following steps from the project root path to run the application locally by using sample data:
docker compose -f docker/docker-compose.yaml up zookeeper kafka
./mvnw spring-boot:run
To add sample data, follow these steps:
cd docker/localEnv/
./script.sh docker-kafka-1
- Access
http://localhost:8080
on the browser.
In order to run the environment locally and start receiving live scores, an account has to be created on LiveScore API. Besides, the following steps have to be executed from the project root path:
- Replace the property
http.request.headers
in the configuration filedocker/connector/config.json
with theX-RapidAPI-Key
that was generated on LiveScore API. docker compose -f docker/docker-compose.yaml up
./mvnw spring-boot:run
- Access
http://localhost:8080
on the browser. - The url
http://localhost:9000
may be used to check events in the kafka topic through Kafdrop web UI.