Library Manager is an application in development that will be used as a management system for large book catalogs. Currently, Library Manager is in development, with students from Claranet Italy's classroom working on its realization under the careful supervision of their teachers.
- Daniele Rastelli (Backend)
- Luca Ferri (Backend)
- Giorgio Mandolini (Frontend)
- Giorgio Boa (Frontend)
- Paolo Rabbito (Backend)
- Simone Richini (Backend)
- Federico Siddi (Backend)
- Maria Teresa Graziano (Frontend)
- Francesco Santi (Frontend)
- Oleksandr Semykin (Frontend)
- Emanuele Gurini (Frontend)
- Backend: PHP 8.1.13, Docker 20.10.22, Symfony
- Frontend: Node.js version 18 or higher
Enter inside backend folder
$ cd ./backend
Build and setup database
$ make build
$ make migrate-diff
Backend requires creating an empty .env.local
file.
Enter inside frontend folder:
$ cd ./frontend
$ npm install
$ npm run dev
Frontend requires creating .env.local
, .env.production
, and .env.development
files with the following instructions:
VITE_BASE_URL=http://localhost:8080/api/
VITE_LIMIT=5
- Clone the repo
- Checkout develop branch
git checkout develop
- Create new branch from develop
git checkout -b <branch_name>
- At the end merge changes from your new branch into develop
This API allows users to perform CRUD operations on books in a library. Each book has a unique identifier, a title, an author, and a price.
POST /api/books
Creates a new book.
{
"title": "Clean Code",
"author": "Robert Cecil Martin",
"description": "Books description's",
"price": 34.99
}
{
"response": "book stored"
}
400 Bad Request
: if the request body is malformed or missing required fields.
GET /api/books/:id
Gets a book by its unique identifier.
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"title": "Clean Code",
"author": "Robert Cecil Martin",
"description": "Books description's",
"price": 34.99
}
404 Not Found
: if the book with the specifiedid
does not exist.
GET /api/books
Gets a list of all books in the library.
[
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"title": "Clean Code: A Handbook of Agile Software Craftsmanship",
"author": "Robert Cecil Martin",
"description": "Books description's",
"price": 34.99
},
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0852",
"title": "Design Patterns: Elements of Reusable Object-Oriented Software",
"author": "Erich Gamma",
"description": "Books description's",
"price": 44.99
}
]
PUT /api/books/:id
Updates a book completely by its unique identifier.
{
"title": "Clean Code: A Handbook of Agile Software Craftsmanship",
"author": "Robert Cecil Martin",
"description": "Books description's",
"price": 39.99
}
{
"response": "book updated"
}
404 Not Found
: if the book with the specifiedid
does not exist.400 Bad Request
: if the request body is malformed or missing required fields.
DELETE /api/books/:id
Deletes a book by its unique identifier.
{
"response": "book deleted"
}
404 Not Found
: if the book with the specifiedid
does not exist.
- Use proper HTTP request methods for each endpoint (e.g.
GET
for retrieving data,POST
for creating new resources, etc.) - Format request bodies as JSON and include the
Content-Type: application/json
header in the request. - Handle error responses by checking the HTTP status code and reading the error message in the response body.