Starter monorepo for an Osta.ee auction monitoring tool with a persistent-session personal-bids workflow, background public-ingestion pipeline, FastAPI backend, worker jobs, PostgreSQL persistence, and a Next.js dashboard.
apps/api: FastAPI app and API routesapps/web: Next.js dashboardapps/worker: APScheduler worker entrypoint and jobspackages/core: shared config, database, models, repositories, schemaspackages/osta_public: public Osta API clientpackages/osta_account: Playwright account-monitor skeletonpackages/alerts: Discord and optional event-sink alertspackages/reports: digest/report generation helpersalembic: database migrations
- Copy
.env.exampleto.env. - Start the stack:
docker compose up --build - Run migrations inside the API container:
docker compose exec api alembic upgrade head - Open:
- API docs:
http://localhost:8000/docs - Web UI:
http://localhost:3000
- API docs:
- The main dashboard centers on auctions you have personally bid on.
- Personal bid refreshes reuse a durable Playwright browser profile instead of attempting a fresh login on every run.
- You can also bring your own authenticated Osta session material through uploaded storage state or cookies.
- Public feed polling still runs in the background for analytics and digests, but it is hidden from the main dashboard and exposed only in admin views.
- Set
ENABLE_ACCOUNT_MONITOR=truein.env. - Start the stack with
docker compose up --build. - Trigger setup with
POST /admin/account-session/setup. - Complete any Cloudflare check and Osta login manually in the headed Chromium session.
- When authenticated state is detected, the browser profile is saved under
OSTA_ACCOUNT_PROFILE_DIR.
- Check session health with
GET /admin/account-session/status - Refresh personal bids with
POST /admin/refresh-my-bids - If the session expires or is blocked, the API returns
reauth_requiredand the dashboard shows a reconnect action instead of crashing
- Supported auth modes:
managed_loginstorage_state_uploadcookie_json_uploadcookie_header_upload
- Full storage state is preferred over raw cookies because it carries more browser session context.
- Secret session material is encrypted on disk under
OSTA_ACCOUNT_SECRET_DIRand is never returned by the API. - Admin endpoints:
POST /admin/account-session/upload-storage-statePOST /admin/account-session/upload-cookiesGET /admin/account-session/statusDELETE /admin/account-session
- The dashboard includes a session-management card where you can pick an auth mode, paste or upload the material, validate it, and delete it later.
- The shared Python image used by
apiandworkernow installs Playwright Chromium duringdocker compose build - No manual
playwright installstep is required inside the containers after rebuild - If Playwright dependencies change, rebuild the Python image with
docker compose build api worker
- Run inside the API container:
docker compose exec api python packages/osta_account/scripts/osta_login_debug.py - Output is written under
artifacts/osta_account/login_debug/<timestamp>/ - Optional env overrides:
OSTA_LOGIN_DEBUG_URLOSTA_LOGIN_DEBUG_DIROSTA_LOGIN_DEBUG_HEADLESS
- The
webservice runs from/app/apps/web - Dev server command:
npm run dev -- --hostname 0.0.0.0 --port 3000 - Start only the frontend if needed:
docker compose up --build web
- Create a Python 3.11 virtualenv.
- Install backend deps:
pip install -e . - Export
PYTHONPATHto include:apps/api/srcapps/worker/srcpackages/core/srcpackages/osta_public/srcpackages/osta_account/srcpackages/alerts/srcpackages/reports/src
- Run migrations:
alembic upgrade head - Start the API:
uvicorn api.main:app --reload - Start the worker:
python -m worker.main
cd apps/webnpm installnpm run dev -- --hostname 0.0.0.0 --port 3000- Open
http://localhost:3000
- Public API ingestion stays separate from account automation.
- Public integration uses only:
GET /api/items/activeGET /api/items/active/{itemId}
- Webpush endpoints are intentionally excluded from the main alerting design.
- Bid execution is protected by a feature flag and dry-run mode.
- Poll public active listings and upsert item state
- Store item snapshots over time
- Track categories and saved filters
- Persistent-session Playwright account monitor for personal bid extraction
- Generate Discord-ready daily digests
- Expose health and admin-style API endpoints for the UI
- Main dashboard now centers on personal bid items instead of the public feed
- Refresh path:
POST /admin/refresh-my-bids - Session setup path:
POST /admin/account-session/setup - Session status path:
GET /admin/account-session/status - Public feed remains available only in the admin route and currently polls page 1 only
- Replace response-field assumptions in the public client if the live payload differs
- Add real filter evaluation and alert deduplication rules per team preference
- Tighten account-page selectors once authenticated discovery artifacts are reviewed