Skip to content

Development environment

madmachinations edited this page Jan 5, 2025 · 2 revisions

A development environment is needed for two things:

  1. Working on the code, obviously
  2. Visually debugging why it is not working for you

Requirements

  • You must have Python 3 installed on your system.
  • You must have either Chrome or Chromium browser installed.

Step 1 - Clone the repo

First things first, git clone ... the project files in this repo.

Step 2 - Local server

  • Open a fresh terminal
  • cd into the server folder in the project files
  • Run python3 -m venv env to create a virtual environment
  • Activate the virtual environment with source venv/bin/activate on Linux/Mac or venv\Scripts\activate on windows.
  • Run pip install -r requirements.txt to install the server's dependencies

You can run the server with python server.py

It should say the server was started, and the process will run in that terminal until it crashes, or you press CTRL + C, or you close the terminal, or force quit the process some other way.

Step 3 - Local client

  • Open a fresh terminal
  • cd into the client folder in the project files
  • Run python3 -m venv env to create a virtual environment
  • Activate the virtual environment with source venv/bin/activate on Linux/Mac or venv\Scripts\activate on windows.
  • Run pip install -r requirements.txt to install the client's dependencies

You can run the client with python client.py

When you run the client it will be like any other installation. It will attempt to connect to the server and take you through the configuration process.

Visual Debugging

If you are having a problem where you cannot get an installation to work, or have some other issue, you can disable headless mode and see what is happening when the server is using the amazon site.

This assumes you have setup the local server development environment as described in Step 2.

If the local server is currently running, kill that process with CTRL + C or whatever.

Next, set this environment variable like so:

export ALEXA_SHOPPING_LIST_DEBUG=1

Now, start up your local server again with python server.py.

You can now run the client and talk to the server as normal. But all functionality which involves talking to the amazon website will open a chrome/chromium window and you can see what is happening at the point where what you are investigating goes wrong.