๐ŸŽฏ Goal

This section explains how to run the service locally and execute CommandRequest end-to-end.

๐Ÿงฐ Prerequisites

  • Python (Poetry-managed dependencies)
  • PostgreSQL and Redis
  • Playwright Chromium

If you use Docker, Chromium and system dependencies are already included in the Docker image.

๐Ÿณ Local run with Docker Compose

The gsc-gui-tools repository contains docker-compose.yml which starts:

  • web (Django + Gunicorn)
  • celery_worker
  • celery_scheduler (Celery Beat)
  • command_request_starter (management command that dispatches NEW requests)
  • db (Postgres)
  • redis

๐Ÿ—๏ธ 1) Build the image

docker-compose.yml references image gsc-gui-tools-v1, so build it first:

docker build -t gsc-gui-tools-v1 .

โ–ถ๏ธ 2) Start the stack

docker compose up

After startup:

  • Web: http://localhost:8000/
  • Admin: http://localhost:8000/admin/
  • API docs: http://localhost:8000/api/docs/

๐Ÿ–ฅ๏ธ 3) VNC (watch the browser UI)

The celery_worker container runs a VNC server to help debug Playwright automation.

  • In Docker Compose, VNC is exposed on host port 5901 (mapped to container port 5900).
  • The VNC password is currently hardcoded in scripts/Dockerfile โ€” change it before using this setup outside local development.

๐Ÿ Run without Docker (Poetry)

โš™๏ธ Settings module

For local development (DB/Redis on localhost) use config.local_settings:

export DJANGO_SETTINGS_MODULE=config.local_settings

๐ŸŒ Web (Django)

poetry install
poetry run python manage.py migrate
poetry run python manage.py createsuperuser
poetry run python manage.py runserver

๐Ÿงต Workers / scheduler

Run these in separate terminals:

poetry run celery -A config worker --loglevel=info
poetry run celery -A config beat --loglevel=info
poetry run python manage.py command_request_starter

โœ… How to verify

  1. Create an Account in Admin
  2. Create a CommandRequest (via API or Admin)
  3. Ensure command_request_starter dispatches the task
  4. Ensure celery_worker executes it and status becomes COMPLETED or FAILED
  5. If callback_url was set, ensure a callback is sent

0 items under this folder.