Skip to content

A full-featured e-commerce application built with Spring Boot, enabling users to browse products, manage shopping carts, and securely place orders. Features include product categorization, order management, and an admin panel for managing inventory. Powered by Spring Boot, Spring Data JPA, MySQL

Notifications You must be signed in to change notification settings

Falasefemi2/ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce Project

A simple e-commerce application built with Java and Spring Boot.

Technologies Used

  • Java
  • Spring Boot
  • Maven

Setup and Installation

  1. Clone the repository:
    git clone https://github.com/Falasefemi2/ecommerce.git
  2. Navigate to the project directory:
    cd ecommerce
  3. Build the project:
    ./mvnw clean install

Usage

Run the application using the following command:

./mvnw spring-boot:run

The application will be available at http://localhost:3080.

API Endpoints

The following endpoints are available:

Product Endpoints

  • GET /api/v1/products: Get a list of all products.
  • GET /api/v1/products/{productId}: Get a specific product by its ID.
  • POST /api/v1/products: Create a new product.
  • PUT /api/v1/products/{id}: Update an existing product.
  • DELETE /api/v1/products/{id}: Delete a product by its ID.
  • GET /api/v1/products/brand-and-name?brand={brand}&name={name}: Find products by brand and name.
  • GET /api/v1/products/category-and-brand?category={category}&brand={brand}: Find products by category and brand.
  • GET /api/v1/products/name?name={name}: Find products by a name containing the given string.
  • GET /api/v1/products/brand?brand={brand}: Find products by brand.
  • GET /api/v1/products/category/{category}: Find products by category name.
  • GET /api/v1/products/count?brand={brand}&name={name}: Count products by brand and name.

Category Endpoints

  • GET /api/v1/categories: Get a list of all categories.
  • POST /api/v1/categories/add: Create a new category.
  • GET /api/v1/categories/{id}: Get a specific category by its ID.
  • GET /api/v1/categories/by-name: Find products by category and brand.
  • DELETE /api/v1/categories/{id}: Delete a category by its ID.
  • PUT /api/v1/categories/{id}: Update an existing category.

Image Endpoints

  • POST /api/v1/images: Upload one or more images for a product.
  • GET /api/v1/images/download/{imageId}: Download an image by its ID.
  • PUT /api/v1/images/{imageId}/update: Update an existing image.
  • DELETE /api/v1/images/{imageId}: Delete an image by its ID.

Cart Endpoints

  • GET /api/v1/carts/{cartId}: Get a cart by its ID.
  • DELETE /api/v1/carts/{cartId}/clear: Clear a cart by its ID.
  • GET /api/v1/carts/{cartId}/total: Get the total amount of a cart by its ID.

Cart Item Endpoints

  • POST /api/v1/cartsItem/{cartId}/items: Add an item to a cart.
  • POST /api/v1/cartsItem/items: Add an item to a new cart.
  • PUT /api/v1/cartsItem/{cartId}/items/{productId}: Update the quantity of an item in a cart.
  • DELETE /api/v1/cartsItem/{cartId}/items/{productId}: Remove an item from a cart.

Order Endpoints

-POST /api/v1/orders: Create a new order. -GET /api/v1/orders/{orderId}: Get an order by its ID. -GET /api/v1/orders/users/{userId}/orders: Get all orders for a user.

User Endpoints

-GET /api/v1/users/{userId}: Get a user by their ID. -POST /api/v1/users: Create a new user. -PUT /api/v1/users/{userId}: Update an existing user. -DELETE /api/v1/users/{userId}: Delete a user by their ID.

The following tests are available:

  • CategoryControllerTest.java
  • ImageControllerTest.java
  • ProductControllerTest.java
  • UserControllerTest.java

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Testing

To run the tests, use the following command:

./mvnw test

About

A full-featured e-commerce application built with Spring Boot, enabling users to browse products, manage shopping carts, and securely place orders. Features include product categorization, order management, and an admin panel for managing inventory. Powered by Spring Boot, Spring Data JPA, MySQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages