DevLog 250530 - Grocery Automation App

> Log Date: 250530

Today I mapped out an automation system to solve a recurring problem. We needed a shared grocery list app that builds throughout the week, organizes items by aisle, and places a weekly order for pickup.

The stack uses n8n for orchestration, Selenium for browser control, local JSON storage for the list, and Mistral 7B via IRC to format groceries from natural language. It’s fully offline-compatible and runs locally, no cloud dependencies. The eventual goal is a button that orders groceries from Giant every Wednesday without having to think about it.


Project Architecture

Here’s how everything connects:


Dependencies

sudo apt install firefox
pip install selenium
pip install huggingface_hub
pip install python-dotenv

Sample JSON Format

[
  { "item": "bananas", "aisle": "Produce", "quantity": 6, "unit": "pieces" },
  { "item": "oat milk", "aisle": "Dairy", "quantity": 2, "unit": "cartons" },
  { "item": "pie crust", "aisle": "Bakery", "quantity": 1 },
  { "item": "mac & cheese", "aisle": "Pantry", "quantity": 3, "unit": "boxes" }
]

Test Script with Selenium

This test reads the grocery list and searches each item on Giant’s site:

import time, json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.options import Options

with open("grocery_list.json") as f:
    items = json.load(f)

options = Options()
driver = webdriver.Firefox(options=options)
driver.get("https://giantfoodstores.com")

time.sleep(5)

for entry in items:
    search_term = entry["item"]
    try:
        search_box = driver.find_element(By.NAME, "search")
        search_box.clear()
        search_box.send_keys(search_term)
        search_box.submit()
        time.sleep(4)
    except Exception as e:
        print(f"Error searching {search_term}: {e}")

driver.quit()

n8n Workflow Plan

  1. Cron Trigger: every Wednesday at 12:00
  2. Read File Node: parse grocery_list.json
  3. Execute Command Node: run the Selenium script
  4. Optional: parse Selenium results or logs for confirmation

Next Features


Final Thoughts

This system keeps control in our hands. The list is local. The automation is modular. It doesn’t require a third-party app. Just code, chat, and JSON. It’s the beginning of something simple and powerful that fits real life instead of disrupting it.


← Back to DevLogs