Skip to content

michaelzehetleitner/froide

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssh -i ~/.ssh/fds
-L 8000:127.0.0.1:8000
-L 5173:127.0.0.1:5173
-N -T michael@xxx.xxx.xxx.xxx

Froide

Froide CI

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.

Development on Froide

Required system tools:

Required system libraries:

After clone, create a Python virtual environment and install dependencies:

# create and activate virtual environment
uv venv
source .venv/bin/activate

# install dependencies
uv pip sync requirements-test.txt

# Install git pre-commit hook
pre-commit install

# build froide backend
uv pip install -e . --no-deps

# install frontend dependencies
pnpm install

# install UI test browser (optional)
playwright install --with-deps chromium

# build froide frontend
pnpm run build

# load provided public bodies and Art. 15 DSGVO law
python manage.py migrate

# or run the frontend devserver
pnpm run dev

Start services

You can run your own Postgres+PostGIS database and Elasticsearch service or run them with Docker:

docker compose -f compose-dev.yaml up

This will start Postgres and Elasticsearch and listen on port 5432 and 9200 respectively. You can adjust the port mapping in the compose-dev.yaml.

Setup database and search index, start server

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 runserver

Run tests

Make sure the services are running.

# Run all tests
make test
# Run only unit/integration tests
make testci
# Run only end-to-end tests
make testui

Development tooling

For 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 (pre-commit 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"
}

Upgrade dependencies

make requirements

Sample data

Running python manage.py migrate installs some example public bodies and the law Art. 15 DSGVO. This law has the ID 10001 and serves as the default law in the development settings. The request form offers three request types:

  • Korrigierte Abiturprüfung
  • Korrigierte Probeunterricht mit Protokoll der Lehrerkonferenz
  • Notenübersicht des Schülers

iTunes Library debugging

You can inspect an iTunes Library.xml file for debugging with tools/library_debug.py. The script accepts one or more --track-id or --persistent-id arguments and prints JSON with track information and the playlists the tracks occur in:

python tools/library_debug.py ~/Music/Library.xml --track-id 15201

Docs

Read the documentation including a Getting Started Guide.

Froide is supported by the Open Knowledge Foundation Germany and Open Knowledge Foundation International.

License

Froide is licensed under the MIT License.

About

Frag die Schule

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 64.0%
  • HTML 13.9%
  • Vue 10.2%
  • TypeScript 8.5%
  • JavaScript 2.0%
  • SCSS 1.4%