On this page
Everyone has stared at a good photo for ten minutes because the caption would not come. This brief describes a small app that lets you pick one picture, choose a vibe such as funny, aesthetic, short or wholesome, and get three caption options back. The picture is resized on the phone and sent, with the chosen vibe, to a vision-capable model through an edge function in the owner’s own Supabase project. Android is the suggested first target because the share sheet from the gallery is the natural entry point; the iPhone version is equally reasonable and needs a Mac with Xcode to build. The first release proves one loop: share a photo in, pick a caption, copy it, and find it again in History.
Screens
- Pick: Choose a photo with the system picker or receive one shared from the gallery.
- Vibe: Select a tone, optional hashtags on or off, and a length limit before sending.
- Results: Three caption cards with Copy, Share and Try again for a fresh set.
- History: Past captions with a small thumbnail stored only on the phone.
- Settings: Default vibe, banned words and a plain explanation of what gets uploaded.
Data model
| Table | Key fields | Purpose |
|---|---|---|
| requests | id (uuid), vibe (text), hashtags (bool), created_at (timestamptz), status (text) | One row per model call, so retries and failures are visible. |
| captions | id (uuid), request_id (uuid), text (text), copied_at (timestamptz nullable) | The options returned for a request and which one the user actually used. |
| thumbnails | request_id (uuid), local_path (text) | A small local preview for History; never uploaded or synced. |
Everything except the model call stays on the device. The edge function receives a downscaled JPEG and the vibe settings, forwards them to the model provider with a key kept as a function secret, and returns plain text. It should not store the image. Location and other EXIF metadata must be stripped on the phone before upload. If the owner wants caption history across devices, connect your own Supabase and keep history rows private with row-level security; even then, the photos themselves do not need to leave the phone.
Native features
The app should feel like part of the camera roll: arrive from the share sheet, leave through the share sheet. The system photo picker gives access to the single chosen image without asking for the whole gallery.
| Feature | Android (Kotlin) | iPhone (SwiftUI) | Notes |
|---|---|---|---|
| Choose one photo | Photo Picker (PickVisualMedia), no storage permission | PhotosPicker from PhotosUI | Only the selected image is readable by the app. |
| Receive from gallery | ACTION_SEND intent filter for image/* | Share extension target | Open straight onto the Vibe screen with the photo already loaded. |
| Copy and share | ClipboardManager plus ACTION_SEND text | UIPasteboard plus ShareLink | Copying marks that caption as used in History. |
Android notes (Kotlin and Jetpack Compose)
Decode the picked Uri with ImageDecoder at a target size around 1024 pixels on the long edge, re-encode to JPEG without EXIF, and post it as base64 or multipart to the edge function. Hold the request state in a ViewModel so leaving for Instagram and coming back does not fire a second paid request.
- Show vibes as Material 3 FilterChips and the results as cards in a LazyColumn. Each card gets a Copy button that confirms with a short snackbar instead of a toast that disappears behind the keyboard.
- Save requests and captions in Room; store the thumbnail in app-private files and delete it when the History row is deleted.
- On an Android phone, share a photo from Google Photos into the app, rotate during generation, and confirm only one request row is created. Copy a caption, paste it into a notes app and check the text is identical.
iPhone notes (Swift and SwiftUI)
Load the chosen PhotosPickerItem as Data, create a UIImage, scale it down and produce JPEG data with no metadata before calling the function with URLSession and async/await. Present Results in a List so long captions wrap cleanly at large Dynamic Type sizes.
- Use ShareLink for sending a caption onward and UIPasteboard for Copy; add a light haptic on copy so the action feels finished.
- Persist requests and captions with SwiftData, and keep thumbnails in the app container rather than inside the database.
- Test the share extension on a physical iPhone from the Photos app. Turn off the network during generation and confirm the request is marked failed with a Try again button, not left spinning.
Copy-paste prompt
I post a photo and then spend ten minutes on the caption. Build me a caption app for Android: I pick one photo (or share it from my gallery), choose a vibe like funny, aesthetic, short or wholesome, and get three caption options I can copy or share. Screens: Pick, Vibe, Results, History, Settings. Use the system photo picker, not full gallery access. Resize the photo on the phone, remove location and other metadata, and send it with the vibe to a vision model through an edge function in my own Supabase project that holds the API key as a secret. No key in the app, and the function should not store my photo. Save history locally with a small thumbnail. Add Try again for a fresh set and a banned-words list in Settings. Handle no connection, a slow or refused model call, an unsupported image and an empty history. Ask me which model to use and whether hashtags are on by default.
Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.
Acceptance test
- Pick a real photo, choose Funny and confirm three distinct captions appear with Copy and Share on each.
- Inspect the request in the edge function logs and confirm the image is downscaled and carries no GPS metadata.
- Copy one caption, paste it elsewhere, and confirm History marks that option as used.
- Add a banned word in Settings, generate again and confirm the app filters or flags any option containing it.
- Go offline, try a new photo and confirm a clear failure state with Try again, while History still opens.
Delete a History item and verify both its caption rows and its thumbnail file are removed. Then pick a very large panorama and a screenshot with text in it; the app should still resize and send them, or explain why an image is unsupported, rather than crashing or silently sending the original full-resolution file.
Frequently asked questions
Is my photo uploaded?
A resized copy without metadata goes to your own edge function and on to the model for that one request. The function is told not to keep it, and the original photo stays in your gallery.
Can it write captions in Hindi or Spanish?
Add a language option to the Vibe screen and pass it to the function. Check the results yourself, because caption quality varies by model and language.
Will it post to Instagram for me?
No. It hands the caption to the share sheet or clipboard, and you post it yourself. Direct posting would need each platform’s own approval and is outside this brief.
Build this blueprint
The blueprint prompt, ready for your platform. Edit anything before you send it.
Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.