A tool that analyzes scrapes Amazon product reviews and suggests product improvements using LangChain and LLMs.
- Product comments and details scraping from url
- Product analysis using LangChain
- Web interface built with Streamlit
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).
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.
- Install requirements for Python 3.10:
pip install -r requirements.txt
- Install Chrome for Selenium drivers.
- Run the app
cd app
streamlit run runapp.py
See the VPS deployment guide
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.
- In
.bashrc
add lines:and runamazon_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
. .bash_rc
. - 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
- Create a
.env
file with at least this entry:DEBUG=false
- 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"
- Make sure the secrets from
.github/workflows/deploy.yaml
are set correctly.
- Run github workflow to automatically deploy the app.
- Logs are in
./app/app.log
.