Add YAML-based store configs with bidirectional sync
Stores can now be defined as YAML files in the stores/ directory. On startup, YAML files are synced into the database. Changes made via the admin UI are written back to YAML files automatically. - Add store-sync service (load from files, export to files, write-back) - Add /api/stores/sync and /api/stores/export endpoints - Add Sync/Export buttons to admin UI - Mount stores/ volume in Docker - Include example store config template Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
34
stores/_example-store.yaml
Normal file
34
stores/_example-store.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
# Example store configuration for Price Hunter
|
||||
# Copy this file, rename it (the filename becomes the store slug), and fill in your values.
|
||||
#
|
||||
# Required fields: name, base_url, search_url, selectors (container, name, price, link)
|
||||
# The search_url must contain {query} where the search term will be inserted.
|
||||
#
|
||||
# Tips for finding CSS selectors:
|
||||
# 1. Open the store's search results page in your browser
|
||||
# 2. Right-click a product and choose "Inspect"
|
||||
# 3. Identify the repeating container element for each product card
|
||||
# 4. Find child elements for name, price, link, and image within that container
|
||||
# 5. Use the Test page in the admin UI to verify your selectors work
|
||||
|
||||
name: Example Store
|
||||
base_url: https://www.example-store.com
|
||||
search_url: https://www.example-store.com/search?q={query}
|
||||
category: Electronics
|
||||
currency: EUR
|
||||
enabled: false
|
||||
|
||||
selectors:
|
||||
container: ".product-card"
|
||||
name: ".product-title"
|
||||
price: ".product-price"
|
||||
link: "a.product-link"
|
||||
image: "img.product-image"
|
||||
|
||||
# Optional settings:
|
||||
# rate_limit: 2 # Max requests per second (default: 2)
|
||||
# rate_window: 1000 # Rate limit window in ms (default: 1000)
|
||||
# user_agent: "Custom UA" # Override the default browser user agent
|
||||
# proxy_url: "http://user:pass@proxy:8080" # Route requests through a proxy
|
||||
# headers: # Extra HTTP headers
|
||||
# X-Custom-Header: "value"
|
||||
Reference in New Issue
Block a user