Skip to content

Jaychafekar/NewBookstoreapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NewBookstoreAPI

A RESTful API project developed in Java using JAX-RS, deployed on Apache Tomcat.

Project Structure

  • 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

How to Run

  1. Package the project using Maven:

  2. Deploy the generated NewBookstoreapi.war file from /target/ to your Apache Tomcat webapps folder.

  3. Start Apache Tomcat server.

  4. Access API at: http://localhost:8080/NewBookstoreapi/rest/


📫 API Endpoints

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

🛠️ Tools Used

  • Java JDK 21
  • NetBeans IDE
  • Apache Tomcat 8.5.96
  • Postman for API Testing
  • Maven for building project

👨‍💻 Developer

  • Name: Jay Chafekar
  • Student ID: w1930680
  • Course: 5COSC022W.2 Client-Server Architectures
  • **Submitted to: University of Westminster.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors