A RESTful API project developed in Java using JAX-RS, deployed on Apache Tomcat.
- Model: Book, Author, Customer, CartItem, Order
- Service: Handles business logic
- Resource: JAX-RS endpoints for CRUD operations
- Exception Handling: Custom exceptions and mappers
- Utilities: Validation utilities for input checking
-
Package the project using Maven:
-
Deploy the generated
NewBookstoreapi.warfile from/target/to your Apache Tomcatwebappsfolder. -
Start Apache Tomcat server.
-
Access API at: http://localhost:8080/NewBookstoreapi/rest/
| Resource | Method | Endpoint | Description |
|---|---|---|---|
| Book | GET | /books | Get all books |
| Book | GET | /books/{id} | Get book by ID |
| Book | POST | /books | Create a new book |
| Book | PUT | /books/{id} | Update a book |
| Book | DELETE | /books/{id} | Delete a book |
| Customer | GET | /customers | Get all customers |
| Customer | GET | /customers/{id} | Get customer by ID |
| Customer | POST | /customers | Create a customer |
| Customer | PUT | /customers/{id} | Update a customer |
| Customer | DELETE | /customers/{id} | Delete a customer |
| Cart | POST | /cart/{customerId}/add | Add item to cart |
| Cart | GET | /cart/{customerId} | View cart contents |
| Cart | DELETE | /cart/{customerId}/remove/{bookId} | Remove item from cart |
| Cart | DELETE | /cart/{customerId}/clear | Clear the cart |
| Order | POST | /orders/{customerId}/place | Place an order from cart |
| Order | GET | /orders | Get all orders |
| Order | GET | /orders/{orderId} | Get order by ID |
- Java JDK 21
- NetBeans IDE
- Apache Tomcat 8.5.96
- Postman for API Testing
- Maven for building project
- Name: Jay Chafekar
- Student ID: w1930680
- Course: 5COSC022W.2 Client-Server Architectures
- **Submitted to: University of Westminster.