https://github.com/falasefemi2/ecommerce
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
https://github.com/falasefemi2/ecommerce
e-commerce java maven mysql rest-api spring-boot spring-data-jpa web-application
Last synced: 3 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/falasefemi2/ecommerce
- Owner: Falasefemi2
- Created: 2025-07-01T23:51:38.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-02T12:05:17.000Z (about 1 year ago)
- Last Synced: 2025-07-02T13:21:56.297Z (about 1 year ago)
- Topics: e-commerce, java, maven, mysql, rest-api, spring-boot, spring-data-jpa, web-application
- Language: Java
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:**
```bash
git clone https://github.com/Falasefemi2/ecommerce.git
```
2. **Navigate to the project directory:**
```bash
cd ecommerce
```
3. **Build the project:**
```bash
./mvnw clean install
```
## Usage
Run the application using the following command:
```bash
./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:
```bash
./mvnw test
```