https://github.com/lukasveiga/book-manager
Spring Boot - Rest API Book Manager
https://github.com/lukasveiga/book-manager
docker java postgresql rest-api spring
Last synced: 2 months ago
JSON representation
Spring Boot - Rest API Book Manager
- Host: GitHub
- URL: https://github.com/lukasveiga/book-manager
- Owner: Lukasveiga
- Created: 2023-05-09T02:06:26.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-31T14:53:04.000Z (about 3 years ago)
- Last Synced: 2025-06-06T08:38:11.706Z (about 1 year ago)
- Topics: docker, java, postgresql, rest-api, spring
- Language: Java
- Homepage:
- Size: 179 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **Book Manager API**
Spring Boot - Rest API Book Manager
## **Book Entity**
#### **Endpoints**
- BaseURL: /api/v1/books
- POST: create()
- GET: getAll()
- GET /{title}: getByTitle()
- PUT /{id}: update()
- PATCH ?book= & author=: addAuthorToABook()
- PATCH ?book= & category=: addCategoryToABook()
- DELETE/{id}: inactivate() --> Will be implemented
- DELETE /delete/{id}: delete()
#### **Model**
```json
{
"id" : 1,
"title": "Licoes Preliminares De Direito",
"year": 1984,
"category": "Direito",
"pages": 320,
"language": "português-br",
"image":"http://google.com/LicoesPreliminaresDeDireito.png",
"authors":["Miguel Reale"],
"price": 22.90 --> Will be implemented,
"is-available": true --> Will be implemented(Microservice)
}
```
---
## **Author Entity**
#### **Endpoints**
- BaseURL: /api/v1/authors
- POST: create()
- GET: getAll()
- GET /{name}: getByName()
- PUT /{id}: update()
- DELETE /{id}: delete()
#### **Model**
```json
{
"id": 1,
"name": "James Clear",
"about" : "description",
"books": ["Licoes Preliminares De Direito"]
}
```
---
## **Category Entity**
#### **Endpoints**
- BaseURL: /api/v1/categories
- POST: create()
- GET: getAll()
- GET /{id}: getByName()
- GET /books/category?name=: getBooksByCategory()
- PUT /{id}: update()
- DELETE /{id}: delete()
#### **Model**
```json
{
"id": 1,
"name": "Romance"
}
```
---
## **Object-Relational Mapping**
### **Book -> Author:**
Relation _many to many_, that is one book can have many authors and one author can have many books.
```json
{
"id_book": 1,
"id_author": 1
}
```
### **Book -> Category:**
Relation _many to many_, that is one book can have many categories and one category can have many books.
```json
{
"id_book": 1,
"id_category": 1
}
```