Mantis Tracker is a Flask web application for collecting, reviewing, and publishing sightings of the European mantis (Mantis religiosa).
Project website: gottesanbeterin-gesucht.de
- Public multi-step report form (
/melden) - Reviewer workflow for quality control (
/reviewer) - Public map and statistics for accepted reports (
/auswertungen,/statistik) - Image upload pipeline with WebP storage
- PostgreSQL full-text search and export tools for reviewers
Prerequisites:
cp .env.example .env
# Set a secure SECRET_KEY, e.g.:
# python -c "import secrets; print(secrets.token_hex(32))"
just up --buildApp URL: http://localhost:5000
Useful commands:
just down
just logs
just shell
just db
just migrate
just seed
just prod --build
just prod-downPrerequisites:
- Python 3.13+
uvbun- PostgreSQL 16+
cp .env.example .env
uv sync --extra dev
bun installCreate databases:
CREATE USER mantis_user WITH PASSWORD 'mantis';
CREATE DATABASE mantis_tracker OWNER mantis_user;
CREATE DATABASE mantis_tester OWNER mantis_user;Run migrations and seed base data:
uv run flask db upgrade
uv run flask create_all_data_view
uv run flask seed
# optional demo data:
uv run flask seed --demoStart app:
uv run python run.pyrun.py starts Flask and the frontend watcher (bun run watch).
Reviewer quick login (local dev): http://localhost:5000/reviewer/9999
Browser
|
v
Flask App (Blueprints)
| \
v v
PostgreSQL app/datastore (WebP)
^
|
Vite Build (app/static/build + manifest)
Core areas:
app/routes/: HTTP endpoints (main,report,data,statistics,provider,admin,regionen)app/database/: SQLAlchemy models, materialized view, seed/populate logicapp/tools/: domain utilities (coordinates, MTB, mail, Vite helpers)migrations/: Alembic migrations
uv run ruff check .
uv run pyright
uv run pytest
uv run pytest -m unit
uv run pytest --cov=app --cov-report=term-missingTests use a separate PostgreSQL database: mantis_tester.
Build docs:
uv sync --extra docs
make -C docs htmlStrict docs check:
uv run sphinx-build -W --keep-going -b html docs /tmp/mantis-docs-buildMain docs entry points:
docs/index.rstdocs/userinterface/index.rstdocs/develop/index.rst
mantis/
├── app/
│ ├── routes/
│ ├── database/
│ ├── templates/
│ ├── static/
│ └── tools/
├── docs/
├── infrastructure/
├── migrations/
└── tests/
MIT, see LICENCE.md.
