Skip to content

Commit

Permalink
Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixschndr committed May 18, 2024
1 parent 05ceb30 commit 7e39856
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /app
EXPOSE 8742/tcp

COPY source/*.py .
COPY requirements.txt .
COPY source/requirements.txt .

RUN pip install -r requirements.txt

Expand Down
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ you can ignore some environment variables (e.g. `HTTP_HOST` and `HTTP_PORT`).

#### 1. Locally

1. Copy the contents `.env.example` to `.env` and adjust the environment variables to your needs.
1. Copy the contents `./assets/env.example` to `./.env` and adjust the environment variables to your needs.
2. (Optional) Create and activate a virtual environment with `python -m venv .venv; source .venv/bin/activate`.
3. Install the requirements with `pip install -r requirements.txt`.
3. Install the requirements with `pip install -r ./assets/requirements.txt`.
4. Run `python source/main.py`.

#### 2. As a container with `docker run`
Expand All @@ -65,14 +65,45 @@ you can ignore some environment variables (e.g. `HTTP_HOST` and `HTTP_PORT`).
-e BRING_PASSWORD="<your password>"
-e BRING_LIST_NAME="<your list name>"
-p 1234:8742
ghrc.io/felixschndr/mealie-bring-api
ghrc.io/felixschndr/mealie-bring-api:latest
```

#### 3. As a container with `docker-compose` (Preferred way)

1. Add this container to your existing docker-compose next to your Mealie instance or create a new docker-compose
and adjust the environment variables to your needs.
Take a look at the [example docker-compose](./docker-compose-example.yml).
Take a look at the [example docker-compose](./assets/docker-compose-example.yml).
2. Run `docker-compose up`.

### Setup in Mealie

After deploying the container, there is one simple step you have to do in Mealie: You have to set up the link between
Mealie and this project.

1. Head over to `http(s)://<your-mealie-instance>/group/data/recipe-actions` (e.g.,
`http://localhost:1234/group/data/recipe-actions`) while being logged in as an administrator.
![actions before adding](./assets/images/actions_before_adding.png)
2. Click on `Create` to create a new `action`.
3. Give it any title (e.g. `Bring` or `Add ingredients to Bring`). This will be visible for the users.
![adding action](./assets/images/adding_action.png)
4. For the `URL` input the address where this project is running on followed by a `/` (e.g. `http://localhost:8742/`
or `https://mealie-bring-api.yourlocaldomain.com/` if you are using a reverse proxy)
5. Change the `Type` to `POST`
6. Save
![actions after adding](./assets/images/actions_after_adding.png)
7. Try it out 🎉

### Usage in Mealie

1. Head over to a recipe of your choice.
2. Click on the three little dots.
3. Click on `Recipe Actions`
4. Chose your new action (e.g. `Bring`)
![executing](./assets/images/executing.png)
5. That's it!
- You should now see the ingredients in your list
- You should see some output in the logfile
```text
mealie_bring_api | [2024-05-18 13:38:41,090] [LoggerMixin] [INFO] [Received recipe Apfelstrudel from https://mealie-bring-api.yourlocaldomain.com]
mealie_bring_api | [2024-05-18 13:38:45,373] [LoggerMixin] [INFO] [Added all ingredients to Bring]
```
2 changes: 1 addition & 1 deletion .env.example → assets/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ BRING_LIST_NAME=My list has some spaces in it
IGNORED_INGREDIENTS=Pepper,Salt
LOG_LEVEL=INFO
HTTP_HOST=0.0.0.0
HTTP_PORT=8080
HTTP_PORT=8742
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
image: postgres:15
[...]
bring-api:
image: ghrc.io/felixschndr/mealie-bring-api
image: ghcr.io/felixschndr/mealie-bring-api:latest
container_name: mealie_bring_api
ports:
- 12001:8742
Expand Down
Binary file added assets/images/actions_after_adding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/actions_before_adding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/adding_action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/executing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.

0 comments on commit 7e39856

Please sign in to comment.