https://github.com/deanlogan/shopping-cart-backend
Backend for a shopping cart application made in java using Spring Boot, Spring Security, and JWT
https://github.com/deanlogan/shopping-cart-backend
java java-17 maven spring-boot
Last synced: about 2 months ago
JSON representation
Backend for a shopping cart application made in java using Spring Boot, Spring Security, and JWT
- Host: GitHub
- URL: https://github.com/deanlogan/shopping-cart-backend
- Owner: DeanLogan
- Created: 2024-09-10T18:48:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-10T12:52:57.000Z (over 1 year ago)
- Last Synced: 2025-01-23T00:44:50.590Z (over 1 year ago)
- Topics: java, java-17, maven, spring-boot
- Language: Java
- Homepage:
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shopping Cart Backend
Backend for a shopping cart application made in Java using Spring Boot, Spring Security, and JWT.
## Features
- User authentication and authorization using JWT.
- Product management (CRUD operations).
- Shopping cart management.
- Order processing.
- Secure endpoints with role-based access control.
## Endpoints
### Authentication
- **POST** `/api/v1/auth/login` - Authenticate user and get JWT token.
### Products
- **GET** `/api/v1/products` - Get all products.
- **GET** `/api/v1/products/{id}` - Get product by ID.
- **POST** `/api/v1/products` - Add a new product (Admin only).
- **PUT** `/api/v1/products/{id}` - Update product (Admin only).
- **DELETE** `/api/v1/products/{id}` - Delete product (Admin only).
### Cart
- **GET** `/api/v1/carts/{cartId}/my-cart` - Get cart by ID.
- **DELETE** `/api/v1/carts/{cartId}/clear` - Clear cart by ID.
- **GET** `/api/v1/carts/{cartId}/total-price` - Get total price of cart.
### Orders
- **POST** `/api/v1/orders/order` - Create a new order.
- **GET** `/api/v1/orders/{orderId}/get` - Get order by ID.
- **GET** `/api/v1/orders/{userId}/get-orders` - Get all orders for a user.