A price tracker built with Spring Boot and PostgreSQL. It runs on a schedule via GitHub Actions, fetches prices from retailer APIs, stores history in Supabase, and sends a summary to Discord.
GitHub Actions (cron: daily)
│
▼
Spring Boot App (CommandLineRunner)
│
├── Reads active products from Supabase (PostgreSQL)
├── Looks up domain config (API URL, SKU regex, price field)
├── Fetches price from retailer's internal JSON API
├── Saves price snapshot to price_records table
└── Posts summary to Discord webhook
| Layer | Technology |
|---|---|
| App | Spring Boot 4.1 (Java 21) |
| Database | Supabase (free hosted PostgreSQL) |
| Price fetching | Java HttpClient + Jackson (JSON parsing) |
| Notifications | Discord webhook |
| Automation | GitHub Actions |
| Build tool | Maven |
The configurable watch list. Add a row to start tracking a product, set active = false to pause it without losing history.
| Column | Type | Description |
|---|---|---|
id |
bigserial | Primary key |
name |
text | Human-friendly label (e.g. "Sony WH-1000XM6") |
url |
varchar | Product page URL |
active |
boolean | Whether to scrape on each run |
created_at |
timestamptz | When it was added |
Tells the scraper how to fetch a price for any product from a given domain. One row per retailer.
| Column | Type | Description |
|---|---|---|
id |
bigserial | Primary key |
domain |
text | Bare hostname (e.g. www.bestbuy.ca) |
api_url_template |
varchar | API endpoint with {sku} placeholder |
sku_regex |
varchar | Regex with one capture group to extract the product ID from the URL |
price_field |
varchar | JSON key that holds the price (e.g. salePrice) |
created_at |
timestamptz | When it was added |
One row per price check — the full history.
| Column | Type | Description |
|---|---|---|
id |
bigserial | Primary key |
product_id |
bigint | FK → products |
price |
numeric(12,2) | Price at time of scrape |
currency |
varchar | Currency code (e.g. CAD) |
scraped_at |
timestamptz | When the price was recorded |
- Java 21 (Temurin)
- Maven (
brew install mavenon Mac) psql(brew install libpqon Mac)- A free Supabase account
- A Discord server with a webhook URL
git clone https://github.com/YOUR_USERNAME/bitdotfree.git
cd bitdotfree- Go to supabase.com and create a new project
- Under Connect, grab the Session pooler connection string (not Direct — it is IPv6 only and will not work in GitHub Actions)
- Disable the Data API in project settings (not needed — the app connects via JDBC directly)
DB_URL=jdbc:postgresql://aws-x-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require
DB_USERNAME=postgres.yourprojectref
DB_PASSWORD=your-supabase-password
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...Creates the schema in your Supabase database:
./scripts/db/migrate.shTells the scraper how to fetch prices from a retailer. Example for Best Buy CA:
./scripts/domains/add.sh \
"www.bestbuy.ca" \
"https://www.bestbuy.ca/api/offers/v1/products/{sku}/offers" \
"/([0-9]+)$" \
"salePrice"./scripts/products/add.sh \
"Sony WH-1000XM6" \
"https://www.bestbuy.ca/en-ca/product/sony-wh-1000xm6/.../19320383"./scripts/run-local.shThe workflow in .github/workflows/scrape.yml runs daily.
Go to your repo → Settings → Secrets and variables → Actions → New repository secret.
Add the same four variables from your .env:
DB_URLDB_USERNAMEDB_PASSWORDDISCORD_WEBHOOK_URL
Go to Actions → Price Tracker → Run workflow to trigger a run on demand.
All scripts load .env automatically.
| Script | Usage | Description |
|---|---|---|
run-local.sh |
./scripts/run-local.sh |
Boot the app locally |
products/add.sh |
./scripts/products/add.sh <name> <url> |
Add a product to the watch list |
products/remove.sh |
./scripts/products/remove.sh <id> |
Deactivate a product (preserves history) |
products/list.sh |
./scripts/products/list.sh |
List all products with latest price |
domains/add.sh |
./scripts/domains/add.sh <domain> <api-url> <sku-regex> <price-field> |
Add or update a domain config |
db/migrate.sh |
./scripts/db/migrate.sh |
Run pending SQL migrations |
- Open DevTools → Network tab → reload the product page and filter for JSON requests to find the retailer's internal price API
- Identify the JSON field that holds the price
- Write a regex that captures the product ID from the product page URL
- Add the domain config and then add products from that domain:
./scripts/domains/add.sh "<domain>" "<api-url-with-{sku}>" "<sku-regex>" "<price-field>"
./scripts/products/add.sh "<name>" "<product-url>"