# Mission: Own the WSB-Backend end to end

## Why
Vivek ships features and fixes on this Supabase + Deno backend. The goal is to stop working from
pattern-matching on nearby code and instead hold a full mental model: where a request goes, why each
layer exists, and what breaks when a layer is bypassed. That turns every ticket into a targeted change
rather than an archaeology dig.

## Success looks like
- Trace any request (client, cron, webhook, trigger) through Kong, the edge runtime, RLS and back without opening files
- Explain why each shared primitive exists (`post_to_edge_function`, `validateCorsOrigin`, vault secrets, `validateServiceRole`) and predict the failure when it is skipped
- Read a migration and say what it changes in prod, what pgTAP test should guard it, and what cron/vault it touches
- Explain the Deno fundamentals the code relies on: `Deno.serve`, `Deno.env`, `jsr:`/`npm:`/`https:` imports, lockfiles, permissions, the import map in `deno.json`
- Design a new feature by choosing the right layer (DB function vs edge handler vs cron) and justify it

## Constraints
- Learn in short sessions alongside real tickets; lessons should be finishable in 15 minutes
- Prefer the repo's own code as the worked example over toy examples
- No prod DB queries during lessons; local stack only

## Out of scope
- The mobile app (React Native) internals
- Legacy Node.js test suite beyond knowing it exists and is maintenance-only
