{"id":23442228,"url":"https://github.com/sealonk/bookshelf-api","last_synced_at":"2026-04-26T23:31:05.731Z","repository":{"id":267971235,"uuid":"887777795","full_name":"Sealonk/bookshelf-api","owner":"Sealonk","description":"Bookshelf API for managing book collections and user interactions.","archived":false,"fork":false,"pushed_at":"2024-12-14T06:01:33.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T21:48:41.310Z","etag":null,"topics":["api","books","bookshelf","flask","rest"],"latest_commit_sha":null,"homepage":"","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/Sealonk.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}},"created_at":"2024-11-13T09:14:31.000Z","updated_at":"2024-12-14T06:01:37.000Z","dependencies_parsed_at":"2024-12-13T17:05:00.605Z","dependency_job_id":"703fb5ef-144b-4bc5-a8e7-dc443f384597","html_url":"https://github.com/Sealonk/bookshelf-api","commit_stats":null,"previous_names":["sealonk/bookshelf-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sealonk/bookshelf-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sealonk%2Fbookshelf-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sealonk%2Fbookshelf-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sealonk%2Fbookshelf-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sealonk%2Fbookshelf-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sealonk","download_url":"https://codeload.github.com/Sealonk/bookshelf-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sealonk%2Fbookshelf-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32317162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: 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":["api","books","bookshelf","flask","rest"],"created_at":"2024-12-23T17:29:00.168Z","updated_at":"2026-04-26T23:31:05.716Z","avatar_url":"https://github.com/Sealonk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bookshelf API\n\nThis is a simple API for managing books using Hapi.js. The API allows you to add, view, update, and delete books. Each book includes details such as name, year, author, summary, publisher, page count, reading progress, and the status of the book (whether it is finished).\n\n## Features\n\n- **Add a book**: You can add a new book with details such as name, year, author, summary, publisher, etc.\n- **Get all books**: Retrieve a list of all books with basic information (id, name, publisher).\n- **Get a book by ID**: View detailed information for a specific book by its ID.\n- **Edit a book**: Update the details of a book by its ID.\n- **Delete a book**: Remove a book from the list by its ID.\n\n## Technologies Used\n\n- [Hapi.js](https://hapi.dev/): Web framework for building the server.\n- [ESLint](https://eslint.org/): Linting for JavaScript to maintain code quality.\n- [NanoID](https://github.com/ai/nanoid): A small, secure, and URL-friendly unique string ID generator.\n\n## Setup\n\nTo get started with this project locally, follow these steps:\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/Sealonk/bookshelf-api.git\n```\n\n### 2. Install dependencies\n\n```bash\ncd bookshelf-api\nnpm install\n```\n   \n### 3. Run the application\n\n```bash\nnpm run start\n```\n\nThe server will start at `http://localhost:9000`.\n\n### 4. Lint the code\n\nTo check for linting issues, run::\n\n```bash\nnpm run lint\n```\n\n## API Endpoints\n\n### `POST /books`\n\nAdd a new book.\n\n#### Request Body:\n```json\n{\n  \"name\": \"Book Title\",\n  \"year\": 2024,\n  \"author\": \"Author Name\",\n  \"summary\": \"Book summary\",\n  \"publisher\": \"Publisher Name\",\n  \"pageCount\": 300,\n  \"readPage\": 50,\n  \"reading\": true\n}\n```\n\n#### Response:\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Buku berhasil ditambahkan\",\n  \"data\": {\n    \"bookId\": \"generated-id\"\n  }\n}\n```\n\n### `GET /books`\n\nGet a list of all books.\n\n#### Response:\n```json\n{\n  \"status\": \"success\",\n  \"data\": {\n    \"books\": [\n      {\n        \"id\": \"book-id\",\n        \"name\": \"Book Title\",\n        \"publisher\": \"Publisher Name\"\n      }\n    ]\n  }\n}\n```\n\n### `GET /books/{bookId}`\n\nGet detailed information about a book by its ID.\n\n#### Response:\n```json\n{\n  \"status\": \"success\",\n  \"data\": {\n    \"book\": {\n      \"id\": \"book-id\",\n      \"name\": \"Book Title\",\n      \"year\": 2024,\n      \"author\": \"Author Name\",\n      \"summary\": \"Book summary\",\n      \"publisher\": \"Publisher Name\",\n      \"pageCount\": 300,\n      \"readPage\": 50,\n      \"reading\": true,\n      \"finished\": false,\n      \"insertedAt\": \"2024-12-14T00:00:00.000Z\",\n      \"updatedAt\": \"2024-12-14T00:00:00.000Z\"\n    }\n  }\n}\n```\n\n### `PUT /books/{bookId}`\n\nEdit a book by its ID.\n\n#### Request Body:\n```json\n{\n  \"name\": \"Updated Book Title\",\n  \"year\": 2024,\n  \"author\": \"Updated Author\",\n  \"summary\": \"Updated Summary\",\n  \"publisher\": \"Updated Publisher\",\n  \"pageCount\": 350,\n  \"readPage\": 100,\n  \"reading\": true\n}\n```\n\n#### Response:\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Buku berhasil diperbarui\"\n}\n```\n\n### `DELETE /books/{bookId}`\n\nDelete a book by its ID.\n\n#### Response:\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Buku berhasil dihapus\"\n}\n```\n\n## Folder Scructure\n\n```graphql\n- node_modules/\n- src/\n  - books.js          # Stores the array of books\n  - handler.js        # Contains the handler functions for each API endpoint\n  - routes.js          # Maps routes to handler functions\n  - server.js          # Initializes and runs the Hapi.js server\n- .gitignore           # Git ignore file\n- eslint.config.mjs    # ESLint configuration file\n- package.json         # Project metadata and dependencies\n- package-lock.json    # Lock file for npm dependencies\n- README.md            # Project documentation\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsealonk%2Fbookshelf-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsealonk%2Fbookshelf-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsealonk%2Fbookshelf-api/lists"}