{"id":23811569,"url":"https://github.com/dfm18/rare-book-api","last_synced_at":"2026-04-10T12:31:33.083Z","repository":{"id":263600847,"uuid":"851648777","full_name":"dfm18/rare-book-api","owner":"dfm18","description":"REST API to manage a collection of rare books.","archived":false,"fork":false,"pushed_at":"2025-01-26T02:43:27.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T18:42:34.755Z","etag":null,"topics":["docker-compose","h2-database","java","json","junit","maven","mysql","postman-collection","rest-api","spring","spring-mvc","springboot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfm18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-09-03T13:31:03.000Z","updated_at":"2024-09-03T13:32:52.000Z","dependencies_parsed_at":"2024-11-19T12:59:40.383Z","dependency_job_id":"e73e8b4b-7891-4da3-8634-61f8ea199d3b","html_url":"https://github.com/dfm18/rare-book-api","commit_stats":null,"previous_names":["dafexdev/rare-book-api","dfm18/rare-book-api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dfm18/rare-book-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Frare-book-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Frare-book-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Frare-book-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Frare-book-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfm18","download_url":"https://codeload.github.com/dfm18/rare-book-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Frare-book-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31642689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"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":["docker-compose","h2-database","java","json","junit","maven","mysql","postman-collection","rest-api","spring","spring-mvc","springboot"],"created_at":"2025-01-02T01:19:36.244Z","updated_at":"2026-04-10T12:31:33.050Z","avatar_url":"https://github.com/dfm18.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rare Book API\n\n[![Java](https://img.shields.io/badge/Java-ED8B00?style=flat-square\u0026logo=openjdk\u0026logoColor=white)](https://www.java.com/es/)\n[![Maven](https://img.shields.io/badge/Apache_Maven-C71A36?style=flat-square\u0026logo=apachemaven\u0026logoColor=white)](https://maven.apache.org/)\n[![MySQL](https://img.shields.io/badge/MySQL-005C84?style=flat-square\u0026logo=mysql\u0026logoColor=white)](https://www.mysql.com/)\n[![Spring](https://img.shields.io/badge/Spring-6DB33F?style=flat-square\u0026logo=spring\u0026logoColor=white)](https://spring.io/)\n[![Spring Boot](https://img.shields.io/badge/Spring_Boot-F2F4F9?style=flat-square\u0026logo=spring-boot)](https://spring.io/projects/spring-boot)\n[![JUnit](https://img.shields.io/badge/JUnit-25A162?style=flat-square\u0026logo=junit5\u0026logoColor=white)](https://junit.org/junit5/)\n[![Postman](https://img.shields.io/badge/Postman-FF6C37?style=flat-square\u0026logo=postman\u0026logoColor=white)](https://www.postman.com/)\n[![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat-square\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/)\n\nREST API to manage a collection of rare books.\n\n## Features\n\n- Manage Rare Books (Get, Create, Update, Delete)\n- Manage Book Categories\n- Search and filter books by various criteria\n- Pagination support\n- Validation and error handling\n\n## Getting Started\n\nThese instructions will help you set up and run the project on your local machine for development and testing purposes.\n\n### Prerequisites\n\n- Java 21 or higher\n- Maven 3.6+\n- MySQL 8.x\n- Docker (optional, for containerized setup)\n\n### Configuration\n\n#### Using environment variables\n\nSet the required environment variables for the application based on [`.env.example`](./.env.example):\n\n```bash\nSPRING_SERVER_PORT=\nSPRING_DATASOURCE_URL=\nSPRING_DATASOURCE_USERNAME=\nSPRING_DATASOURCE_PASSWORD=\nSPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver\nSPRING_FLYWAY_LOCATIONS=classpath:db/migration/mysql\nSPRING_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect\n```\n\nNow set the [`application.properties`](./src/main/resources/application.properties) file:\n\n```properties\nspring.server.port=${SPRING_SERVER_PORT}\n\nspring.datasource.url=${SPRING_DATASOURCE_URL}\nspring.datasource.username=${SPRING_DATASOURCE_USERNAME}\nspring.datasource.password=${SPRING_DATASOURCE_PASSWORD}\nspring.datasource.driver-class-name=${SPRING_DATASOURCE_DRIVER_CLASS_NAME}\n    \nspring.jpa.properties.hibernate.dialect=${SPRING_HIBERNATE_DIALECT}\n  \nspring.flyway.locations=${SPRING_FLYWAY_LOCATIONS}\n```\n\n#### Using fixed values\n\nAlternatively you can set fixed values in the [`application.properties`](./src/main/resources/application.properties) file:\n\n```properties\nspring.server.port=8080\n\nspring.datasource.url=jdbc:mysql://localhost:3306/rarebookdb\nspring.datasource.username=your_username\nspring.datasource.password=your_password\nspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver\n    \nspring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect\n  \nspring.flyway.locations=classpath:db/migration/mysql\n```\n\n### Use\n\n1. **Build the project:**\n\n    ```bash\n    mvn clean install\n    ```\n\n2. **Run the application:**\n\n    ```bash\n    mvn spring-boot:run\n    ```\n\nThe API will be available at `http://localhost:\u003cserver port\u003e/api/v1/`.\n\n## Running with Docker\n\nThis project includes support for running the Rare Book API in a containerized environment using Docker and Docker Compose.\n\n### Setup\n\n1. **Build the Docker Image**\n\n   ```bash\n   docker build -t rare-book-api:latest .\n   ```\n\n2. **Run with Docker Compose:**\n   ```bash\n   docker compose up\n   ```\n\n### Services\n\n- **app:** Rare Book API on port `8080`.\n- **mysql:** MySQL server on port `3307`.\n- **phpmyadmin:** phpMyAdmin on `http://localhost:9090`.\n\n### Shutting Down\n\n```bash\ndocker compose down\n```\n\n## API Endpoints\n\n### Rare Book\n\n| **Method** | **Endpoint**                  | **Description**                                     |\n|------------|-------------------------------|-----------------------------------------------------|\n| `GET`      | `/api/v1/books`               | Get a paginated list of books with optional filters |\n| `GET`      | `/api/v1/books/{id}`          | Get a book by its ID                                |\n| `POST`     | `/api/v1/books`               | Create a new book                                   |\n| `PUT`      | `/api/v1/books/{id}`          | Update an existing book by its ID                   |\n| `DELETE`   | `/api/v1/books/{id}`          | Delete a book by its ID                             |\n\n### Category\n\n| **Method** | **Endpoint**              | **Description**             |\n|------------|---------------------------|-----------------------------|\n| `GET`      | `/api/v1/categories`      | List all categories         |\n| `GET`      | `/api/v1/categories/{id}` | Get a category by ID        |\n| `POST`     | `/api/v1/categories`      | Create a new category       |\n| `PUT`      | `/api/v1/categories/{id}` | Update an existing category |\n| `DELETE`   | `/api/v1/categories/{id}` | Delete a category           |\n\n## Postman Collection\n\nA Postman collection is provided for testing the API.\n\n### How to use the Postman Collection\n\n1. **Download the Collection:** Get the [Postman Collection File](./resources/rare-book-api-collection.json)\n2. **Import into Postman:**\n\n   - Open Postman.\n   - Click `Import` and select the `rare-book-api-collection.json` file.\n3. **Run Requests:** You can now run the requests to interact with the API endpoints.\n\n## Testing\n\nThis project uses JUnit for unit and integration tests. You can run the tests with the following command:\n\n```bash\nmvn test\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n\n\n## Acknowledgements\n\n- [**wait_for_it.sh:**](https://github.com/vishnubob/wait-for-it) Utility script for docker containers.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm18%2Frare-book-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfm18%2Frare-book-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm18%2Frare-book-api/lists"}