autokanban/.github/copilot-instructions.md

2.4 KiB

Copilot Instructions for AI Coding Agents

Project Overview

AutoKanban is a FastAPI-based web application for managing a physical kanban workflow, integrating with a 58mm Arduino thermal printer. The system allows users to submit tasks, admins to approve and print them, and cards to be pinned to a physical board.

Major Components

  • app/main.py: Main FastAPI app, task model, admin session, printer/image generation, static mounts.
  • app/models.py: Pydantic Task model.
  • app/printer.py: (Optional) Printer abstraction for cross-platform serial printing.
  • app/templates/: Jinja2 HTML templates for UI.
  • app/static/: Static files (fonts, CSS, images, Font Awesome OTFs).
  • data/tasks.json: Persistent task storage (JSON).
  • .env: Secrets (admin password, etc). Not committed.
  • .gitignore: Ignores .env, out/, and other sensitive/generated files.
  • out/: Stores generated card preview images (debug mode).

Key Features & Workflows

  • Users submit tasks via web UI.
  • Admins approve tasks and print them to a 58mm ESC/POS thermal printer.
  • Card preview images are generated using Pillow (debug mode), with custom and Font Awesome fonts.
  • Semantic icon rendering: Task keywords map to Font Awesome icons.
  • Admin authentication via password (from .env).
  • Persistent storage in data/tasks.json.
  • German localization in UI and card output.

Build, Test, and Debug

  • Install dependencies: pip install -r requirements.txt
  • Run app: uvicorn app.main:app --reload
  • For card preview (debug): Set DEBUG_PRINT_TO_IMAGE = True in app/main.py.
  • Fonts: Place custom and Font Awesome OTFs in app/static/fonts/.
  • Set admin password in .env as ADMIN_PASSWORD=yourpassword.

Project Conventions

  • Use environment variables for secrets (never hardcode passwords).
  • Use Pillow's robust font loading with error handling for card previews.
  • All static assets (fonts, images) go in app/static/.
  • All persistent data in data/.
  • All generated output in out/ (gitignored).

Integration Points

  • Thermal printer: ESC/POS via python-escpos (serial connection, /dev/ttyUSB0 by default).
  • Font Awesome: Use OTF from app/static/fonts/fontawesome-free-7.1.0-desktop/otfs/.

How to Contribute

  • Update this file as new features, files, or conventions are added.
  • Reference key files and directories.
  • Keep instructions concise and actionable for future AI agents and developers.

Last updated: 2025-10-20