- Python 49.1%
- HTML 24.3%
- JavaScript 15.2%
- CSS 10.9%
- Shell 0.3%
- Other 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| data | ||
| routes | ||
| static | ||
| templates | ||
| tests | ||
| translations | ||
| .env.example | ||
| .gitignore | ||
| __init__.py | ||
| auth.py | ||
| config.py | ||
| config.yaml | ||
| database.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| items.py | ||
| LICENSE | ||
| main.py | ||
| ordering.py | ||
| pyproject.toml | ||
| ratelimit.py | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| start.sh | ||
| websocket.py | ||
🛒 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