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
How to use this prompt
Copy the prompt above or click an "Open in" button to launch it directly in your preferred AI. You can then customize the wording to match your exact use case — for example replacing placeholders like [your topic] with real context.
Which AI model works best
ChatGPT, Claude, and Gemini all produce useful results for this type of prompt. Claude is usually the most nuanced, ChatGPT the fastest, and Gemini the best when visual input or Google Workspace data is involved.
How to customize this prompt
Adapt the prompt to your specific use case. Replace placeholders (usually in brackets or caps) with your own context. The more detail you provide, the more precise the response.
Common use cases
- Use directly in ChatGPT, Claude, or Gemini
- Adapt to your specific project or industry
- Use as a starting point for your own custom prompt
- Compare across models to find the best fit for your case
- Share with your team as a standard workflow
Variations
Adapt the tone (more casual, more technical), change the output format (bullet points vs. paragraphs), or add constraints (word limits, target audience).
Related prompts