A simple self-hosted shopping list.
  • Python 49.1%
  • HTML 24.3%
  • JavaScript 15.2%
  • CSS 10.9%
  • Shell 0.3%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-21 07:41:08 +01:00
data Initial commit 2026-02-14 22:24:09 +01:00
routes fix: stale WebSocket 2026-11-21 07:41:08 +01:00
static fix: stale WebSocket 2026-11-21 07:41:08 +01:00
templates chore: multiple corrections 2026-10-10 09:48:24 +02:00
tests fix: stale WebSocket 2026-11-21 07:41:08 +01:00
translations feat: REST-API mit API-Schlüsseln (z.B. für Home Assistant) 2026-10-10 09:36:18 +02:00
.env.example feat: longer login time 2026-08-04 15:44:32 +02:00
.gitignore Initial commit 2026-02-14 22:24:09 +01:00
__init__.py fix: merge issues 2026-02-15 11:38:43 +01:00
auth.py feat: longer login time 2026-08-04 15:44:32 +02:00
config.py feat: longer login time 2026-08-04 15:44:32 +02:00
config.yaml fix: Fixed #26 2026-02-17 20:56:14 +01:00
database.py fix: gelernte Reihenfolge verschiebt nur den gezogenen Artikel 2026-11-06 22:14:31 +01:00
docker-compose.yml feat: longer login time 2026-08-04 15:44:32 +02:00
Dockerfile chore: copy all files 2026-10-11 18:52:17 +02:00
items.py feat: gelernte Reihenfolge pro Markttyp 2026-10-18 13:41:27 +02:00
LICENSE Initial commit 2026-02-14 16:23:37 +01:00
main.py feat: REST-API mit API-Schlüsseln (z.B. für Home Assistant) 2026-10-10 09:36:18 +02:00
ordering.py fix: gelernte Reihenfolge verschiebt nur den gezogenen Artikel 2026-11-06 22:14:31 +01:00
pyproject.toml fix: stale WebSocket 2026-11-21 07:41:08 +01:00
ratelimit.py feat: rate limiting 2026-03-21 06:33:53 +01:00
README.md chore: multiple corrections 2026-10-10 09:48:24 +02:00
requirements-dev.txt chore: multiple corrections 2026-10-10 09:48:24 +02:00
requirements.txt fix: upgrade FastAPI/Starlette/Pydantic/Jinja2 and adopt new TemplateResponse signature 2026-06-26 10:33:09 +02:00
start.sh fix: port 2026-02-15 13:54:55 +01:00
websocket.py refactored responsibilities 2026-02-15 08:03:33 +01:00

🛒 Einkaufsliste

A self-hosted, very simple shopping list app.

No "schnickschnack".

Features

  • Multiple Lists: For different shopping locaionts, there are different lists.
  • Multiple Users: Several users share lists when they belong to a household.
  • Sync: Sync in real-time with serverx
  • Proposal List: Fill the shopping list from a proposal list what is availble in the store
  • Shopping Mode: A simple list where it is possible to cross off items

What it is not

  • If you are looking for managing your groceries at home, have a look at Grocy
  • If you want to copy items from recipes to a shopping list, visit Tandoor or Mealie.
  • If you are looking for managing lists in General, have a look at Jotty.

Note

I am a software engineer (currently in the role as a Software Architect) with more than 25 years of experience in software development. Still, with this project I wanted to experience how I can utilize an AI agent. I am learning with this project about the usage of automated coding and also on web development with Python (which I have not yet done in my career). Therefore, if you like the approach and want to contribute to make things better, you are very welcome. Otherwise you may have a look at other projects on Codeberg.

Have fun!

Docker

git clone https://codeberg.org/deinname/einkaufsliste.git
cd einkaufsliste

# create .env and generate secret key
cp .env.example .env
echo "SECRET_KEY=$(openssl rand -hex 32)" >> .env

# start
docker compose up -d

Check the terminal or log for the admin link:

docker compose logs app

→ Open the link in browser, set a password. Done.
Add additional users via the admin page.

Reverse Proxy (nginx)

The app is running under 127.0.0.1:7953 und using a reverse proxy is recommended. WebSocket support is mandatory (Upgrade-Header).

Example configuration for nginx:

proxy_read_timeout 86400s;
proxy_send_timeout 86400s;

add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline'; font-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data:;" always;


# Never cache the service worker
location = /sw.js {
    proxy_pass http://<host>:7953;
    add_header Cache-Control "no-cache, no-store, must-revalidate";
}

limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;

location /login {
    limit_req zone=login burst=3 nodelay;
    proxy_pass http://<host>:7953;
}


Without Docker

Run directly on the host.

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

export SECRET_KEY=$(openssl rand -hex 32)
uvicorn main:app --host 127.0.0.1 --port 7953

or with the start script:

chmod +x start.sh && ./start.sh

Configuration

config.yaml contains households, market types and proposal lists.

REST API

Other systems (e.g. Home Assistant) can read and add items with an API key. Create a key under Admin → Households → API keys. Each key grants access to exactly one household; the key is shown only once, the database keeps just its hash.

Authorization: Bearer ekl_...

Households and store types can be addressed by ID or name (case-insensitive), because a voice assistant only knows the name.

Method Path Purpose
GET /api/v1/households Household(s) the key belongs to
GET /api/v1/households/{household}/store_types Store types (lists) of the household
GET /api/v1/households/{household}/items?store=&include_checked=false Open items, optionally of one store
POST /api/v1/households/{household}/items Add an item
curl -X POST http://localhost:7953/api/v1/households/am-wald/items \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name": "Milch", "store": "Aldi", "quantity": 1}'

Body fields: name, store (required), quantity (default 1), unit, added_by (default: key name). An item with the same name raises the quantity instead of creating a duplicate; a checked item counts as bought and is reactivated with the new quantity. The spelling of an existing item or suggestion is reused ("milch" → "Milch"). Unknown store → 404 with the list of available stores. Changes are pushed to all open clients immediately.

Tests

pip install -r requirements-dev.txt
pytest

The tests run against a temporary database; data/shopping.db is never touched.

Backup

The database can be found under data/shopping.db (SQLite).

To perform a simple backup:

cp data/shopping.db data/shopping.db.bak

Tech Stack

  • Backend: Python, FastAPI, uvicorn
  • Datenbank: SQLite via aiosqlite
  • Echtzeit: WebSockets
  • Auth: JWT-Cookies, bcrypt, Einladungstoken
  • Frontend: Vanilla JS, kein Framework