Final project · A service with a job running behind it

Spending Wrapped

Upload a year of spending as a CSV and get a year-in-review. The upload returns straight away, and a separate worker process does the import in the background. You can kill that worker in the middle of a job and watch it recover with exactly the same result.

checking server… worker … source on GitHub ↗ README

1. Account

Every data route needs a Bearer token. Without one you get 401, and you only ever see your own imports.

Endpoints

Every error is {"error": {"code", "message", …}}. The code is stable for programs to check, and the message tells a person what to do next.

RequestSuccessErrors a caller can act on
POST /auth/signup, POST /auth/login201/200 token400 validation_failed · 409 email_taken · 401 invalid_credentials · 429 rate_limited
POST /imports (text/csv, optional Idempotency-Key)202 queued, returns at once400 csv_missing_columns · 413 too_many_rows · 415 · 422 idempotency_key_reused
GET /imports, GET /imports/:id200 progress, counts, event log401 · 404 not yours / not found
POST /imports/:id/rerun202 queued again409 import_in_progress
POST /imports/:id/crash-worker202 worker killed409 import_not_running
GET /wrapped, GET /wrapped/:year200 summaries404 no_data_for_year (lists the available years)