Skip to content

Contributing

Thanks for wanting to contribute to KitchenOwl!

Where do I go from here?

So you want to contribute to KitchenOwl? Great!

If you have noticed a bug, please create an issue before starting any work on a pull request, or get in contact by joining our Matrix space.

Fork & create a branch

If there is something you want to fix or add, the first step is to fork the repository:

KitchenOwl (App, Backend & Docs) Website

Next, create a new branch with an appropriate name using the following format:

git checkout -b '<type>/<description>'

The type is the same as the type you will use for your commit message.

The description is a descriptive summary of the change the PR will make.

General Rules

  • One PR per fix or feature
  • All PRs should be rebased onto main and commits squashed prior to the final merge process

Setup & Install

  • Install Flutter
  • Go to ./kitchenowl
  • Install dependencies: flutter packages get
  • Create empty environment file: touch .env
  • Run app: flutter run
  • Switch to the backend folder: cd backend
  • Install dependencies with uv sync
  • Install the pre-commit hooks: uv run pre-commit install
  • Optionally, activate your Python environment: source .venv/bin/activate (allows you to omit uv run in the following steps; deactivate with deactivate)
  • Initialize/upgrade requirements for the recipe scraper: uv run python -c "import nltk; nltk.download('averaged_perceptron_tagger_eng', download_dir='.venv/nltk_data')"
  • Initialize/upgrade the SQLite database: uv run flask db upgrade
  • Run the debug server: uv run wsgi.py
  • The backend should be reachable at localhost:5000
  • For simple interactions with the backend (like adding a user), you can use uv run manage.py

Known Warnings

Do not run the backend using flask as it won't initialize the sockets properly.

Known Warnings

When debugging the backend, the following warning is shown:

WARNING in __init__: WebSocket transport not available. Install gevent-websocket for improved performance.

This only affects the backend when running in debug mode and can be ignored.

  • Go to ./docs
  • Create a Python environment: python3 -m venv venv
  • Activate your Python environment: source venv/bin/activate (deactivate with deactivate)
  • Install dependencies: pip3 install -r requirements.txt
  • Run docs: zensical serve
  • Install Hugo
  • Clone the website repository
  • Run website: hugo server

Debugging

It is generally recommended to open the backend and frontend projects in separate VS Code instances. Here are example configurations that work well with VS Code and allow you to set breakpoints:

An example configuration for kitchenowl/.vscode/launch.json:

{
    "configurations": [
        {
            "name": "kitchenowl",
            "request": "launch",
            "type": "dart"
        },
        {
            "name": "kitchenowl (profile mode)",
            "request": "launch",
            "type": "dart",
            "flutterMode": "profile"
        }
    ]
}

An example configuration for backend/.vscode/launch.json:

{
    "configurations": [
        {
            "name": "Python Debugger: KitchenOwl",
            "type": "debugpy",
            "request": "launch",
            "program": "wsgi.py",
            "jinja": true,
            "justMyCode": true,
            "gevent": true
        }
    ]
}

To expose the backend to the local network, add the following parameter:

"args": [
    "--host=0.0.0.0"
]

If you need to debug the interaction between two different app instances, you can run Flutter multiple times for different target devices—either by running flutter run -d <DEVICE_ID> or by selecting Run without Debugging in VS Code multiple times. Be aware that it can be confusing to tell which instance a breakpoint is hit in when debugging multiple instances in VS Code.

Git Commit Message Style

This project uses the Conventional Commits format.

Example commit messages:

chore: update gqlgen dependency to v2.6.0
docs(README): add new contributing section
fix: remove debug log statements