{"id":24522769,"url":"https://github.com/gbzarelli/music-store-api","last_synced_at":"2025-09-20T09:49:28.502Z","repository":{"id":180990192,"uuid":"187276063","full_name":"gbzarelli/music-store-api","owner":"gbzarelli","description":"[Java] API for querying and selling discs - Technical challenge Beblue back-end engineer (approved)","archived":false,"fork":false,"pushed_at":"2024-08-26T17:05:21.000Z","size":309,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T12:12:12.021Z","etag":null,"topics":["circleci","coveralls","docker","flyway","jacoco","java","java13","jpa","maven","mysql","rabbitmq","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","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/gbzarelli.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,"zenodo":null}},"created_at":"2019-05-17T20:13:34.000Z","updated_at":"2022-03-14T17:26:08.000Z","dependencies_parsed_at":"2025-04-14T12:22:19.611Z","dependency_job_id":null,"html_url":"https://github.com/gbzarelli/music-store-api","commit_stats":null,"previous_names":["gbzarelli/music-store-api"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gbzarelli/music-store-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fmusic-store-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fmusic-store-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fmusic-store-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fmusic-store-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbzarelli","download_url":"https://codeload.github.com/gbzarelli/music-store-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fmusic-store-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276077894,"owners_count":25581305,"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-20T02:00:10.207Z","response_time":63,"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":["circleci","coveralls","docker","flyway","jacoco","java","java13","jpa","maven","mysql","rabbitmq","spring-boot"],"created_at":"2025-01-22T03:35:34.132Z","updated_at":"2025-09-20T09:49:28.468Z","avatar_url":"https://github.com/gbzarelli.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Issues](https://img.shields.io/github/issues/gbzarelli/music-store-api.svg) \n![Forks](https://img.shields.io/github/forks/gbzarelli/music-store-api.svg) \n![Stars](https://img.shields.io/github/stars/gbzarelli/music-store-api.svg) \n![Release Version](https://img.shields.io/github/release/gbzarelli/music-store-api.svg)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1bc201b52c9e4c4eb162f73937ba331d)](https://app.codacy.com/manual/gbzarelli/music-store-api?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=gbzarelli/music-store-api\u0026utm_campaign=Badge_Grade_Dashboard)\n[![Coverage Status](https://coveralls.io/repos/github/gbzarelli/music-store-api/badge.svg?branch=master)](https://coveralls.io/github/gbzarelli/music-store-api?branch=master)\n\n# Music Store API [![CircleCI](https://circleci.com/gh/gbzarelli/music-store-api.svg?style=svg)](https://circleci.com/gh/gbzarelli/music-store-api)\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./images/music-store-logo.png\" height=\"350\"\u003e\n\u003c/p\u003e\n\nThe `Music Store API` is an API for inquiries and disco sales,\nyour database will be powered by the `Spotify` API at system startup,\neach disc has a random value between 10 and 100 and is associated with\none of the four pre-defined categories in the system (POP, MPB, CLASSIC and ROCK),\non the sale of the disk a cashback will be created according to the day of the week and the genre\nof each disc, these values are also pre-defined according to the system specifications. \n\n## Specifications\n \n The app should provide a `REST API` containing the following operations::\n \n- Consult the disc catalog in paginated way, filtering by the genre and shorting in an increasing \norder by the name of the disc;\n- Consult the disc by its identifier;\n- Consult all sales made in paginated way, filtering by the range of dates (initial and final) of \nthe sale and ordering in decreasing order by the date of the sale;\n- Consult a sale by its identifier;\n- Register a new disc sale  with the total cashback value considering the table;\n \n - The app will be powered by the `Spotify` database: [`web-api`](https://developer.spotify.com/documentation/web-api/quick-start/)\n - Each sale may have one or more discs selected, the cashback must be calculated and stored \n individually for each disc as well as the total cashback of the sale;\n \n - When registering a sale, the `API` must send a message to a messaging service passing the\n unique number of the sale\n \n## Technologies\n\n - [`Java/OpenJDK 13`](https://openjdk.java.net/projects/jdk/13/) - Java Development Kit 13\n - [`Spring boot`](https://spring.io) - Framework base for the API\n - [`Flyway`](https://flywaydb.org) - Version control and migration for database\n - [`MySQL`](https://www.mysql.com) - Database\n - [`H2`](https://www.h2database.com) - Database for tests\n - [`Swagger`](https://swagger.io) - Dynamics API documentation\n - [`JPA/Hibernate`](https://hibernate.org/orm/) - Framework for data persistence / ORM\n - [`Docker`](https://www.docker.com) - Run and manage applications inside containers called containers\n - [`RabbitMQ`](https://www.rabbitmq.com) - RabbitMQ messaging service\n - [`jUnit5 e Mockito`](https://junit.org/junit5/) - Tests execution\n\n## Executing with Docker in develop environment\n\nThe following steps have been documented to performed on a Linux platform,\nbut the commands with the Windows system can be similar, but, the operation isn't\nfully guaranteed. Make sure you have installed in your environment the `Java` \n(with the $JAVA_HOME in your classpath properly configured) and the `Maven`.\n\n- Clone the project\n\n```shell\n$ git clone https://github.com/gbzarelli/music-store-api.git\n```\n\n- Access the project folder to start compiling and running the app\n\n```shell\n$ cd ./music-store-api\n```\n\n- The following instruction will be executed via [`Maven`](https://maven.apache.org)\nthe `clean` of the project, right after the `package`, which will perform the \nunit tests to guarantee the integrity of the project and to generate our `.jar`,\nlastly build [`Dockerfile`](./Dockerfile) will be generated an image\nin the local repository called `helpdev/music-store-api`. To build the plugin \n[`dockerfile-maven-plugin`](https://github.com/spotify/docker-maven-plugin) \n has been configured in the [`pom.xml`](./pom.xml);\n\n```shell\n$ mvn clean package dockerfile:build\n```\n\n- Configure the following ENVs to `Spotify` access:\n\n| ENV | Description |\n| -- | -- |\n| SPOTFY_ID | The Spotify credentials ID |\n| SPOTFY_SECRET | The Spotify credential secret key |\n\n- After the image will be generated through the `dockerfile:build` we will\nmount the containers by [`docker-compose`](./docker-compose.yml).\nThe prepared compose will go up to the `API`;\n\n```shell\n$ docker-compose up\n```\n\n## Endpoints\n\n#### Home page\n \n - Home page \n \n   GET http://{address}:8080\n \n#### Genres\n\n - Genre List \n  \n        GET http://{address}:8080/genre\n\n#### Discs\n\n- Search disc by ID\n \n        GET http://{address}:8080/disc/{id}\n  \n- Search discs (with pagination)\n \n        GET http://{address}:8080/disc{?page=1\u0026limit=50}\n \n- Search disc by a genre (with pagination)\n \n        GET http://{address}:8080/disc/genre/{genre}{?page=1\u0026limit=50}\n \n- Note: [`Pagination parameters`](https://docs.spring.io/spring-data/rest/docs/2.0.0.M1/reference/html/paging-chapter.html)\n\n#### Sales\n\n- New Sale\n \n        POST http://{address}::8080/sale\n\n   BODY: \n   ```json\n   {\n     \"discsIds\":[1,2,3]\n   }\n   ```\n    \n- Search sale by purchase number\n  \n        GET http://{address}:8080/sale/{orderNumber}\n   \n- Search sales by date\n  \n        GET http://{address}:8080/sale/start_date/{startDate}/end_date/{endDate}{?page=1\u0026limit=50}\n   \nNote: Accepted data format: 'yyyy-MM-dd' ex: `2019-05-23`\n \n## The Dynamic documentation with Swagger\n\nThe `Swagger` UI provide a display structure who is able to interpret\nproject endpoints and generate an interactive documentation site;\n\n  - http://{address}:8080/swagger-ui.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbzarelli%2Fmusic-store-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbzarelli%2Fmusic-store-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbzarelli%2Fmusic-store-api/lists"}