{"id":13339571,"url":"https://github.com/mjetpax/80sMixtapeAPI","last_synced_at":"2025-03-11T14:31:47.990Z","repository":{"id":57606843,"uuid":"164155247","full_name":"mjetpax/80sMixtapeAPI","owner":"mjetpax","description":"The 80's mixtape API is a fun application that creates mixtapes of top pop hits from the 1980s!!","archived":false,"fork":false,"pushed_at":"2019-01-05T01:19:34.000Z","size":506,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-11T23:49:24.855Z","etag":null,"topics":["api","docker","docker-compose","go","golang","postgresql","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/mjetpax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-04T21:12:50.000Z","updated_at":"2023-07-11T23:49:24.856Z","dependencies_parsed_at":"2022-08-30T00:00:52.493Z","dependency_job_id":null,"html_url":"https://github.com/mjetpax/80sMixtapeAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjetpax%2F80sMixtapeAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjetpax%2F80sMixtapeAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjetpax%2F80sMixtapeAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjetpax%2F80sMixtapeAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjetpax","download_url":"https://codeload.github.com/mjetpax/80sMixtapeAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243051919,"owners_count":20228291,"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","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":["api","docker","docker-compose","go","golang","postgresql","unit-testing"],"created_at":"2024-07-29T19:20:21.931Z","updated_at":"2025-03-11T14:31:47.571Z","avatar_url":"https://github.com/mjetpax.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 80's Mixtape API\n\n![cassette tapes](/assets/images/cassettes.png?raw=true)\n\nThe 80's mixtape API is a fun application that creates mixtapes of top pop hits from the 1980s. The project is built in GO and utilizes a Postgresql database. The project is dockerized and demonstrates some micro-services application strategies.\n\nAuthor: Michael Babcock \u003cmjetpax@gmail.com\u003e\n\n[![Coverage Status](https://coveralls.io/repos/github/mjetpax/80sMixtapeAPI/badge.svg?branch=master)](https://coveralls.io/github/mjetpax/80sMixtapeAPI?branch=master)\n\n## Getting started\n\nGetting started locally is simple. Make sure you have all the requirements on your local machine. Then run the Docker Compose commands in your terminal. Note, that Go is not required to run the dockerized application. It is only required for development.\n\n### Requirements\n\n* [Docker](https://docs.docker.com/get-started/)\n* [Docker Compose](https://docs.docker.com/compose/install/)\n* [Go programming language](https://golang.org/doc/install) (not required to run the app in Docker)\n* [cURL](https://duckduckgo.com/?q=curl+getting+started) (optional)\n\n### Local .env file\n\nTo run the app locally, you'll need to create an .env file with store environmental variables. An example.env file has been included. Run the following command and your done. Painless... I know.\n\n```bash\ncp example.env .env\n```\n\n### Running with Docker Compose\n\nMake sure you created a .env file as instructed above before proceeding. Note, that while developing \u0026 running with docker-compose, 80's Mixtape API will auto-compile and redeploy on script update (on save)... yay!\n\n```bash\ndocker-compose up\n```\n\nThis will launch the application and a development database. When the app is ready, you'll see this output `80's Mixtape API is listening on port 8080!` in your terminal.\n\n(Seriously, that's it.)\n\n### Use cURL to ping endpoints\n\nHit the health check endpoint with cUrl.\n\n```bash\ncurl http://0.0.0.0:8080/health\n```\n\nFor pretty formatted returns use jq. Example:\n\n```bash\ncurl http://0.0.0.0:8080/health | jq .\n```\n\nResponse:\n\n```json\n{\n  \"application_name\": \"80's Mixtape API\",\n  \"message\": \"80's Mixtape API is running smooth!\",\n  \"start_date\": \"2019-01-04 23:18:11.826575403 +0000 UTC\",\n  \"up_time\": \"4.300778317s\"\n}\n```\n\n## API Endpoints\n\n### GET /health\n\nCheck the app's start date up time and other bits of info.\n\nExamples:\n\n`curl http://0.0.0.0:8080/health`\n\nExample result:\n\n```json\n{\n  \"application_name\": \"80's Mixtape API\",\n  \"message\": \"80's Mixtape API is running smooth!\",\n  \"start_date\": \"2019-01-04 23:18:11.826575403 +0000 UTC\",\n  \"up_time\": \"4.300778317s\"\n}\n```\n\n### GET /cassette/:cassette_type\n\n_cassette type is optional_\n\nThe endpoint `/cassette/:cassette_type` is the main endpoint for this API. It creates a play list JSON response structured as if it were a cassette tape, with A and B sides. Optionally, pass along one of three cassette types, **C60, C90, C120**. Cassette types are used to indicate cassette tape storage capacity. For example, C90 indicates 90 minutes of playback time, 45 minutes per side. If excluded C60 is selected by default.\n\nExamples:\n\n`curl http://0.0.0.0:8080/cassette`\n\n`curl http://0.0.0.0:8080/cassette/C90`\n\nExample result:\n\n```json\n{\n  \"tape_type\": \"C60\",\n  \"side_a\": {\n    \"songs\": [\n      {\n        \"id\": 85,\n        \"title\": \"Karma Chameleon\",\n        \"artist\": \"Culture Club\",\n        \"year\": 1984,\n        \"video\": \"https://music.youtube.com/watch?v=JvBInlDDQaU\",\n        \"play_time\": \"4:21\"\n      },\n      ...\n    ],\n    \"play_time\": \"29:13\"\n  },\n  \"side_b\": {\n    \"songs\": [\n      {\n        \"id\": 56,\n        \"title\": \"I Can't Go For That\",\n        \"artist\": \"Daryl Hall \u0026 John Oates\",\n        \"year\": 1982,\n        \"video\": \"https://music.youtube.com/watch?v=EHaJLvQgEOM\",\n        \"play_time\": \"6:45\"\n      },\n      ...\n    ],\n    \"play_time\": \"27:39\"\n  }\n}\n```\n\n\n### GET /songs/:last_value/:limit\n\nPaginate through the API's song catalog with calls to the `/songs` endpoint. Pagination uses the seek method. Include the last id value from the previous page and the page size _limit_ with each GET request.\n\nExample, walk through the song catalog with a page size of 10:\n\n* Page 1: `curl http://0.0.0.0:8080/songs/0/10`\n* Page 2: `curl http://0.0.0.0:8080/songs/10/10`\n* Page 3: `curl http://0.0.0.0:8080/songs/20/10`\n\nA list of song objects will be returned as a JSON response.\n\n```json\n[{\n    \"id\": 1,\n    \"title\": \"Call Me\",\n    \"artist\": \"Blondie\",\n    \"year\": 1980,\n    \"video\": \"https://music.youtube.com/watch?v=StKVS0eI85I\",\n    \"duration_label\": \"2:15\"\n  },\n  {\n    \"id\": 2,\n    \"title\": \"Another Brick In The Wall\",\n    \"artist\": \"Pink Floyd\",\n    \"year\": 1980,\n    \"video\": \"https://music.youtube.com/watch?v=HrxX9TBj2zY\",\n    \"duration_label\": \"3:19\"\n  }]\n```\n\n## Testing\n\nUse this command for running unit tests.\n\n```bash\ngo test -v ./...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjetpax%2F80sMixtapeAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjetpax%2F80sMixtapeAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjetpax%2F80sMixtapeAPI/lists"}