Froide is a Freedom Of Information Portal using Django 4.2+ on Python 3.12+.
It is used by the German and the Austrian FOI site, but it is fully internationalized and written in English.
Required system tools:
- Python 3.12+
- Node.js 22+
- Docker or compatible containerisation tool
- make
- uv
- pnpm
- prek
Required system libraries:
After clone, create a Python virtual environment and install dependencies:
# create and activate virtual envornment
uv venv -p 3.13
source .venv/bin/activate
# install dependencies
uv sync
# Install git pre-commit hook
prek install
# install frontend dependencies
pnpm install
# install UI test browser (optional)
playwright install --with-deps chromium
# build froide frontend
pnpm run build
# or run the frontend devserver
pnpm run devYou can run your own Postgres+PostGIS database and Elasticsearch service or run them with Docker:
docker compose -f compose-dev.yaml upThis will start Postgres and Elasticsearch and listen on port 5432 and 9200 respectively. You can adjust the port mapping in the compose-dev.yaml.
If you need to adjust settings, you can copy the froide/local_settings.py.example to froide/local_settings.py and edit it. More steps:
# To initialise the database:
python manage.py migrate --skip-checks
# Create a superuser
python manage.py createsuperuser
# Create and populate search index
python manage.py search_index --create
python manage.py search_index --populate
# Run the Django development server
python manage.py runserverMake sure the services are running.
# Run all tests
make test
# Run only the end-to-end tests, which include the accessibility checks
pytest froide/tests/liveThe end-to-end tests check the pages they visit with axe-core. Findings are compared against the snapshots in froide/tests/live/snapshots/, so a test fails when a page gains a problem it didn't have before — existing findings are accepted debt.
# Record the current findings as the new baseline, then review the diff and commit
# (Recording stops at the first snapshot of a test, so repeat until the tests pass)
pytest froide/tests/live --force-regen
# Show the full axe report for every finding, recorded or not
pytest froide/tests/live --a11y-strictFor Python code, we use ruff for linting and formatting. JavaScript, Vue and SCSS files are formatted and linted with ESLint and Prettier.
Make sure to have pre-commit hooks registered (prek install). For VSCode, we recommend some extensions
{
"eslint.format.enable": true,
"eslint.packageManager": "pnpm",
"vetur.format.defaultFormatter.css": "prettier",
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatter.js": "prettier-eslint"
}Read the documentation including a Getting Started Guide.
Froide is supported by the Open Knowledge Foundation Germany and Open Knowledge Foundation International.
Froide is licensed under the MIT License.