{"id":25919776,"url":"https://github.com/robson16/goldmedal","last_synced_at":"2026-05-07T13:08:45.512Z","repository":{"id":278981344,"uuid":"937383958","full_name":"Robson16/goldmedal","owner":"Robson16","description":"This project is a Spring Data JPA for an Olympic metrics reporting web application called Gold Medal Metrics.","archived":false,"fork":false,"pushed_at":"2025-02-24T15:56:27.000Z","size":896,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T15:15:59.494Z","etag":null,"topics":["codeacademy","crud-api","java","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robson16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-22T23:07:40.000Z","updated_at":"2025-02-24T15:56:31.000Z","dependencies_parsed_at":"2025-02-23T00:46:12.755Z","dependency_job_id":null,"html_url":"https://github.com/Robson16/goldmedal","commit_stats":null,"previous_names":["robson16/goldmedal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Robson16/goldmedal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robson16%2Fgoldmedal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robson16%2Fgoldmedal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robson16%2Fgoldmedal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robson16%2Fgoldmedal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robson16","download_url":"https://codeload.github.com/Robson16/goldmedal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robson16%2Fgoldmedal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231108,"owners_count":25245687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeacademy","crud-api","java","rest-api","spring-boot"],"created_at":"2025-03-03T15:16:01.955Z","updated_at":"2026-05-07T13:08:45.459Z","avatar_url":"https://github.com/Robson16.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gold Medal Metrics Challenge Project\n\n## Overview\nGold Medal Metrics is an Olympics analytics web application built with **Spring Boot** and **Spring Data JPA**. This project is part of the [Create REST APIs with Spring and Java](https://www.codecademy.com/) course by Codecademy.\n\nThe application allows users to:\n- View a list of countries along with their population, GDP, and number of Olympic gold medals.\n- Sort the list by different attributes, including country name, population, GDP, and medal count.\n- View detailed Olympic statistics for a selected country.\n- Retrieve a list of Olympic gold medal wins for a country, including details like the year, season, athlete name, city, and event.\n- Sort the list of Olympic wins by various attributes.\n\n## Tech Stack\n- **Java 11**\n- **Spring Boot 2.5.2**\n- **Spring Data JPA**\n- **H2 Database** (for development and testing)\n- **Apache Commons Text** (utility functions)\n\n## Prerequisites\nEnsure you have the following installed:\n- Java 11 or higher\n- Maven\n\n## Installation \u0026 Setup\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/Robson16/goldmedal.git\n   cd goldmedal\n   ```\n2. Build the project with Maven:\n   ```sh\n   mvn clean install\n   ```\n3. Run the application:\n   ```sh\n   mvn spring-boot:run\n   ```\n4. The API will be available at:\n   ```sh\n   http://localhost:3001\n   ```\n\n## API Usage\n### Get all countries sorted by name (ascending order)\n```sh\ncurl --request GET \"http://localhost:3001/countries?sort_by=name\u0026ascending=y\"\n```\n**Response:**\n```json\n{\n  \"countries\": [\n    {\"name\":\"Afghanistan\",\"code\":\"AFG\",\"gdp\":594.32,\"population\":32526562,\"medals\":0},\n    ...\n  ]\n}\n```\n\n### Get details for a specific country (e.g., United States)\n```sh\ncurl --request GET \"http://localhost:3001/countries/united%20states\"\n```\n**Response:**\n```json\n{\n  \"name\":\"United States\",\n  \"gdp\":56115.72,\n  \"population\":321418820,\n  \"numberMedals\":2477,\n  \"numberSummerWins\":2302,\n  \"percentageTotalSummerWins\":21.957,\n  \"yearFirstSummerWin\":1896,\n  \"numberWinterWins\":175,\n  \"percentageTotalWinterWins\":9.109,\n  \"yearFirstWinterWin\":1924,\n  \"numberEventsWonByFemaleAthletes\":747,\n  \"numberEventsWonByMaleAthletes\":1730\n}\n```\n\n### Get list of Olympic gold medal winners for a country (sorted by athlete's name descending)\n```sh\ncurl --request GET \"http://localhost:3001/countries/united%20states/medals?sort_by=name\u0026ascending=n\"\n```\n**Response:**\n```json\n{\n  \"medals\": [\n    {\n      \"year\":1968,\n      \"city\":\"Mexico\",\n      \"season\":\"Summer\",\n      \"name\":\"ZORN, Zachary\",\n      \"country\":\"United States\",\n      \"gender\":\"Men\",\n      \"sport\":\"Aquatics\",\n      \"discipline\":\"Swimming\",\n      \"event\":\"4X100M Freestyle Relay\"\n    },\n    ...\n  ]\n}\n```\n\n## Dependencies\nThe project uses the following dependencies, as defined in `pom.xml`:\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n        \u003cartifactId\u003espring-boot-starter-data-jpa\u003c/artifactId\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n        \u003cartifactId\u003espring-boot-starter-web\u003c/artifactId\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.h2database\u003c/groupId\u003e\n        \u003cartifactId\u003eh2\u003c/artifactId\u003e\n        \u003cscope\u003eruntime\u003c/scope\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.apache.commons\u003c/groupId\u003e\n        \u003cartifactId\u003ecommons-text\u003c/artifactId\u003e\n        \u003cversion\u003e1.8\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n        \u003cartifactId\u003espring-boot-starter-test\u003c/artifactId\u003e\n        \u003cscope\u003etest\u003c/scope\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## Future Enhancements\n- Add support for retrieving Olympic statistics by athlete.\n- Implement authentication and authorization for API access.\n- Migrate to a production-ready database like PostgreSQL or MySQL.\n\n---\nThis project was developed as part of the **Create REST APIs with Spring and Java** course by Codecademy.\n\n**Happy Coding!** 🚀\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobson16%2Fgoldmedal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobson16%2Fgoldmedal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobson16%2Fgoldmedal/lists"}