# AGENTS.md

Kantree is a web application with a server written in Python and a frontend SPA writting in Javascript and Typescript.
Frontend and backend communicate using a REST API and a websocket-based push server for realtime updates.

## Backend

The backend is a python Flask app built using our frasco framework. It requires Python 3.10 and uses poetry for dependency management.

ALWAYS use the `backend` skill when editing backend code (python, sql, ...).

### Database

Migrations are managed using Alembic (an SQLAlchemy related project). Revision files are located in `migrations/versions`.

- **Migrate**: `scripts/migrate`
- **Create migration**: `scripts/create-migration id "description"`

### Backend testing

- **Run all backend tests**: `scripts/run-tests tests/backend`
- **Run specific test**: `scripts/run-tests tests/backend/test_file.py::test_function`
- **Lint**: `poetry run ruff check src/`
- **Security check**: `poetry run bandit -r src/`

If needed, use `./scripts/kantree test-request /path` which will return the full HTTP response. DO NOT USE the dev server for your own testing.
Cookies can be preserved in between requests using `--cookie-file cookies.txt`. Use `--help` for more information if needed.

## Frontend

A SolidJS application with some legacy AngularJS parts.

ALWAYS use the `frontend` skill when editing frontend code (js, ts, html, less, css, ...).
