{"id":26488323,"url":"https://github.com/0bvim/ximple-online-library-system","last_synced_at":"2026-04-17T01:03:41.503Z","repository":{"id":281381222,"uuid":"943638959","full_name":"0bvim/ximple-online-library-system","owner":"0bvim","description":"A production-ready online library management API built with Java 21, featuring event sourcing architecture, Kafka event processing, and comprehensive book search, reservation, and review capabilities.","archived":false,"fork":false,"pushed_at":"2025-03-08T19:43:26.000Z","size":274,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-24T10:18:56.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/0bvim.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":"2025-03-06T03:09:39.000Z","updated_at":"2025-03-08T19:43:29.000Z","dependencies_parsed_at":"2025-03-08T18:29:50.627Z","dependency_job_id":null,"html_url":"https://github.com/0bvim/ximple-online-library-system","commit_stats":null,"previous_names":["0bvim/ximple-online-library-system"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/0bvim/ximple-online-library-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0bvim%2Fximple-online-library-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0bvim%2Fximple-online-library-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0bvim%2Fximple-online-library-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0bvim%2Fximple-online-library-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0bvim","download_url":"https://codeload.github.com/0bvim/ximple-online-library-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0bvim%2Fximple-online-library-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31910584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2025-03-20T06:59:22.624Z","updated_at":"2026-04-17T01:03:41.421Z","avatar_url":"https://github.com/0bvim.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Book Management System\nA simple book management system that allows users to reserve books, rate books, and manage their accounts.\n\n## Table of Contents\n- [Features](#features)\n- [Technologies](#technologies)\n- [Architecture Overview](#architecture-overview)\n- [Infrastructure](#infrastructure)\n- [Database Schema](#database-schema)\n- [Getting Started](#getting-started)\n- [Running the Application](#running-the-application)\n- [About API Endpoints](#about-api-endpoints)\n- [Testing the API](#testing-the-api)\n- [Swagger API Documentation](#swagger-api-documentation)\n- [References](#references)\n- [Used AI](#used-ai)\n\n## Features\n- User Management\n- Book Management\n- Reservation Management\n- Rating System\n- Error Handling\n- API Documentation\n- Dockerized\n- Database Integration\n- Logging\n- CI\n- Monitoring\n\n## Technologies\n- Java 21\n- Spring Boot\n- PostgreSQL\n- Docker\n- Swagger\n- GitHub Actions\n\n## Architecture Overview\nThe application is divided into three layers: API, Service, and Data Access. \nThe API layer handles HTTP requests and responses, the Service layer contains the business logic,\nand the Data Access layer interacts with the database.\n```mermaid\nflowchart TD\n    classDef api fill:#92D050,color:#000,stroke:#92D050\n    classDef service fill:#0072C6,color:#fff,stroke:#0072C6\n    classDef data fill:#B4A0FF,color:#000,stroke:#B4A0FF\n    classDef infra fill:#FFC000,color:#000,stroke:#FFC000\n\n    subgraph API[\"API Layer\"]\n        Controller[BookController\u003cbr/\u003e\u003ci\u003eHandles HTTP requests\u003c/i\u003e]:::api\n        Error[GlobalErrorController\u003cbr/\u003e\u003ci\u003eManages exceptions\u003c/i\u003e]:::api\n    end\n\n    subgraph Service[\"Service Layer\"]\n        BookSvc[BookService\u003cbr/\u003e\u003ci\u003eBusiness logic\u003c/i\u003e]:::service\n        ReservationSvc[ReservationService\u003cbr/\u003e\u003ci\u003eBooking management\u003c/i\u003e]:::service\n        ReviewSvc[ReviewService\u003cbr/\u003e\u003ci\u003eRating system\u003c/i\u003e]:::service\n        UserSvc[UserService\u003cbr/\u003e\u003ci\u003eUser management\u003c/i\u003e]:::service\n    end\n\n    subgraph Data[\"Data Access Layer\"]\n        Repo[BookRepository\u003cbr/\u003e\u003ci\u003eJDBC operations\u003c/i\u003e]:::data\n        DB[(PostgreSQL\u003cbr/\u003eDatabase)]:::infra\n    end\n\n    Controller --\u003e BookSvc\n    Controller --\u003e ReservationSvc\n    Controller --\u003e ReviewSvc\n    Controller --\u003e UserSvc\n    Error -.-\u003e|Handles Errors| Controller\n    BookSvc --\u003e Repo\n    ReservationSvc --\u003e Repo\n    ReviewSvc --\u003e Repo\n    UserSvc --\u003e Repo\n    Repo --\u003e DB\n```\n\n## Infrastructure\nThe application is containerized using Docker. The infrastructure layer consists of an API container, a PostgreSQL container, and a database volume for persistent storage.\nI choose to use Docker to containerize the application because it provides a consistent environment for running the application across different platforms and `in my machine it works`.\n```mermaid\nflowchart TD\n    classDef infra fill:#FFC000,color:#000,stroke:#FFC000\n\n    subgraph Infrastructure[\"Infrastructure Layer\"]\n        APIC[API Container\u003cbr/\u003e\u003ci\u003eRuns API services\u003c/i\u003e]:::infra\n        DBContainer[PostgreSQL Container\u003cbr/\u003e\u003ci\u003eRuns database\u003c/i\u003e]:::infra\n    end\n\n    APIC --\u003e DBContainer\n    DBContainer --\u003e|Persistent Storage| Volume[(Database Volume)]:::infra\n\n```\n\n## Database Schema\n```mermaid\nerDiagram\n    BOOK ||--o{ RESERVATION : \"has\"\n    BOOK ||--o{ REVIEW : \"has\"\n    USER ||--o{ RESERVATION : \"makes\"\n    USER ||--o{ REVIEW : \"writes\"\n    BOOK {\n        string id PK\n        string title\n        string author\n        string isbn\n        string genre\n    }\n    USER {\n        string id PK\n        string username\n        string email\n    }\n    RESERVATION {\n        string id PK\n        string book_id FK\n        string user_id FK\n        date reservation_date\n    }\n    REVIEW {\n        string id PK\n        string book_id FK\n        string user_id FK\n        int rating\n        date created_at\n        date updated_at\n    }\n```\n\n## Getting Started\n\u003e Before running the application, make sure you have [*Docker*](https://www.docker.com/get-started/) and [*makefile*](https://www.gnu.org/software/make/) installed on your machine.\n\n1. Clone the repository.\n2. Run the following command to start the application:\n```shell\n    make\n```\n\n- Have another commands in makefile like:\n- `make build` - Build the application.\n- `make run` - Run the application.\n- `make stop` - Stop the application.\n- `make logs` - Show the application logs.\n- `make lint` - Lint the application.\n\n## Running the Application\nThe application runs on port 8080 by default. You can access the application at http://localhost:8080/api/{WhatYouDesire}.\n\n## Swagger API Documentation\nSwagger is a tool that helps you document and test your RESTful APIs. You can access the Swagger UI at the following URL:\n- http://localhost:8080/swagger-ui/index.html\nAnd check all endpoints and test them.\n\n## About API Endpoints\nThe application provides a set of RESTful endpoints for managing books, reservations, health check and reviews.\nHealth check endpoint is used to check the status of the application and commonly used in monitoring tools and not intended for end-users.\nHere is how to test health check endpoint:\n\n```shell\ncurl --request GET \\\n  --url 'http://localhost:8080/actuator/health' | jq\n```\n\nYou should see a response similar to this:\n![img.png](img.png)\n\n## Testing the API\nYou can test the API using tools like *Postman*, *curl*, *insomnia*, *browser* or *.http file*.\nI have provided a sample *[.http file](useful-request-files/generated-requests.http)*, [*insomnia.json*](useful-request-files/Insomnia_import.json) with a bunch of automations and pre-scripts to you don't burn daylight\ncopying and pasting a lot of data to make requests and test the project. \nYou can use this files to test the API endpoints.\n\n## References\n\n- [Spring and Postgres Docker](https://www.youtube.com/watch?v=_Gdb-jK3Sr4)\n- [Response Entity](https://www.baeldung.com/spring-response-entity)\n- [Exception Handling](https://www.baeldung.com/exception-handling-for-rest-with-spring) \n- [Enumerated Types](https://stackoverflow.com/questions/67825729/using-enums-in-a-spring-entity/67826028#67826028)\n- [Working With Records](https://www.youtube.com/watch?v=gJ9DYC-jswo)\n- [Jason Young](https://www.youtube.com/watch?v=eC5X0NEZ8hE)\n- [Pessimistic Locking](https://www.youtube.com/watch?v=0xHdv7LKu1Q)\n- [Building Web Application](https://www.youtube.com/watch?v=31KTdfRH6nY)\n- [OpenApi Documentation](https://www.youtube.com/watch?v=wtYAqS1GcHE)\n- [OpenApi Video](https://youtu.be/2o_3hjUPAfQ?si=pyaFNUmky3oaKJ_5)\n- [Devtiro Event-drive Arch with Java](https://youtu.be/HYBtWRPikgo?si=A5nDv7Mby5C96-MD) || I tried... ||\n- [Alex Hyett](https://youtu.be/gOuAqRaDdHA?si=2CsFYplJ3Ejfoxe-)\n- [Maven vs Gradle](https://youtu.be/5P9cb0xWyO0?si=hxN-yvt9NNcC91tT)\n- [Maven Docs](https://maven.apache.org/guides/)\n- [Springboot Guide](https://spring.io/guides/gs/spring-boot)\n- [Springboot Initalizr](https://start.spring.io/)\n- [Github Kafka tutorial](https://github.com/devtiro/microservices-kafka-tutorial) || A...gain ||\n- [Github Book Management](https://github.com/beatrizdile/ximple-bookservice)\n\n## Used AI:\n- [Claude](https://claude.ai/login)\n- [ChatGPT](https://chatgpt.com/)\n- [Gemini](https://gemini.google.com/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0bvim%2Fximple-online-library-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0bvim%2Fximple-online-library-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0bvim%2Fximple-online-library-system/lists"}