No description
  • Python 72.2%
  • HTML 15.4%
  • CSS 11.5%
  • Dockerfile 0.7%
  • JavaScript 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
zevaryx 84ceddb64d
All checks were successful
CI / precommit (push) Successful in 31s
CI / test (3.12) (push) Successful in 37s
CI / test (3.13) (push) Successful in 34s
CI / test (3.14) (push) Successful in 41s
CI / test (3.15) (push) Successful in 48s
CI / image (push) Successful in 27s
feat(ui): add WEBUI_OFFLINE, which shows a glitching Systems Offline screen
2026-11-03 08:24:40 -07:00
.forgejo/workflows build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
docs docs: add the plan, readme, privacy policy and terms 2026-11-03 07:42:49 -07:00
tests feat(ui): add WEBUI_OFFLINE, which shows a glitching Systems Offline screen 2026-11-03 08:24:40 -07:00
webui feat(ui): add WEBUI_OFFLINE, which shows a glitching Systems Offline screen 2026-11-03 08:24:40 -07:00
.dockerignore build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
.flake8 build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
.gitignore build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
.pre-commit-config.yaml build: leave vendored files alone in pre-commit 2026-11-03 07:54:50 -07:00
compose.example.yaml build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
Dockerfile build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
LICENSE build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
PRIVACY.md docs: add the plan, readme, privacy policy and terms 2026-11-03 07:42:49 -07:00
pyproject.toml build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
README.md feat(ui): add WEBUI_OFFLINE, which shows a glitching Systems Offline screen 2026-11-03 08:24:40 -07:00
run.py build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00
sample.env feat(ui): add WEBUI_OFFLINE, which shows a glitching Systems Offline screen 2026-11-03 08:24:40 -07:00
TERMS.md docs: add the plan, readme, privacy policy and terms 2026-11-03 07:42:49 -07:00
uv.lock build: add project skeleton, Dockerfile, compose example and CI 2026-11-03 07:42:49 -07:00

JARVIS web UI

The dashboard for jarvis-bot: sign in with Discord, manage your reminders and data, and manage the servers you look after. It runs alongside the bot and jarvis-tasks against the same MongoDB.

The design and roadmap are in docs/PLAN.md.

Versions

jarvis-bot, jarvis-tasks, jarvis-core and jarvis-webui share a version number: 3.x of each work with 3.x of the others.

What it does today

Public Landing page with the invite link, features, privacy policy and terms (rendered from PRIVACY.md / TERMS.md)
Sign in Discord OAuth2 (identify guilds); the access token is dropped right after sign-in
You Servers you share with the bot, edit and delete your reminders, delete your data
Server managers Settings (log channels, reports, verified roles, invites, mass-mention, notifications, ignored channels, lockdown exclusions), escalation rules
Moderators Action log (bans, warnings, mutes, kicks, unbans); warn, kick, mute, unmute, ban and unban from the Actions page, carried out by the bot

Actions are queued in MongoDB (web_requests) and the bot carries them out within a couple of seconds, so the web UI needs the matching bot version running. Not built yet: cases, filters, tags, rolegiver, pinboards, temp roles, purge, lock and role menus. See the phases in the plan.

Run it

Add the service from compose.example.yaml to the compose file that already runs bot and tasks; it uses the same .env and MongoDB.

  1. In the Discord developer portal, open the bot's application, go to OAuth2 and add <WEBUI_PUBLIC_URL>/callback as a redirect. Copy the client secret.

  2. Put these in .env (see sample.env):

    Variable
    WEBUI_CLIENT_ID The application ID of the bot. Use the dev bot's in the dev deployment and the prod bot's in prod
    WEBUI_CLIENT_SECRET The OAuth2 client secret
    TOKEN The bot token (lookups only)
    WEBUI_PUBLIC_URL Where users reach the site, e.g. https://jarvis.example.com
    WEBUI_INVITE_PERMISSIONS Optional. Leave blank and the invite link uses the application's Default Install Settings from the developer portal; set an integer to override
    WEBUI_OFFLINE Optional. true shows "Systems Offline, Waiting for Initialization" (HTTP 503) on every page except /healthz, without touching MongoDB or Discord
    WEBUI_SESSION_DAYS Optional, default 7
    WEBUI_SOURCE_URL Optional. Where the footer's "Source code" link goes (default: this repository)
    MONGO_*, ENVIRONMENT Same as the bot (ENVIRONMENT=develop uses jarvis_dev)

    Run one instance per bot (dev and prod), each with its own client ID, secret, token, URL and database.

  3. docker compose up -d webui. It listens on port 8080; put a TLS-terminating reverse proxy in front of it. /healthz answers ok.

The image runs as a non-root user and needs no writable disk.

Develop

uv sync
cp sample.env .env   # fill it in
uv run python run.py

Tests use a real MongoDB and a fake Discord:

JARVIS_TEST_MONGO_URI=mongodb://localhost:27017 uv run pytest

Every collection in the test database is dropped, so give it a database of its own (JARVIS_TEST_MONGO_DB).

Layout

Path
webui/app.py Application factory, security headers, error pages
webui/auth.py Sign in and out
webui/deps.py, webui/perms.py Sessions, CSRF, and working out what someone may do in a server
webui/discord.py Small Discord REST client with caching
webui/routes/ Pages
webui/templates/, webui/static/ The HUD theme (htmx and fonts are vendored; nothing loads from third parties)