Skip to content

CodenameSource/SWDevProject1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShoppyList

Overview

This project is a web application designed for storing Amazon products in a list, with an integrated microservice for scraping their prices. The application provides a set of APIs to add, retrieve, update, and remove items from the stored list. Additionally, it leverages a microservice to periodically refresh and update the prices of the stored Amazon products.

Specifications by user stories

image

Features

  • Add Item: Allows users to add new Amazon products to the system by providing the product's URL.

  • Get Items: Retrieves a list of all stored Amazon products with their details, including URLs and prices.

  • Update Item Price: Updates the price of a specific Amazon product by providing the product's URL. This triggers a refresh event using the price checker microservice.

  • Update Prices of All Items: Initiates a process to update the prices of all stored Amazon products. This involves sending refresh events for each product and listening for updated prices using the price checker microservice.

  • Remove Item: Removes a specific Amazon product from the system by providing the product's URL.

Project Structure

The project consists of the following components:

  • Web Application: The core functionality is implemented using Go and the Gorilla Mux router. The application interacts with a database to store and retrieve Amazon product information.

  • Price checker Microservice: A microservice responsible for handling refresh events and updating product prices. It uses the Kafka messaging system for event-driven communication.

  • MYSQL Database: Used to store the products and their prices

  • Kafka messenger service: Used for communication between the microservices

Setup

To run the project you need to have docker and docker compose installed on your system. The project can be started with docker compose up

API Endpoints

  1. Add Item

    • Endpoint: /api/addItem
    • Method: POST
    • Parameters: JSON payload containing the new item details.
  2. Get Items

    • Endpoint: /api/getItems
    • Method: GET
    • Returns: List of Amazon products with details.
  3. Update Item Price

    • Endpoint: /api/updatePrice
    • Method: GET
    • Parameters: URL query parameter (url) specifying the product's URL.
  4. Update Prices of All Items

    • Endpoint: /api/updatePrices
    • Method: GET
    • Triggers a process to update prices for all stored Amazon products.
  5. Remove Item

    • Endpoint: /api/removeItem
    • Method: DELETE
    • Parameters: URL query parameter (url) specifying the product's URL.

Documentation

  • API documentation is available using Swagger at http://localhost:8080/swagger/index.html.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published