Samajh stops being a prototype — real accounts, real storage, real billing
summit is A parent signs in with Google on their own phone, their child works a problem with Jugnu, the app is closed; the next day that chat is still in the notebook, and a Jugnu Plus subscriber's token balance has visibly gone down
6 done · 7 steps
- Storage is live on Cloudflare D1. The hosted database exists, the schema is applied to it, and rows are written and read back from the deployed site — a real parent row landed and was queried back, which is exactly what this task set out to prove. The Postgres path stays as local development; production is D1 and the handlers cannot tell the difference.
- Sign in with Google works end to end on the deployed site: the OAuth code flow, the ID token verified against Google's own JWKS, PKCE, and an httpOnly session that keeps while it is used and signs out after thirty minutes idle. A real Google account reached an authenticated session and its parent row exists. Apple is deferred by choice — its button stays hidden until its four secrets are set — and is not a blocker.
- Identity: the provider subject is the key, never the email, and the access and refresh tokens are deliberately dropped
- Children, sessions, quizzes and now the chat itself are in the database, every route resolved through the signed-in parent. chat_turn is written for the first time: the transcript is sealed with AES-256-GCM before it is stored, a fresh IV per turn, and deleting a child takes the turns with it — verified as ciphertext in the column and readable again on the way out
- Every stored session carries the Jugnu version and the UI version that produced it. The earlier sessions show empty because they were saved while the engine was down, and an engine that is not live deliberately stamps nothing rather than guessing — an assumed version would be believed by the curve
- Documents and avatars are stored per child in the database, consent-gated: a photo is refused without consent and the bytes are deleted when consent is withdrawn. No R2 bucket, and none needed on the D1 path
- REMAINING — Jugnu Plus, the dream's third pillar, real billing, is not built. Server-side debit is live and proved against a real balance — the engine charges the account ledger for every reply and quiz, idempotent on ref — but nothing credits it: Apple IAP is cancelled (this is a web page) and the card payment that would replace it is unwritten, so there is still no way to subscribe. This is the one thing between a live app and the dream being reached.