{"id":30714724,"url":"https://github.com/devhasanmia/library-management-api","last_synced_at":"2025-09-03T05:15:03.252Z","repository":{"id":300208486,"uuid":"1005304907","full_name":"devhasanmia/library-management-api","owner":"devhasanmia","description":"RESTful API built with Express, TypeScript, and MongoDB to manage books and borrow operations. Features include schema validation, custom business logic, Mongoose middleware, aggregation pipeline, and filtering support.","archived":false,"fork":false,"pushed_at":"2025-06-20T11:32:21.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-20T12:34:53.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devhasanmia.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,"zenodo":null}},"created_at":"2025-06-20T02:49:51.000Z","updated_at":"2025-06-20T11:32:24.000Z","dependencies_parsed_at":"2025-06-20T12:47:12.017Z","dependency_job_id":null,"html_url":"https://github.com/devhasanmia/library-management-api","commit_stats":null,"previous_names":["devhasanmia/library-management-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devhasanmia/library-management-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Flibrary-management-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Flibrary-management-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Flibrary-management-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Flibrary-management-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devhasanmia","download_url":"https://codeload.github.com/devhasanmia/library-management-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhasanmia%2Flibrary-management-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273392297,"owners_count":25097259,"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-09-03T02:00:09.631Z","response_time":76,"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":[],"created_at":"2025-09-03T05:15:01.379Z","updated_at":"2025-09-03T05:15:03.243Z","avatar_url":"https://github.com/devhasanmia.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Library Management API\r\nWelcome to the Library Management API documentation built with **Express**, **TypeScript**, and **MongoDB (Mongoose)**.\r\n\r\n## Models \u0026 Validation\r\n### Book Model\r\n\r\n| Field       | Type    | Required | Validation / Notes                              |\r\n|-------------|---------|----------|-----------------------------------------------|\r\n| `title`     | string  | Yes      | Book’s title                                  |\r\n| `author`    | string  | Yes      | Book’s author                                 |\r\n| `genre`     | string  | Yes      | One of: `FICTION`, `NON_FICTION`, `SCIENCE`, `HISTORY`, `BIOGRAPHY`, `FANTASY` |\r\n| `isbn`      | string  | Yes      | Unique ISBN number                            |\r\n| `description` | string | No       | Brief summary or description                   |\r\n| `copies`    | number  | Yes      | Non-negative integer representing total copies |\r\n| `available` | boolean | No       | Defaults to `true` indicating availability   |\r\n\r\n---\r\n\r\n### Borrow Model\r\n\r\n| Field     | Type     | Required | Validation / Notes                            |\r\n|-----------|----------|----------|-----------------------------------------------|\r\n| `book`    | ObjectId | Yes      | References the borrowed book’s ID             |\r\n| `quantity`| number   | Yes      | Positive integer, number of copies borrowed   |\r\n| `dueDate` | Date     | Yes      | Date by which the book must be returned       |\r\n\r\n# API Endpoints\r\n\r\n1. **Create Book**  \r\n   `POST /api/books`\r\n\r\n2. **Get All Books (with filtering \u0026 sorting)**  \r\n   `GET /api/books?filter=\u0026sortBy=\u0026sort=\u0026limit=`\r\n\r\n3. **Get Book by ID**  \r\n   `GET /api/books/:bookId`\r\n\r\n4. **Update Book**  \r\n   `PUT /api/books/:bookId`\r\n\r\n5. **Delete Book**  \r\n   `DELETE /api/books/:bookId`\r\n\r\n6. **Borrow a Book**  \r\n   `POST /api/borrow`\r\n\r\n7. **Borrowed Books Summary (Aggregation)**  \r\n   `GET /api/borrow`\r\n## How to Install and Run\r\n\r\n### 1. Clone the repository\r\n\r\n```bash\r\ngit clone https://github.com/devhasanmia/library-management-api.git\r\ncd library-management-api\r\nnpm install or yarn\r\n```\r\n#### Start the server\r\n```bash\r\nyarn dev\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevhasanmia%2Flibrary-management-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevhasanmia%2Flibrary-management-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevhasanmia%2Flibrary-management-api/lists"}