{"id":29639732,"url":"https://github.com/fikriaf/music-api","last_synced_at":"2025-07-21T20:38:48.420Z","repository":{"id":304314877,"uuid":"1018430549","full_name":"fikriaf/Music-API","owner":"fikriaf","description":"Backend Music API with Some Parameter","archived":false,"fork":false,"pushed_at":"2025-07-20T06:46:24.000Z","size":97942,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-20T08:31:10.810Z","etag":null,"topics":["api","backend","express","music-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/fikriaf.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":"2025-07-12T08:41:42.000Z","updated_at":"2025-07-20T06:46:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"dda5b583-5832-4b58-b37c-e625ee62a0df","html_url":"https://github.com/fikriaf/Music-API","commit_stats":null,"previous_names":["fikriaf/music-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fikriaf/Music-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fikriaf%2FMusic-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fikriaf%2FMusic-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fikriaf%2FMusic-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fikriaf%2FMusic-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fikriaf","download_url":"https://codeload.github.com/fikriaf/Music-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fikriaf%2FMusic-API/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266375806,"owners_count":23919628,"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-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["api","backend","express","music-api"],"created_at":"2025-07-21T20:38:22.399Z","updated_at":"2025-07-21T20:38:48.409Z","avatar_url":"https://github.com/fikriaf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎧 Faftech Music API\n\nFaftech Music API is a lightweight Node.js + Express application designed to serve and upload `.mp3` audio files, complete with metadata duration extraction. It exposes two key endpoints: one for retrieving a list of available music files, and another for uploading new files.\n\n---\n\n## 📦 Features\n\n- 🚀 Fast and simple API for `.mp3` files\n- 📁 Static serving of uploaded audio\n- 🕒 Extracts duration from audio metadata\n- 🎯 Supports cross-origin requests (CORS)\n- ⬆️ Upload `.mp3` via `multipart/form-data`\n\n---\n\n## 🛠️ Tech Stack\n\n- Node.js\n- Express.js\n- Multer (for handling file uploads)\n- music-metadata (to parse audio metadata)\n- TypeScript (optional)\n\n---\n\n## 📂 Folder Structure\n\n```\nfaftech-music-api/\n├── public/\n│   └── audio/            # Uploaded .mp3 files are saved here\n├── src/\n│   └── index.ts          # Main Express app\n├── package.json\n├── tsconfig.json         # TypeScript config (if applicable)\n└── README.md\n```\n\n---\n\n## 🔧 Setup\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/fikriaf/Music-API.git\ncd Music-API/faftech-music-api\n```\n\n### 2. Install dependencies\n\n```bash\nnpm install\n```\n\n### 3. Run the server\n\n```bash\nnpm start\n```\n\nOr with TypeScript (if available):\n\n```bash\nnpx ts-node src/index.ts\n```\n\n---\n\n## 📡 API Endpoints\n\n### `GET /api/music`\n\nReturns a list of all `.mp3` files with metadata:\n\n**Response:**\n```json\n[\n  {\n    \"id\": 1,\n    \"title\": \"Sample Track\",\n    \"file\": \"sample.mp3\",\n    \"url\": \"/audio/sample.mp3\",\n    \"duration\": \"2:34\"\n  }\n]\n```\n\n### `POST /api/upload`\n\nUpload `.mp3` file using `multipart/form-data`. Field name must be `file`.\n\n**Request:**\n```http\nPOST /api/upload\nContent-Type: multipart/form-data\n```\n\n**Form field:**\n- `file`: The `.mp3` file to upload\n\n**Response:**\n```json\n{ \"message\": \"Upload berhasil\", \"file\": \"track.mp3\" }\n```\n\n---\n\n## 🌍 CORS\n\nCORS is enabled for all origins.\n\n---\n\n## 📝 License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffikriaf%2Fmusic-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffikriaf%2Fmusic-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffikriaf%2Fmusic-api/lists"}