No description
  • Python 99.1%
  • HTML 0.5%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alexander Siol d43f2fd793 Add group ownership transfer (rank swap, unblocks leave + account deletion)
POST /api/groups/{id}/transfer-ownership hands the top rank to a strictly
lower member via a rank swap: the target ascends to the global Owner rank,
the transferor inherits the target's previous rank. Authorization rides the
new group.transfer_ownership registry key (Owner by default, data-driven
per D11); the rank seed's deploy reconciliation carries the key into
existing deployments' system rows.

The swap unblocks the two guards that previously trapped top-rank holders:
self-leave and account deletion (both answered 409
group_owner_transfer_required until now).

Governance endpoints (self-leave, member removal, rank assignment, group
deletion) now take the group-row FOR UPDATE lock and re-read actor/target
ranks under it, re-verifying the capability: a concurrent transfer moving
the top rank previously let stale guards remove, demote, or overwrite the
new owner, orphaning the group. Account deletion takes the target user-row
lock for the same reason. Transfer targets that turn out departed answer
member_not_found from the fresh read.

The transfer responds with the full group detail under the actor's
post-transfer permission set, so clients can replace their state
wholesale.
2026-10-07 23:15:50 +02:00
dev dev: seed an aggregate-tier group member for browser checks 2026-10-07 20:47:30 +02:00
docs/decisions add cli "seed-users" command 2026-09-06 18:27:35 +02:00
migrations feat: app_meta key-value table (data freshness groundwork) 2026-09-30 21:20:04 +02:00
src/gw2suggest Add group ownership transfer (rank swap, unblocks leave + account deletion) 2026-10-07 23:15:50 +02:00
tests Add group ownership transfer (rank swap, unblocks leave + account deletion) 2026-10-07 23:15:50 +02:00
.gitignore gitignore Claude Code settings 2026-02-17 23:30:34 +01:00
AGENTS.md Fetch the full delta in the build-gated refresh sweep 2026-10-07 17:35:01 +02:00
alembic.ini Fix .env handling 2026-02-15 21:43:02 +01:00
IDEAS.md allow excluding categories from suggestions 2026-02-22 17:47:31 +01:00
LICENSE Initial commit 2026-02-15 00:39:54 +01:00
opencode.json refactor agents instructions into generic format for opencode 2026-09-10 00:06:43 +02:00
pyproject.toml refactor: hash passwords with argon2-cffi directly, dropping passlib 2026-09-24 22:21:16 +02:00
README.md reformat with 120-line length limit 2026-09-06 18:49:15 +02:00
uv.lock refactor: hash passwords with argon2-cffi directly, dropping passlib 2026-09-24 22:21:16 +02:00

GW2 Suggest API

GW2 Suggest is a companion web application for Guild Wars 2 that helps groups of players find achievements to tackle together.

Tech Stack

  • FastAPI: Web framework.
  • SQLAlchemy 2.0: ORM (using async support).
  • Alembic: Database migrations.
  • Pydantic v2: Data validation and settings.
  • Celery: Background tasks.
  • sqladmin: Admin interface.
  • SQLite: Default development database.

Getting Started

Prerequisites

  • Python 3.13+
  • uv (recommended)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd gw2suggest-api
    
  2. Install dependencies:

    uv sync
    

Running the Application

  1. Start the development server:

    uv run uvicorn gw2suggest.main:app --reload
    
  2. Start the Celery worker (requires Redis):

    # In a new terminal
    $env:PYTHONPATH="src"
    uv run celery -A gw2suggest.celery_app worker --loglevel=info
    

The API will be available at http://127.0.0.1:8000. Swagger documentation: http://127.0.0.1:8000/docs.

Database Migrations

Apply migrations to your local SQLite database:

uv run alembic upgrade head

Running Tests

uv run pytest

Linting and Formatting

uv run ruff check .
uv run ruff format .

Manual Testing with .http file

You can use tests/test_main.http for quick manual testing of the endpoints. This file is compatible with:

  • PyCharm: Built-in HTTP Client. Open the file and click the green "Run" arrow next to requests.
  • VS Code: Install the REST Client extension to execute requests directly from the editor.
  • JetBrains IDEs: Any JetBrains IDE (IntelliJ, WebStorm, etc.) supports this format out of the box.

Documentation

See AGENTS.md for detailed development guidelines and best practices.