{"id":20415335,"url":"https://github.com/jeffascript/music-service","last_synced_at":"2026-04-16T23:01:17.951Z","repository":{"id":39638665,"uuid":"496856651","full_name":"jeffascript/music-service","owner":"jeffascript","description":"An App that provides information about a specific music artist!","archived":false,"fork":false,"pushed_at":"2022-05-30T06:54:23.000Z","size":229,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T03:32:31.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeffascript.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-27T04:07:29.000Z","updated_at":"2024-02-22T03:07:00.000Z","dependencies_parsed_at":"2022-09-20T07:01:42.802Z","dependency_job_id":null,"html_url":"https://github.com/jeffascript/music-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeffascript/music-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffascript%2Fmusic-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffascript%2Fmusic-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffascript%2Fmusic-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffascript%2Fmusic-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffascript","download_url":"https://codeload.github.com/jeffascript/music-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffascript%2Fmusic-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31907720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-15T06:15:17.765Z","updated_at":"2026-04-16T23:01:17.911Z","avatar_url":"https://github.com/jeffascript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Music Service APP\n\n**Server**\n\n-   Typescript\n-   Node\n-   Express\n-   Redis (caching solution)\n\n## Run the App\n\nApp is dockerized. Hence, Docker needs to be up and running on the system.\n\nAfter cloning the repo:\n\n```sh\nnpm install\n```\n\nand start with :\n\n```sh\nnpm start\n```\n\n       OR\n\n```sh\nyarn start\n```\n\nas you see fit.\n\nIf you are using docker:\n\n```sh\n\ndocker-compose up --build\n\n```\n\nThis will build the docker images and start the app.\n\n\u003e If you face any issue after running `docker-compose up` command, please kill the server and restart again. Prolly, compiller issues from TS.\n\n### Ports\n\nThis backend Service is exposed on the port `5001`.\n\n### Architectural flow\n\n## Seed MBID:\n\n```sh\n494e8d09-f85b-4543-892f-a5096aed1cd4\n\nd262ea27-3ffe-40f7-b922-85c42d625e67\n\n1138a764-2212-4d0a-b02d-0dc14df91e08\n```\n\nYou can get more from MBID for search from this url: https://musicbrainz.org/search?query\n\n#### Search \u0026 Cache functionality\n\nAs a user, when you append in a search string {:/mbid} at the end of the url param, the app first checks for the results stored in the temporary **cache**, else it makes an API call to the server to fetch the results, as well as cache the results for that session.\n\nFor the purposes of caching, the search query is stringified and used as the cache key. If the user makes the same search again within the current session, the fetch time is cut by 80% due to the data from the temporary cache - thus avoiding any unnecessary calls to the server.\n\n### API Endpoints\n\nList of available routes:\n\n**Auth routes**:\n\n`GET /musify/music-artist/details/:mbid` - Get the full info of the Artist\n\n`GET /_status` - basic Health check\n\n#### Server\n\nOnce the backend receives a request, it first checks for the results in its cache. This cache is maintained in **Redis** database. If the results are not found in the cache, it then calls the `music brainz api` for the search results.\n\nAfter the results are received, it first formats the results in the necessary format which is easier for the frontend to consume. It then caches this formatted data to the `redis store` and returns the result to the client.\n\nare cached in the `redis` store for upto **2 days**. Once again the key used for storing the cache is the stringified search string/query.\n\n#### Scalability Mechanism\n\nThe app has been load tested with K6 and seemed pretty decent in handling concurrency.\n\nAlso, NGINX was introduced as a load balancer to smoothen the effect on the machine.\n\n### NUANCES\n\nDue to the likelihood of some front images been unavailable, a check was used in picking the CD cover image from the results.\n\nA lot of design patterns were used to make the app more robust and scalable. Services and middlewares were used to divide the app into smaller parts.\n\nErrors are handled with custom ErrorHandlers.\n\n#### Things to add / improve\n\n-   configure CI/CD for the app\n-   etc...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffascript%2Fmusic-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffascript%2Fmusic-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffascript%2Fmusic-service/lists"}