{"id":23843459,"url":"https://github.com/sakr2000/librarytask-dexef","last_synced_at":"2026-04-17T04:32:21.273Z","repository":{"id":270473881,"uuid":"910247878","full_name":"sakr2000/LibraryTask-dexef","owner":"sakr2000","description":"A RESTful API for managing a library system, focusing on users and books, using .Net WebAPI.","archived":false,"fork":false,"pushed_at":"2024-12-31T12:21:31.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-31T13:22:43.145Z","etag":null,"topics":["asp-net-core","csharp","sqlserver","webapi"],"latest_commit_sha":null,"homepage":"","language":"C#","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/sakr2000.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-12-30T19:34:01.000Z","updated_at":"2024-12-31T12:25:43.000Z","dependencies_parsed_at":"2024-12-31T13:22:47.265Z","dependency_job_id":"66b0e810-a060-4b4c-835d-9b3e44490968","html_url":"https://github.com/sakr2000/LibraryTask-dexef","commit_stats":null,"previous_names":["sakr2000/librarytask-dexef"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakr2000%2FLibraryTask-dexef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakr2000%2FLibraryTask-dexef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakr2000%2FLibraryTask-dexef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakr2000%2FLibraryTask-dexef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakr2000","download_url":"https://codeload.github.com/sakr2000/LibraryTask-dexef/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240131736,"owners_count":19752727,"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":["asp-net-core","csharp","sqlserver","webapi"],"created_at":"2025-01-02T19:39:19.908Z","updated_at":"2026-04-17T04:32:16.227Z","avatar_url":"https://github.com/sakr2000.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Library Management System\n\nThis is a library management system built using .NET Core and Entity Framework. It allows users to manage books, borrowing, and returning operations with proper validation and business logic.\n\n## Features\n\n1. **Book Management**\n\n   - Add, update, and delete books.\n   - View a paginated list of available books.\n   - Check the availability status of books.\n\n2. **Borrowed Books**\n\n   - Borrow books with a 14-day return policy.\n   - Prevent users from borrowing the same book multiple times simultaneously.\n   - Automatically mark books as unavailable when borrowed.\n\n3. **Returning Books**\n\n   - Return borrowed books.\n   - Update the availability status of books upon return.\n\n4. **Authentication and Authorization**\n\n   - JWT-based authentication.\n   - Role-based access control for users.\n\n5. **API Documentation**\n   - Swagger integration for testing APIs.\n\n## Technologies Used\n\n- **.NET Core**: Framework for building the application.\n- **Entity Framework Core**: ORM for database interaction.\n- **AutoMapper**: For mapping between DTOs and entities.\n- **SQL Server**: Database for storing application data.\n- **Swagger**: For API documentation and testing.\n\n## Prerequisites\n\n- .NET Core SDK\n- SQL Server\n- Visual Studio or any preferred code editor\n\n## Installation\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/sakr2000/LibraryTask-dexef.git\n   cd LibraryTask-dexef\n   ```\n\n2. **Set Up the Database**\n\n   - Update the `appsettings.json` file with your SQL Server connection string.\n   - Run the migrations to set up the database schema:\n     ```bash\n     update-database\n     ```\n\n3. **Run the Application**\n\n   ```bash\n   dotnet run\n   ```\n\n   The application will be available at `https://localhost:7239/`.\n\n4. **Access Swagger Documentation**\n\n   Navigate to `https://localhost:7239/swagger/` to view and test the APIs.\n\n## API Endpoints\n\n### Book Management\n\n- **GET /api/Book**: Get a list of books.\n- **POST /api/Book**: Add a new book.\n- **PUT /api/Book/{id}**: Update an existing book.\n- **DELETE /api/Book/{id}**: Delete a book.\n\n### Borrowed Books\n\n- **GET /api/Book/borrowed-books**: Get a paginated list of borrowed books.\n- **POST /api/Book/borrowed-books**: Borrow a book.\n- **PUT /api/Book/borrowed-books/{id}/return**: Return a borrowed book.\n\n## Business Logic\n\n1. **Prevent Duplicate Borrowing**\n\n   - A user cannot borrow the same book multiple times without returning it.\n\n2. **14-Day Return Policy**\n\n   - Books must be returned within 14 days of borrowing.\n\n3. **Update Availability**\n   - The `IsAvailable` field of a book is updated when it is borrowed or returned.\n\n## Troubleshooting\n\n### Common Errors\n\n- **Database Connection Error**: Ensure the connection string in `appsettings.json` is correct.\n- **JWT Token Issues**: Verify the token settings in the authentication middleware.\n\n## Contributing\n\n1. Fork the repository.\n2. Create a new branch for your feature or bug fix.\n3. Commit your changes and open a pull request.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Contact\n\nFor questions or support, please contact [sakr2000](https://github.com/sakr2000).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakr2000%2Flibrarytask-dexef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakr2000%2Flibrarytask-dexef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakr2000%2Flibrarytask-dexef/lists"}