{"id":18412498,"url":"https://github.com/boyney123/songs-api","last_synced_at":"2026-04-09T12:34:49.642Z","repository":{"id":36852007,"uuid":"195359704","full_name":"boyney123/songs-api","owner":"boyney123","description":"API for songs using Express \u0026 Mongo","archived":false,"fork":false,"pushed_at":"2023-01-04T03:42:49.000Z","size":34674,"stargazers_count":1,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-23T04:29:30.740Z","etag":null,"topics":["express","mongo","mongoose"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/boyney123.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":"2019-07-05T07:22:54.000Z","updated_at":"2019-07-05T09:43:38.000Z","dependencies_parsed_at":"2023-01-17T06:00:36.296Z","dependency_job_id":null,"html_url":"https://github.com/boyney123/songs-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/boyney123/songs-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fsongs-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fsongs-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fsongs-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fsongs-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boyney123","download_url":"https://codeload.github.com/boyney123/songs-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fsongs-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28133002,"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-12-30T02:00:05.476Z","response_time":64,"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":["express","mongo","mongoose"],"created_at":"2024-11-06T03:42:19.355Z","updated_at":"2025-12-30T22:06:58.073Z","avatar_url":"https://github.com/boyney123.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Songs-API 🎵\n\nNodeJS API built with express \u0026 mongodb to handle songs 🎵🎵\n\n## Getting Started\n\n```\ngit clone https://github.com/boyney123/songs-api.git\n```\n\n## Running the application\n\nThere are two ways to get the application running.\n\n- Locally (outside of docker)\n- Using Docker\n\n### Locally\n\nIf you would like to run this locally (outside Docker) then you need to:\n\n1. Make sure you have [mongo running on your machine](https://docs.mongodb.com/manual/installation/).\n2. Rename `.env-example` to `.env`\n3. `npm install \u0026\u0026 npm start`\n\nIf you would like to populate the database run:\n\n```\nnpm run populate-database\n```\n\n### Using Docker\n\n```\ndocker-compose up -d\n```\n\n_This should run the API and mongo within a docker environment_\n\nIf you want to populate the database run:\n\n```\ndocker-compose exec songs-api npm run populate-database\n```\n\n## Running tests\n\nIf you want to run the tests locally you will need `mongo` running on your machine.\n\n```\nnpm test\n```\n\n# API\n\n## `/songs`\n\n### `GET`\n\nReturns an array of data for songs. Requires `limit` and `page` query string parameters.\n\nQuery String values:\n\n- limit: Number - The number of songs to return\n- page: Number - The page to return\n\nExample:\n\nhttp://localhost:3000/songs?page=1\u0026limit=2 will return 2 songs for the first page. http://localhost:3000/songs?page=2\u0026limit=2 will return the next 2 songs on page 2 and so on...\n\n## `/download/{file}`\n\nAll the `mp3` files are served statically. You can download the `mp3` files using the `/download` API.\n\n### `GET`\n\nReturns the mp3 file.\n\nExample: http://localhost:3000/download/Decision.mp3\n\nAll the mp3s that can be downloaded are in the `public/songs` directory.\n\n---\n\n# Suggestions for improvement 🤔\n\n- Better formatting on the logs\n- Possibly adding tests for mongoose models, but they are tested within the routes?\n- Production configuration files if going into production in the future\n- To get Mongo and Node working with docker-compose I had to use `wait-for-it.sh` file. (Which is [recommended](https://github.com/peter-evans/docker-compose-healthcheck/issues/3#issuecomment-329037485)). Given more time I wonder if this could be replaced with something better?\n- Maybe cache the results rather than going to Mongo all the time? For this POC and small API its fine.\n- Adding auth to Mongo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboyney123%2Fsongs-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboyney123%2Fsongs-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboyney123%2Fsongs-api/lists"}