{"id":30761590,"url":"https://github.com/techkumarnitish/book-read-spring-boot-complete","last_synced_at":"2025-09-04T14:14:21.753Z","repository":{"id":309226147,"uuid":"985130528","full_name":"TechKumarNitish/book-read-spring-boot-complete","owner":"TechKumarNitish","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-10T16:22:31.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T18:13:43.944Z","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/TechKumarNitish.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-05-17T05:59:32.000Z","updated_at":"2025-08-10T16:22:34.000Z","dependencies_parsed_at":"2025-08-10T18:14:41.424Z","dependency_job_id":"a4fac46e-5b66-4ccc-b6d8-cf3f27ee799a","html_url":"https://github.com/TechKumarNitish/book-read-spring-boot-complete","commit_stats":null,"previous_names":["techkumarnitish/book-read-spring-boot-complete"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TechKumarNitish/book-read-spring-boot-complete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fbook-read-spring-boot-complete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fbook-read-spring-boot-complete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fbook-read-spring-boot-complete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fbook-read-spring-boot-complete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechKumarNitish","download_url":"https://codeload.github.com/TechKumarNitish/book-read-spring-boot-complete/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fbook-read-spring-boot-complete/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273619763,"owners_count":25138249,"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-04T02:00:08.968Z","response_time":61,"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-04T14:14:20.343Z","updated_at":"2025-09-04T14:14:21.745Z","avatar_url":"https://github.com/TechKumarNitish.png","language":"Java","readme":"# Goodreads Clone – Spring Boot REST API\n\nA simple **Spring Boot**-based REST API for managing books, authors, and publishers, inspired by Goodreads.\nImplements full CRUD operations with proper relational mappings using **Spring Data JPA** and **Hibernate**.Also robust JWT-based authentication \u0026 authorization.\n---\n\n## Features\n\n* **Books**: Add, update, delete, view books with linked authors and publishers.\n* **Authors**: Manage authors and associate them with multiple books.\n* **Publishers**: Manage publishers and associate them with books.\n* **Relations**:\n\n  * `Book` ↔ `Author`: Many-to-Many\n  * `Book` ↔ `Publisher`: Many-to-One\n* Input validation with HTTP status codes (`404`, `400`, `204`).\n* JPA repositories for database interaction.\n* Clear separation of **Model**, **Repository**, and **Service** layers.\n\n---\n\n## Tech Stack\n\n* **Java 11+**\n* **Spring Boot**\n* **Spring Data JPA**\n* **Hibernate**\n* **H2 / MySQL** (configurable)\n* **Jackson** for JSON serialization\n\n---\n\n## Project Structure\n\n```\nsrc/main/java/com/example/goodreads/\n│\n├── controller/\n│   ├── AuthorController.java\n│   ├── BookController.java\n│   ├── PublisherController.java\n│   └── AuthController.java               # Register/Login endpoints issuing JWT tokens\n│\n├── model/\n│   ├── Author.java\n│   ├── Book.java\n│   ├── Publisher.java\n│   └── User.java                        # User entity for authentication\n│\n├── repository/\n│   ├── AuthorRepository.java / AuthorJpaRepository.java\n│   ├── BookRepository.java / BookJpaRepository.java\n│   ├── PublisherRepository.java / PublisherJpaRepository.java\n│   └── UserRepository.java              # JPA repository for User\n│\n├── service/\n│   ├── AuthorJpaService.java\n│   ├── BookJpaService.java\n│   ├── PublisherJpaService.java\n│   └── UserService.java (optional)      # User management \u0026 authentication logic\n│\n├── security/\n│   ├── JwtFilter.java                   # Filters requests, validates JWT\n│   ├── JwtUtils.java                    # Generates and validates JWT tokens\n│   └── SecurityConfig.java              # Spring Security config and filter chain\n│\n└── Application.java                     # Main Spring Boot starter class\n\n```\n\n---\n\n## API Endpoints (Examples)\n\n### **Books**\n\n```\nGET    /books               → Get all books\nGET    /books/{id}          → Get book by ID\nPOST   /books               → Add new book\nPUT    /books/{id}          → Update book\nDELETE /books/{id}          → Delete book\nGET    /books/{id}/authors  → Get authors of a book\nGET    /books/{id}/publisher→ Get publisher of a book\n```\n\n### **Authors**\n\n```\nGET    /authors\nGET    /authors/{id}\nPOST   /authors\nPUT    /authors/{id}\nDELETE /authors/{id}\n```\n\n### **Publishers**\n\n```\nGET    /publishers\nGET    /publishers/{id}\nPOST   /publishers\nPUT    /publishers/{id}\nDELETE /publishers/{id}\n```\n\n---\n\n## Setup \u0026 Run\n\n1. **Clone repository**\n\n```bash\ngit clone \u003crepo-url\u003e\ncd goodreads\n```\n\n2. **Configure DB** in `src/main/resources/application.properties`:\n\n```properties\nspring.datasource.url=jdbc:h2:mem:goodreads\nspring.datasource.driverClassName=org.h2.Driver\nspring.jpa.hibernate.ddl-auto=update\nspring.h2.console.enabled=true\n```\n\n3. **Build \u0026 Run**\n\n```bash\nmvn spring-boot:run\n```\n\n4. **Access API**\n\n```\nhttp://localhost:8080\n```\n\n5. **H2 Console** (if enabled)\n\n```\nhttp://localhost:8080/h2-console\n```\n\n---\n\n## Notes\n\n* **Error Handling**: Returns `404` when resource not found, `400` for invalid input, and `204` for successful deletion without content.\n* **Entity Relationships**: Managed using `@ManyToOne`, `@ManyToMany`, and join tables for author–book mapping.\n* **Extensibility**: New fields and relations can be added easily by extending models and repositories.\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechkumarnitish%2Fbook-read-spring-boot-complete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechkumarnitish%2Fbook-read-spring-boot-complete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechkumarnitish%2Fbook-read-spring-boot-complete/lists"}