No description
- Python 99.1%
- HTML 0.5%
- Shell 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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.
|
||
| dev | ||
| docs/decisions | ||
| migrations | ||
| src/gw2suggest | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| alembic.ini | ||
| IDEAS.md | ||
| LICENSE | ||
| opencode.json | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
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
-
Clone the repository:
git clone <repository-url> cd gw2suggest-api -
Install dependencies:
uv sync
Running the Application
-
Start the development server:
uv run uvicorn gw2suggest.main:app --reload -
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.