Public searchable archive for human rights documents exported from Bayanat.
A lightweight, read-only portal for browsing and searching documents exported from Bayanat.
Flask, SQLite (FTS5), HTMX, Alpine.js, Tailwind 4, DaisyUI 5, Caddy.
git clone git@github.com:sjacorg/bayanat-archive.git && cd bayanat-archive
cp .env.example .env
uv sync
uv run flask runOpen http://localhost:5000. The archive will be empty until you import documents.
Export from Bayanat, then import:
# In your Bayanat installation:
flask export public --label "public-archive" --output ./export/
# In this repo:
uv run flask import-archive /path/to/export/The import is destructive: it rebuilds data/archive.db and copies media into app/static/media/. See EXPORT_SCHEMA.md for the JSON contract.
docker compose up --buildapp/
__init__.py # Flask factory, SQLite (WAL), blueprint wiring
database.py # Schema DDL + init/build_fts helpers
commands.py # `flask import-archive` CLI
routes/
pages.py # /about, /feedback, /components, /health, /robots.txt, /sitemap.xml
search.py # / (home) + /search (FTS5, facets, pagination)
documents.py # /documents/<id>/<slug>
templates/
base.html # Layout: header, footer, CDN includes
search.html, about.html, document_detail.html, components.html, 404.html
partials/ # HTMX fragments (search results, feedback, timeline, media renderers)
static/
css/ # archive.css (DaisyUI overrides), print.css
js/ # search-page.js, document-detail.js
assets/ # logos, favicons, OG image
media/ # document files (populated by import)
data/
archive.db # SQLite database (populated by import)
Caddyfile # Reverse proxy + static files
Dockerfile
docker-compose.yml
EXPORT_SCHEMA.md # JSON contract between Bayanat and this portal
MIT