{"id":18067137,"url":"https://github.com/fityannugroho/bookshelf-api","last_synced_at":"2026-02-15T23:03:59.802Z","repository":{"id":111474816,"uuid":"477629966","full_name":"fityannugroho/bookshelf-api","owner":"fityannugroho","description":"Submission kelas back-end pemula dicoding","archived":false,"fork":false,"pushed_at":"2024-12-10T16:23:35.000Z","size":162,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T21:14:26.928Z","etag":null,"topics":["api","backend","dicoding","dicoding-submission","dotenv","hapijs","nodemon"],"latest_commit_sha":null,"homepage":"https://bookshelf-api-dicoding.herokuapp.com/","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/fityannugroho.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["fityannugroho"],"patreon":null,"open_collective":null,"ko_fi":"fityannugroho","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://trakteer.id/fityannugroho/tip","https://saweria.co/fityannugroho"]}},"created_at":"2022-04-04T09:22:04.000Z","updated_at":"2024-06-25T13:11:43.000Z","dependencies_parsed_at":"2024-06-25T14:40:04.103Z","dependency_job_id":"1a8044c1-138c-46ac-a512-91a86914a7ae","html_url":"https://github.com/fityannugroho/bookshelf-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fityannugroho%2Fbookshelf-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fityannugroho%2Fbookshelf-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fityannugroho%2Fbookshelf-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fityannugroho%2Fbookshelf-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fityannugroho","download_url":"https://codeload.github.com/fityannugroho/bookshelf-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480426,"owners_count":21110937,"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","backend","dicoding","dicoding-submission","dotenv","hapijs","nodemon"],"created_at":"2024-10-31T07:07:46.966Z","updated_at":"2026-02-15T23:03:54.783Z","avatar_url":"https://github.com/fityannugroho.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fityannugroho","https://ko-fi.com/fityannugroho","https://trakteer.id/fityannugroho/tip","https://saweria.co/fityannugroho"],"categories":[],"sub_categories":[],"readme":"# Bookshelf API\n\n## Data\n\nAPI ini akan menyimpan data buku dengan atribut sebagai berikut:\n\n```json\n  {\n    \"id\": \"Qbax5Oy7L8WKf74l\",\n    \"name\": \"Buku A\",\n    \"year\": 2010,\n    \"author\": \"John Doe\",\n    \"summary\": \"Lorem ipsum dolor sit amet\",\n    \"publisher\": \"Dicoding Indonesia\",\n    \"pageCount\": 100,\n    \"readPage\": 25,\n    \"finished\": false,\n    \"reading\": false,\n    \"insertedAt\": \"2021-03-04T09:11:44.598Z\",\n    \"updatedAt\": \"2021-03-04T09:11:44.598Z\"\n  }\n```\n\n## API Endpoints\n\n### 1. Menambahkan Buku Baru\n\n```raml\n/books\n  post:\n    description: Menambahkan buku baru\n    request:\n      body:\n        application/json:\n          example: |\n            {\n              \"name\": \"Buku A\",\n              \"year\": 2010,\n              \"author\": \"John Doe\",\n              \"summary\": \"Lorem ipsum dolor sit amet\",\n              \"publisher\": \"Dicoding Indonesia\",\n              \"pageCount\": 100,\n              \"readPage\": 25,\n              \"reading\": false\n            }\n    responses:\n      201:\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"success\",\n                \"message\": \"Buku berhasil ditambahkan\",\n                \"data\": {\n                  \"bookId\": \"Qbax5Oy7L8WKf74l\",\n                }\n              }\n      400:\n        description: properti `name` kosong\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"fail\",\n                \"message\": \"Gagal menambahkan buku. Mohon isi nama buku\",\n              }\n      400:\n        description: properti `readPage` lebih besar dari `pageCount`\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"fail\",\n                \"message\": \"Gagal menambahkan buku. readPage tidak boleh lebih besar dari pageCount\",\n              }\n      500:\n        description: generic error\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"error\",\n                \"message\": \"Buku gagal ditambahkan\",\n              }\n```\n\n### 2. Menampilkan semua buku\n\n```raml\n/books\n  get:\n    description: Menampilkan semua buku\n    responses:\n      200:\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"success\",\n                \"data\": [\n                  {\n                    \"id\": \"Qbax5Oy7L8WKf74l\",\n                    \"name\": \"Buku A\",\n                    \"publisher\": \"Dicoding Indonesia\",\n                  },\n                  {\n                    \"id\": \"1L7ZtDUFeGs7VlEt\",\n                    \"name\": \"Buku B\",\n                    \"publisher\": \"Dicoding Indonesia\",\n                  }\n                ]\n              }\n```\n\n### 3. Menampilkan detail buku\n\n```raml\n/books/{bookId}\n  get:\n    description: Menampilkan detail buku\n    responses:\n      200:\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"success\",\n                \"data\": {\n                  \"id\": \"Qbax5Oy7L8WKf74l\",\n                  \"name\": \"Buku A\",\n                  \"year\": 2010,\n                  \"author\": \"John Doe\",\n                  \"summary\": \"Lorem ipsum dolor sit amet\",\n                  \"publisher\": \"Dicoding Indonesia\",\n                  \"pageCount\": 100,\n                  \"readPage\": 25,\n                  \"finished\": false,\n                  \"reading\": false,\n                  \"insertedAt\": \"2021-03-04T09:11:44.598Z\",\n                  \"updatedAt\": \"2021-03-04T09:11:44.598Z\"\n                }\n              }\n      404:\n        description: buku tidak ditemukan\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"fail\",\n                \"message\": \"Buku tidak ditemukan\",\n              }\n```\n\n### 4. Mengubah detail buku\n\n```raml\n/books/{bookId}\n  put:\n    description: Mengubah detail buku\n    request:\n      body:\n        application/json:\n          example: |\n            {\n              \"name\": \"Buku A\",\n              \"year\": 2010,\n              \"author\": \"John Doe\",\n              \"summary\": \"Lorem ipsum dolor sit amet\",\n              \"publisher\": \"Dicoding Indonesia\",\n              \"pageCount\": 100,\n              \"readPage\": 25,\n              \"reading\": false\n            }\n    responses:\n      200:\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"success\",\n                \"message\": \"Buku berhasil diperbarui\",\n              }\n      400:\n        description: properti `name` kosong\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"fail\",\n                \"message\": \"Gagal memperbarui buku. Mohon isi nama buku\",\n              }\n      400:\n        description: properti `readPage` lebih besar dari `pageCount`\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"fail\",\n                \"message\": \"Gagal memperbarui buku. readPage tidak boleh lebih besar dari pageCount\",\n              }\n      404:\n        description: `id` buku tidak ditemukan\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"fail\",\n                \"message\": \"Gagal memperbarui buku. Id tidak ditemukan\",\n              }\n```\n\n### 5. Menghapus buku\n\n```raml\n/books/{bookId}\n  delete:\n    description: Menghapus buku\n    responses:\n      200:\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"success\",\n                \"message\": \"Buku berhasil dihapus\",\n              }\n      404:\n        description: `id` buku tidak ditemukan\n        body:\n          application/json:\n            example: |\n              {\n                \"status\": \"fail\",\n                \"message\": \"Buku gagal dihapus. Id tidak ditemukan\",\n              }\n```\n\n\n## Menjalankan Server\n\n### 1. Konfigurasi server\n\nDupilkasikan file `.env.example` dan ubah namanya menjadi `.env`. Lalu atur `HOST` dan `PORT` sesuai dengan yang diinginkan.\n\n### 2. Jalankan server\n\nUntuk menjalankan di lingkungan **pengembangan (*development*)**, gunakan perintah:\n\n```bash\n$ npm run start:dev\n```\n\nUntuk menjalankan di lingkungan **produksi (*production*)**, gunakan perintah:\n\n```bash\n$ npm run start:prod\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffityannugroho%2Fbookshelf-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffityannugroho%2Fbookshelf-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffityannugroho%2Fbookshelf-api/lists"}