Mozilla Moderator is a panel moderation webapp that enables users to view, vote and ask questions on different events.
Then panel moderators can export the questions and use them during panel discussions and Q&A.
License
All mozmoderator source files are made available under the terms of the GNU Affero General Public License (AGPL).
Development with Docker
After cloning this repo, you need to create an .env file. Make a copy of .env-dist named .env.
cp .env-dist .env
Now docker compose from the root directory of the repo
docker compose up
This brings up four services:
web — Django dev server on http://localhost:8000
mysql — MySQL 8 database
mailcatcher — captures outgoing email at http://localhost:1080
node — runs vite build --watch and rebuilds moderator/moderate/static/dist/ whenever you edit anything under frontend/src/
Since this is Django, you will need to create a superuser for your dev work. Do this by attaching to the web container and running the command.
docker compose exec web bash
./manage.py createsuperuser
You should now be able to login at /admin/
Frontend assets
Frontend code lives in frontend/src/ and is bundled by Vite. The node compose service watches the source tree and rebuilds automatically; you usually don’t need to invoke npm directly.
To produce a one-shot production build, or to run the linters:
docker compose run --rm node npm run build
docker compose run --rm node npm run lint:js
docker compose run --rm node npm run lint:css
Tests
Run the Python test suite via pytest:
docker compose run --rm web pytest -q
CI & CD
CI runs via GitHub Actions on every PR and push: lint, pytest, and a Docker image build.
On push to main and on tags, .github/workflows/build-and-push.yml builds the Docker image and pushes it to GCP Artifact Registry at us-docker.pkg.dev/moz-fx-moderator-prod/moderator-prod/moderator. A Kubernetes Flux setup with Helm Charts picks up new images and rolls them out.
tl;dr: push commits to main for a stage deploy, cut a GitHub release tagged v1.2.3 for a production deploy.
Mozilla Moderator
Mozilla Moderator is a panel moderation webapp that enables users to view, vote and ask questions on different events.
Then panel moderators can export the questions and use them during panel discussions and Q&A.
License
All mozmoderator source files are made available under the terms of the GNU Affero General Public License (AGPL).
Development with Docker
After cloning this repo, you need to create an .env file. Make a copy of .env-dist named .env.
Now docker compose from the root directory of the repo
This brings up four services:
web— Django dev server onhttp://localhost:8000mysql— MySQL 8 databasemailcatcher— captures outgoing email athttp://localhost:1080node— runsvite build --watchand rebuildsmoderator/moderate/static/dist/whenever you edit anything underfrontend/src/Since this is Django, you will need to create a superuser for your dev work. Do this by attaching to the web container and running the command.
You should now be able to login at /admin/
Frontend assets
Frontend code lives in
frontend/src/and is bundled by Vite. Thenodecompose service watches the source tree and rebuilds automatically; you usually don’t need to invoke npm directly.To produce a one-shot production build, or to run the linters:
Tests
Run the Python test suite via pytest:
CI & CD
CI runs via GitHub Actions on every PR and push: lint, pytest, and a Docker image build.
On push to
mainand on tags,.github/workflows/build-and-push.ymlbuilds the Docker image and pushes it to GCP Artifact Registry atus-docker.pkg.dev/moz-fx-moderator-prod/moderator-prod/moderator. A Kubernetes Flux setup with Helm Charts picks up new images and rolls them out.tl;dr: push commits to
mainfor a stage deploy, cut a GitHub release taggedv1.2.3for a production deploy.