Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kedwar83/shopping-cart-microservice-api
This is an API for a shopping cart for a phone store
https://github.com/kedwar83/shopping-cart-microservice-api
css html javascript school-project
Last synced: 13 days ago
JSON representation
This is an API for a shopping cart for a phone store
- Host: GitHub
- URL: https://github.com/kedwar83/shopping-cart-microservice-api
- Owner: kedwar83
- Created: 2021-04-19T17:33:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T14:02:02.000Z (5 months ago)
- Last Synced: 2024-11-20T14:50:53.793Z (2 months ago)
- Topics: css, html, javascript, school-project
- Language: JavaScript
- Homepage:
- Size: 210 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shopping Cart Microservice API
## Overview
This API allows users to interact with a shopping platform by fetching products, viewing product details, managing a shopping cart, and handling comments.## Base URL
`http://18.220.85.60/api/`
## Endpoints
### 1. Get Product List
Fetch products based on filters like title, operating system, and price range.**GET /GetProduct**
**Params (optional):** `title`, `operating_system`, `price_from`, `price_to`
### 2. Get Product Details
Fetch detailed information for a specific product by ID.**GET /GetOneProduct**
**Params:** `product_id` (required)
### 3. Get Product Comments
Fetch comments for a specific product.**GET /GetProductComment**
**Params:** `product_id` (required)
### 4. Add Comment
Submit a comment and rating for a product.**POST /SetComment**
**Params:** `product_id`, `comment`, `score` (all required)
### 5. Add to Cart
Add a product to the shopping cart.**POST /AddToCart**
**Params:** `product_id`, `email`, `quantity` (all required)
### 6. Go to Cart
Redirect to the shopping cart page after email validation.**Function:** `toShoppingCart()`
## UI Interaction
- **Product List**: Displayed in a grid format.
- **Product Details**: Shows selected product information.
- **Comments**: View and submit product comments.
- **Shopping Cart**: Add items and view the cart.## Error Handling
All errors trigger an alert message to the user.## Dependencies
- **jQuery** for AJAX requests.
- **Bootstrap** for UI components.