Skip to content

maciejkar/Amazon-Product-Improvement

Repository files navigation

GitHub last commit

Amazon Product Improvement Analyzer

A tool that analyzes scrapes Amazon product reviews and suggests product improvements using LangChain and LLMs.

License

Licence

Details

Features

  • Product comments and details scraping from url
  • Product analysis using LangChain
  • Web interface built with Streamlit

Intrerface

example

Development Setup

Set up the env variables by copying ./sample.dev.env to ./.env. You can alter the variables here, eg. debug mode or the selenium browser mode (headful/headless).

A. In container (recommended)

In the main directory run

docker compose --profile dev up

As always, you need to run a docker compose --profile dev build flag to build the image for the first time.

Open localhost:8501 then.

B. Locally

  1. Install requirements for Python 3.10:
pip install -r requirements.txt
  1. Install Chrome for Selenium drivers.
  2. Run the app
cd app
streamlit run runapp.py

Deployment

See the VPS deployment guide

Initial setup

Log in to the VPS server via ssh, create a user and do the following steps. Note, that if the domain marcinkostrzewa.online changes it should be altered everywhere in the repo.

  1. In .bashrc add lines:
    amazon_karczek_path="/home/$USER/Amazon-Product-Improvement"
    alias cd_amazon_karczek='cd $amazon_karczek_path'
    alias karczrun='cd_amazon_karczek; docker compose --profile full down; git pull; docker compose --profile full up -d --build'
    
    alias karczsee='cd_amazon_karczek; docker compose --profile full logs -f'  # live logs
    and run . .bash_rc.
  2. Clone a reporsitory to the proper folder and checkout to production:
    cd_amazon_karczek
    cd ..
    git clone https://github.com/maciejkar/Amazon-Product-Improvement.git
    git checkout production
  3. Create a .env file with at least this entry:
    DEBUG=false
  4. Add certificate with certbot along with a hook to copy files it to ./certs:
    sudo certbot certonly --standalone -d marcinkostrzewa.online -d www.marcinkostrzewa.online --deploy-hook "cp -r /etc/letsencrypt/live/marcinkostrzewa.com $amazon_karczek_path/certs"
  5. Make sure the secrets from .github/workflows/deploy.yaml are set correctly.

Actions

  • Run github workflow to automatically deploy the app.
  • Logs are in ./app/app.log.

Technologies

Python Docker Selenium Google Gemini Streamlit

Authors