A full-stack web application to browse and analyze Olympic Gold Medal data, built with a Spring Boot back-end and a JavaScript front-end.
This project is designed to be run as a complete application. The primary way to interact with the data is through the web interface provided.
-
Prerequisites:
- Java 11 or higher
- Apache Maven
-
Run the Application:
- Open a terminal in the project's root directory.
- Start the application using the Maven wrapper:
./mvnw spring-boot:run
-
Access the Web Interface:
- Once the application has started, open your favorite web browser.
- Navigate to the following URL: http://localhost:8080
You can now use the web page to sort, filter, and view all the Olympic data.
- Java: Primary language for the backend.
- Spring Boot: Framework for building the RESTful API.
- Spring Data JPA: For data access and persistence.
- H2 Database: In-memory database for data storage.
- Maven: Build automation and dependency management.
- RESTful API: Backend architectural style.
- JavaScript: Language for the frontend.
- HTML/CSS: Frontend structure and styling.
- Full-Stack Application: Project scope covering both client and server.
- Olympic Data Analysis: The application's domain.
The application uses an in-memory H2 database that is populated on startup from the data.sql script located in src/main/resources/. This script contains all the necessary medal and country information.
The front-end is powered by a REST API. If you wish to interact with the API directly for testing or development purposes, you can use a tool like cURL or Postman. The endpoints are described below.
- URL:
/countries - Method:
GET - Example (cURL): Get countries sorted by medal count in descending order.
curl --request GET "http://localhost:8080/countries?sort_by=medals&ascending=n"
- URL:
/countries/{countryName} - Method:
GET - Example (cURL): Get the details for the "United States" Olympic team.
curl --request GET "http://localhost:8080/countries/united%20states"
- URL:
/countries/{countryName}/medals - Method:
GET - Example (cURL): Get all medals for "China", sorted by year in ascending order.
curl --request GET "http://localhost:8080/countries/china/medals?sort_by=year&ascending=y"