This project provides the complete functionality required to process database queries from the frontend and deliver data to it via HTTP requests.

- π―οΈ Introduction
- πͺ Features
- π¨ How can I run the project?
- βοΈ Explanation of the Code-Structure
βΊ This project handles all REST API requests sent by the frontend (olympia-website). Based on these requests, database queries are executed using Spring Boot and JPA Hibernate, and the corresponding responses are returned.
The project is well documented and was created as part of an assignment during training as an IT specialist for application development.
π βΊ It was developed by Yannic Drews, Yanic Doepner, and Nils Sievers. The project follows best practices and, thanks to its clear documentation, can be easily extended.
βΊ The project implemented all features that were required within the scope of the requirements specification and functional specification. These include the following features (that the backend needs to do):
- π REST API for Frontend Communication: The backend provides a RESTful API that processes all HTTP requests sent by the olympia-website frontend and returns structured JSON responses.
- ποΈ Database Integration with JPA & Hibernate: The application uses JPA with Hibernate to interact with the MySQL database, enabling efficient object-relational mapping and structured data persistence.
- π Competition Data Management: The API manages the core Olympic tournament entities such as athletes, countries, and competition results.
- βοΈ Full CRUD Operations: The backend supports Create, Read, Update, and Delete operations for all relevant entities, allowing judges to maintain competition data easily.
- π Secure Authentication System: Judges can register and log in through dedicated API endpoints, ensuring that only authenticated users are able to modify competition data.
- π§© Layered Architecture: The application follows a clean layered architecture (Controller β Service β Repository), which separates responsibilities and improves maintainability and scalability.
- π¦ DTO Pattern: Data Transfer Objects are used to separate internal database models from API responses, improving security, maintainability, and API clarity.
- β‘ Spring Boot Caching: Frequently requested data is cached using Spring Bootβs caching mechanism, improving performance and reducing unnecessary database queries.
- π₯ Excel Data Import: The backend supports importing structured Excel files to quickly populate or update competition datasets.
- π³ Easy Setup with Docker: The entire backend environment can be started with a single Docker command, making the setup process fast and beginner-friendly.
- π Well Documented & Extendable: The project follows best practices and is clearly documented, making it easy for developers to understand, maintain, and extend.
βΊ You need to have Docker Desktop installed and started.
- Judge1:
judge1/judge1pwd - Judge2:
judge2/judge2pwd
- Clone the repository by using
git clone https://github.com/yannic-md/olympia-website-api.git - Switch to the correct folder:
cd olympia-website-api - Run
docker compose up --buildand wait a few minutes. - Run the Angular Frontend (More Details here)
- The API is now listening for HTTP requests on http://localhost:8080.
You only need to do that once. From now on, you can start/stop the project in the "Docker Desktop" application.
- The code is located in the package
de.olympia.main.example(in theget-startedbranch). - Every subpackage of
de.olympia.mainis automatically loaded when the project starts; a manual definition inMainApplicationis not required. - The structure follows a classic layered architecture (Controller, Service, Repository, Entity).
- Flyway is used to manage database migrations.
- The scripts for creating and updating the database can be found in
src/main/resources/db/migration. - On every application start, the migrations are executed automatically if necessary.
- Contains the JPA entities that represent the database tables.
- In the example, the table
countriesis represented by theCountryclass. - Each entity is annotated with
@Entityso that Hibernate can detect it. @Table(name = "countries")ensures that the exact existing table is used.- The primary key is defined using
@Idand@GeneratedValue.
- Contains interfaces for database access.
CountryRepositoryextendsJpaRepository.- Standard methods such as
findAll,findById, andsaveare automatically available.
- Contains the business logic of the application.
- Encapsulates access to one or more repositories.
- Provides methods that are used by controllers.
- Provides the REST endpoints of the application.
- Annotated with
@RestController. - Processes HTTP requests and returns JSON responses.
http://localhost:8080/api/countriesreturns a list of all countries from the database.