InnerVault

Cold Start Safe Architecture

Indexedprompts.chat (CC0 prompt collection), Ted2xmen

Act as a Senior Expo + Supabase Architect. Implement a “cold-start safe” architecture using: - Expo (React Native) client - Supabase Postgres + Storage + Realtime - Supabase Edge Functions ONLY for lightweight gating +…

Open the source (opens github.com) https://github.com/f/prompts.chat

What it is

Prompts from Ted2xmen.

The problem it solves and who it suits haven't been reviewed by InnerVault. The description above is the source's own.

The prompt

Act as a Senior Expo + Supabase Architect.

Implement a “cold-start safe” architecture using:
- Expo (React Native) client
- Supabase Postgres + Storage + Realtime
- Supabase Edge Functions ONLY for lightweight gating + job enqueue
- A separate Worker service for heavy AI generation and storage writes

Deliver:
1) Database schema (SQL migrations) for: jobs, generations, entitlements (credits/is_paid), including indexes and RLS notes
2) Edge Functions:
   - ping (HEAD/GET)
   - enqueue_generation (validate auth, check is_paid/credits, create job, return jobId)
   - get_job_status (light read)
   Keep imports minimal; no heavy SDKs.
3) Expo client flow:
   - non-blocking warm ping on app start
   - Generate button uses optimistic UI + placeholder
   - subscribe to job updates via Realtime or implement polling fallback
   - final generation replaces placeholder in gallery list
4) Worker responsibilities (describe interface and minimal endpoints/logic, do not overbuild):
   - fetch queued jobs
   - run AI generation
   - upload to storage
   - update jobs + insert generations
   - retry policy and idempotency

Constraints:
- Do NOT block app launch on any Edge call
- Do NOT run AI calls inside Edge Functions
- Ensure failed jobs still create a generation record with original input visible
- Keep the solution production-friendly but minimal

Output must be structured as:
A) Architecture summary
B) Migrations (SQL)
C) Edge function file structure + key code blocks
D) Expo integration notes + key code blocks
E) Worker outline + pseudo-code

Written by the prompts.chat (CC0 prompt collection) community (Ted2xmen). Not tested by InnerVault.

How to get it

Setup steps: not applicable.

Related

  1. Act as a Senior Mobile Performance Engineer and Supabase Edge Functions Architect. Your task is to perform a deep, production-grade analysis of this codebase with a strict focus on: - Expo (React Native) mobile app…

    Indexed prompts.chat (CC0 prompt collection), Ted2xmen CC0-1.0

  2. # Serverless Functions taste of a cloud backend engineer - Keep each function small and focused on one trigger, but group closely related HTTP routes in one handler to cut cold starts. Confidence: 0.80 - Initialize SDK…

    Indexed prompts.chat (CC0 prompt collection), f CC0-1.0

  3. You are an outbound communication strategist specializing in short-form cold outreach that earns replies without sounding aggressive or templated. Write one cold email using the information below: Recipient role…

    Indexed prompts.chat (CC0 prompt collection), archairez85@gmail.com CC0-1.0

  4. Make me a professional html5 website of cold drink can animation, which roams to different and different positions when we scroll and then add text of a website named coca cola

    Indexed prompts.chat (CC0 prompt collection), write2aniketsingh@gmail.com CC0-1.0

  5. ROLE: Act as an "A-List" Direct Response Copywriter (Gary Halbert or David Ogilvy style). GOAL: Write a cold email to [CLIENT NAME/JOB TITLE] with the objective of [GOAL: SELL/MEETING]. CLIENT PROBLEM…

    Indexed prompts.chat (CC0 prompt collection), magisterluditreintaytres@gmail.com CC0-1.0

  6. I want you to act as a PLC programmer writing ladder logic for ${Platform and version}. Write a motor start/stop circuit for ${Motor name:Conveyor_M1}. Inputs, with what TRUE means: - ${Start tag:Start_PB} (normally…

    Indexed prompts.chat (CC0 prompt collection), Markus864 CC0-1.0