Files
LudosData/.env.example
ckochandClaude Opus 5 8e136f42f8 Add CSV price guides and PriceCharting alongside eBay
An eBay production keyset needs account verification, which leaves pricing
blocked on someone else's review queue. These are two routes that are not.

CSV price guide, POST /api/prices/import: no account, works immediately.
Column names are matched by alias, so a PriceCharting bulk export
(product-name / console-name / loose-price) and a hand-kept
title,system,loose,cib,new sheet both parse, along with currency symbols,
thousands separators and blank cells. Rows match on title + system, so the
same game on two consoles is priced separately, and rows for games not in
the library are reported rather than silently added.

PriceCharting adapter: paid, but access is immediate with no review, and it
quotes the same three tiers this app stores, so no inference is needed.
Their API docs are not reachable without an account, so the parser follows
the widely-used convention — integer pennies under hyphenated keys — and is
tolerant enough that a naming difference degrades to "no price" instead of
throwing. One method to adjust if it differs.

Providers are now a registry rather than a single service. /api/prices/status
lists each one with what it is configured for, what its numbers actually
mean, and how to enable it; refresh takes an optional provider name and
falls back to the first configured one. With none configured it answers 503
pointing at the CSV route.

Checked against the real library: a five-row guide in PriceCharting's own
column names priced four games and reported the fifth as not owned, with
each effective value following that copy's condition. Demo figures were
cleared afterwards.

135 backend tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 16:46:10 -04:00

67 lines
2.8 KiB
Bash

# Copy to .env and fill in. .env is gitignored — never commit real secrets.
#
# The 2018 version of this project committed its live database password to the
# repository, which is why it now has to be treated as compromised. Keep secrets
# in .env, and keep .env out of git.
# --- Required --------------------------------------------------------------
# JWT signing key. Minimum 32 characters; the API refuses to start without it.
# Generate one with: openssl rand -base64 48
JWT_KEY=
# --- First-run seeding ------------------------------------------------------
# On a database with no users, the API creates this account and imports the 105
# games recovered from the 2018 MySQL dump. Once a user exists, this is ignored.
# Password rules: 12+ chars, upper, lower and a digit.
SEED_USERNAME=ckoch
SEED_EMAIL=you@example.com
SEED_PASSWORD=
# Set to false once you are past first run, or to start with an empty library.
SEED_ENABLED=true
# --- Optional ---------------------------------------------------------------
# Host port the web UI is published on.
WEB_PORT=8080
# Token lifetime in minutes. Default is 12 hours; there is no refresh flow, so
# expiry returns you to the login form.
JWT_LIFETIME_MINUTES=720
JWT_ISSUER=LudosData
JWT_AUDIENCE=LudosData
CORS_ORIGIN=http://localhost:8080
# --- Market value (optional) ------------------------------------------------
# Three routes, none of which block the others. Nothing here is required: with
# all of it blank, prices can still be imported as a CSV or typed in by hand.
#
# 1. CSV PRICE GUIDE — no account, works immediately.
# POST a CSV to /api/prices/import. Columns are matched by name, so a
# PriceCharting bulk download, a spreadsheet you maintain, or any other list
# all work. Nothing to configure here.
#
# 2. PRICECHARTING — paid, but access is immediate with no review, which makes
# it the practical choice while an eBay keyset is in verification. Token
# comes from the Subscriptions page, "API/Download" button.
PRICECHARTING_TOKEN=
# 3. EBAY BROWSE — free, but the production keyset needs account verification.
#
# 1. Register at https://developer.ebay.com and create a developer account
# 2. Create an application keyset (Application Keys -> Production)
# 3. Copy the App ID (Client ID) and Cert ID (Client Secret) below
#
# Leave these blank and the pricing endpoints report 503 with an explanation;
# nothing else is affected.
#
# IMPORTANT: Browse returns ACTIVE LISTINGS, which are asking prices, not
# completed sales. eBay's sold-price data lives behind the Marketplace Insights
# API, which is a limited release not open to new developers. Expect these
# figures to read high — they are an upper bound, not a valuation.
EBAY_CLIENT_ID=
EBAY_CLIENT_SECRET=
# Set true to use eBay's sandbox while checking credentials.
EBAY_USE_SANDBOX=false