Sign inSign up

vghoost360/jumbo

By vghoost360

โ€ขUpdated 8 months ago

Image
Integration & delivery
API management
Web analytics
0

1.6K

vghoost360/jumbo repository overview

โ Jumbo API

๐Ÿ›’ Comprehensive REST API and modern web dashboard for the Jumbo.com grocery platform.

Automates authentication via headless Chromium, manages your shopping basket, lists (lijstjes), order history, store receipts, and provides detailed product lookups by SKU or EAN barcode with OpenFoodFacts fallback.


โ ๐Ÿš€ Quick Start

docker compose up -d

โ โœจ Features

โ ๐Ÿ›’ Shopping Basket
  • View your current basket with full product details
  • Add/remove products by SKU
  • Update quantities
  • Real-time price calculations
  • Promo price support
โ ๐Ÿ“ Shopping Lists (Lijstjes)
  • Access all your shopping lists
  • View favorite lists and custom lists
  • See product images, prices, and details
  • Product count tracking
โ ๐Ÿ“ฆ Order Management
  • View online order history
  • Detailed order information with delivery dates
  • Item-level details with images and pricing
  • Track order status, substitutions, and unavailable items
  • Support for home delivery and store pickup orders
โ ๐Ÿงพ Store Receipts
  • View in-store and online receipt history
  • Detailed receipt breakdown with VAT summaries
  • Product matching and enrichment
  • Loyalty points tracking (Jumbo Extra's)
  • Payment method information
  • Store location details
โ ๐Ÿ” Product Search & Lookup
  • Search products by SKU
  • Intelligent barcode lookup (EAN codes) with OpenFoodFacts fallback
  • EAN similarity matching algorithm - finds best product match when exact barcode not found
    • Searches up to 8 product candidates
    • Scores matches based on EAN prefix similarity (0-100)
    • Color-coded confidence indicators (green โ‰ฅ90%, yellow <90%)
    • Shows both scanned barcode and matched product EAN
  • If barcode not found in Jumbo, automatically queries OpenFoodFacts and searches by product name
  • Comprehensive product information:
    • Nutritional data & allergens
    • Multiple images (thumbnails & high-res)
    • Pricing with promotions
    • Brand, categories, descriptions
    • Availability & stock status
    • Manufacturer details & origin
    • Storage & preparation instructions
โ ๐Ÿ” Authentication & Auto Re-login
  • Automated Selenium-based browser login
  • Cookie persistence across restarts
  • Auto re-authentication when sessions expire
  • Web-based credential management in Settings
  • Save credentials directly from the dashboard
  • Environment variable support for homelab deployments
โ ๐ŸŽจ Modern Web Dashboard
  • Dark-themed, responsive UI
  • Real-time basket updates
  • Interactive product cards with images
  • Modal dialogs for detailed views
  • Toast notifications
  • Command history tracking
  • Comprehensive Settings page with credential management
โ โš™๏ธ Product Matching Engine
  • Intelligent receipt product enrichment
  • Configurable confidence thresholds
  • Price, weight, and name matching
  • Caching for improved performance
  • Manual cache clearing
  • OpenFoodFacts integration for unknown barcodes

โ ๐Ÿ“š Documentation

โ Interactive API Explorer

Visit http://localhost:8000/docsโ  for the full Swagger/OpenAPI documentation where you can:

  • Try all endpoints directly in your browser
  • See request/response schemas
  • Test authentication flows
  • No code required
โ Comprehensive API Reference

See API_README.mdโ  for:

  • Complete endpoint documentation
  • Authentication guides
  • Code examples in Python, JavaScript, and cURL
  • Architecture overview
  • Troubleshooting tips

โ ๐Ÿ” Authentication Setup

The API supports three methods for persistent authentication:

โ Option 1: Web Dashboard (Easiest)
  1. Open http://localhost:8000โ 
  2. Go to Settings tab
  3. Enter your credentials in the "Login Credentials" section
  4. Click "Save Credentials"
  5. Credentials are stored securely for auto re-authentication

Set credentials via environment variables in Portainer or docker-compose:

environment:
  - [email protected]
  - JUMBO_PASSWORD=your-password
โ Option 3: Manual Login

Login once via web dashboard:

  • Click "Login" button in header
  • Enter credentials
  • Credentials auto-save for future sessions

How it works:

  • Session cookies saved to /app/data/session-cookies.json
  • Credentials saved to /app/data/credentials.json (or use env vars)
  • Auto re-authentication triggers when cookies expire
  • Seamless operation without manual intervention

โ ๐Ÿ”ง Settings & Configuration

โ Web Dashboard Settings

Access the Settings panel to configure:

โ ๐Ÿ” Login Credentials
  • Save/update your Jumbo.com credentials
  • View credential status
  • Remove saved credentials
โ ๐Ÿ“ฆ Barcode Lookup
  • OpenFoodFacts Fallback - automatically query OpenFoodFacts when barcode not found
  • EAN Similarity Matching - intelligent algorithm finds best match:
    • Checks up to 8 product candidates
    • Scores based on matching EAN prefix digits
    • 10+ matching digits = 90 score (high confidence)
    • 8+ matching digits = 70 score (medium confidence)
    • 6+ matching digits = 50 score (low confidence)
  • Displays confidence score with color coding
  • Shows scanned vs matched EAN for transparency
โ ๐Ÿงพ Receipt Product Matching
  • Enable/disable product enrichment
  • Strict matching mode
  • Confidence threshold slider
โ ๐ŸŽฏ Matching Criteria
  • Price matching
  • Weight/volume matching
  • Name matching
โ ๐Ÿ—‘๏ธ Cache Management
  • Clear product match cache

โ ๐Ÿ”‘ Quick API Examples

โ Authentication
# Login
curl -X POST http://localhost:8000/api/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"[email protected]","password":"yourpassword"}'

# Check auth status
curl http://localhost:8000/api/auth/status
โ Basket Operations
# Get basket
curl http://localhost:8000/api/basket

# Add product
curl -X POST http://localhost:8000/api/basket/add \
  -H 'Content-Type: application/json' \
  -d '{"sku":"67649PAK","quantity":2}'

# Update quantity
curl -X PATCH http://localhost:8000/api/basket/items/{line_id} \
  -H 'Content-Type: application/json' \
  -d '{"quantity":5}'

# Remove product
curl -X POST http://localhost:8000/api/basket/remove \
  -H 'Content-Type: application/json' \
  -d '{"line_id":"abc123"}'
โ Shopping Lists
# Get all lists
curl http://localhost:8000/api/lists

# Get specific list details
curl http://localhost:8000/api/lists/{list_id}
โ Orders & Receipts
# Get orders and receipts
curl "http://localhost:8000/api/orders?limit=10&page=0"

# Get order details
curl http://localhost:8000/api/orders/{order_id}

# Get receipt details
curl http://localhost:8000/api/receipts/{transaction_id}
โ Product Search & Barcode Lookup
# Search by SKU
curl "http://localhost:8000/api/products/search?sku=67649PAK"

# Barcode lookup (with OpenFoodFacts fallback and EAN matching)
curl -X POST http://localhost:8000/api/products/barcode \
  -H 'Content-Type: application/json' \
  -d '{"barcode":"8718452829408"}'

# Response includes EAN matching details:
# {
#   "sku": "629680PAK",
#   "title": "Jumbo Cola Regular 6 x 1,5 L",
#   "ean": "8718452829583",
#   "scannedBarcode": "8718452829408",
#   "eanMatchScore": 90,
#   "verified": true,
#   "matchSource": "OpenFoodFacts",
#   "matchedName": "Cola"
# }
โ Settings Management
# Get all settings
curl http://localhost:8000/api/settings

# Update settings
curl -X PUT http://localhost:8000/api/settings \
  -H 'Content-Type: application/json' \
  -d '{"useOpenFoodFactsFallback":true,"confidenceThreshold":50}'

# Save credentials
curl -X PUT http://localhost:8000/api/settings/credentials \
  -H 'Content-Type: application/json' \
  -d '{"username":"[email protected]","password":"yourpassword"}'

# Remove credentials
curl -X PUT http://localhost:8000/api/settings/credentials \
  -H 'Content-Type: application/json' \
  -d '{"removeCredentials":true}'

# Clear match cache
curl -X POST http://localhost:8000/api/settings/clear-cache

For more examples, see API_README.mdโ 


โ ๐Ÿ—๏ธ Project Structure

app/
  main.py              # FastAPI application & REST endpoints
  jumbo_client.py      # Jumbo GraphQL client + Selenium auth + OpenFoodFacts
  templates/
    index.html         # Web dashboard with settings management
  static/
    app.js            # Frontend JavaScript
    style.css         # Responsive dark theme
  Dockerfile
  requirements.txt
data/                  # Persistent data volume
  session-cookies.json # Saved session cookies
  credentials.json     # Encrypted credentials (optional)
  barcode-cache.json   # Product barcode cache
  settings.json        # User preferences
docker-compose.yml
API_README.md          # Complete API documentation

โ ๐Ÿณ Docker Deployment

docker-compose up -d
โ Using Docker Run
docker run -d \
  --name jumbo-api \
  -p 8000:8000 \
  -v jumbo-data:/app/data \
  -e [email protected] \
  -e JUMBO_PASSWORD=yourpassword \
  vghoost360/jumbo:latest
โ Pull Latest Version
docker pull vghoost360/jumbo:latest
# or specific version
docker pull vghoost360/jumbo:v2.6.0
โ Volume Mounting

The container uses a persistent volume at /app/data for:

  • Session cookies
  • Credentials (encrypted)
  • Product match cache
  • Barcode lookup cache
  • User settings

Important: Mount this volume to preserve authentication between container restarts.


โ ๐Ÿ› ๏ธ Tech Stack

  • Backend: Python 3.11, FastAPI, Uvicorn
  • Authentication: Selenium (headless Chromium)
  • HTTP Client: httpx (async)
  • External API: OpenFoodFacts API integration
  • Frontend: Vanilla JavaScript, CSS Grid/Flexbox
  • Container: Docker (python:3.11-slim + Chromium)

โ ๐Ÿ”ง Configuration

โ Environment Variables
VariableDescriptionDefault
JUMBO_USERNAMEYour Jumbo.com emailNone
JUMBO_PASSWORDYour Jumbo.com passwordNone
TZTimezoneEurope/Amsterdam
โ Settings API

Configure behavior via /api/settings or the web dashboard:

  • productMatchingEnabled - Enable/disable receipt enrichment
  • strictMatching - Require higher confidence for matches
  • confidenceThreshold - Minimum confidence percentage (0-100)
  • usePriceMatching - Include price in matching algorithm
  • useWeightMatching - Include weight in matching algorithm
  • useNameMatching - Include name similarity in matching
  • useOpenFoodFactsFallback - Query OpenFoodFacts when barcode not found

โ ๐Ÿ“Š Health Check

curl http://localhost:8000/api/health

Response:

{
  "status": "healthy",
  "timestamp": "2026-02-22T17:43:00Z",
  "authenticated": true
}

โ ๐Ÿ†• Changelog

โ v2.6.0 (2026-02-22)

New Features:

  • ๐ŸŒ OpenFoodFacts Integration - Automatic fallback when barcode not found in Jumbo
    • Queries OpenFoodFacts API for product name
    • Searches Jumbo catalog with matched name
    • Configurable via settings toggle
  • ๐ŸŽฏ EAN Similarity Matching Algorithm - Intelligent product matching system
    • Checks up to 8 product candidates for best EAN match
    • Scores based on matching EAN prefix digits (0-100)
    • Pattern matching: 8718452829xxx = 10 matching digits = 90 score
    • Returns both scanned barcode and matched product EAN
    • Color-coded confidence indicators in UI (green/yellow/red)
    • Warnings for low confidence matches (<90%)
  • ๐Ÿ” Credential Management UI - Save/update credentials directly from Settings page
    • Visual credential status indicator
    • Secure credential storage
    • Remove credentials option

Bug Fixes:

  • ๐Ÿ› Fixed critical JavaScript syntax errors preventing button clicks
  • ๐Ÿ”ง Added missing hasProduct variable definition
  • ๐ŸŽจ Fixed malformed template literals in receipt rendering
  • โœ… Resolved 89+ linting errors
  • ๐Ÿ” Fixed SKU preservation in EAN matching results

Improvements:

  • ๐Ÿ“ Enhanced settings page with credential management
  • ๐ŸŽฏ Better barcode lookup with intelligent EAN matching
  • ๐Ÿ“Š Transparent confidence scoring system
  • ๐ŸŽจ Fixed Settings page CSS (input field overlap)
  • ๐Ÿงน Code cleanup and validation
  • ๐Ÿ“š Comprehensive documentation updates
โ v2.5.1
  • Receipt product enrichment
  • Order detail views
  • Shopping list support
  • Product matching engine

โ ๐Ÿ”’ Security Notes

  • Credentials are stored in Docker volumes (not in image)
  • .dockerignore excludes personal data from builds
  • Session cookies managed securely
  • No credentials in logs or version control
  • Use environment variables for production deployments
  • OpenFoodFacts queries use anonymous API access

โ ๐Ÿค Contributing

This project is for educational purposes. Contributions welcome!


โ ๐Ÿ“ License

Educational use only. Jumbo.com's and OpenFoodFacts' Terms of Service apply to API usage.


โ ๐Ÿ› Troubleshooting

โ Buttons Not Working
  • Hard refresh browser (Ctrl+Shift+R)
  • Check browser console for JavaScript errors
  • Verify container is running: docker ps
โ Barcode Not Found
  • Enable "OpenFoodFacts Fallback" in Settings
  • Check if product exists on OpenFoodFacts.org
  • Try searching by product name instead
โ Authentication Issues
  • Use Settings page to save credentials
  • Check credentials are correct
  • Verify cookies in /app/data/session-cookies.json
  • Check logs: docker logs jumbo-api
โ Container Won't Start
  • Check port 8000 is available
  • Verify Docker has enough resources
  • Check logs for error messages

For more help, see API_README.mdโ 

Tag summary

Content type

Image

Digest

sha256:e5dd4a491โ€ฆ

Size

424.1 MB

Last updated

8 months ago

docker pull vghoost360/jumbo