On this page
This brief is for a student who has thirty pages of biology notes and four days until the exam. The app takes a chunk of notes, sends that text to a language model through the owner’s own backend function, and returns draft question-and-answer cards that the student edits before anything joins a deck. Android is the natural first build because a share-to-app action from any notes app is easy to wire; an iPhone version works just as well but needs a Mac with Xcode. The first proof is narrow: paste one page, receive drafts, accept five cards, and see them come back in tomorrow’s review queue.
Screens
- Decks: Subjects with due-card counts and the date of the last study session.
- Add notes: Paste text, import a shared snippet or capture a page with the camera for on-device text recognition.
- Draft review: Accept, edit or discard each generated card before it is saved to a deck.
- Study: Flip a card, grade it Again, Hard or Easy, and move to the next due card.
- Settings: Daily card limit, review reminder time and a clear note of what text leaves the phone.
Data model
| Table | Key fields | Purpose |
|---|---|---|
| decks | id (uuid), name (text), created_at (timestamptz) | Group cards by subject or exam. |
| note_sources | id (uuid), deck_id (uuid), text (text), sent_at (timestamptz nullable) | Keep the exact text the student chose to send, so a draft can be traced to its source. |
| cards | id (uuid), deck_id (uuid), front (text), back (text), origin (text: ai_draft_edited or manual) | Only accepted cards live here; rejected drafts are never stored as study material. |
| reviews | id (uuid), card_id (uuid), grade (text), reviewed_at (timestamptz), next_due (date) | Drive the spaced schedule from real answers instead of a counter. |
Decks, cards and reviews can stay on the device in Room or SwiftData. The model call is the one network step: the app posts the selected note text to an edge function in the student’s own Supabase project, and that function holds the model provider key as a secret. No key is compiled into the app. If the owner later wants decks on several devices, connect your own Supabase for storage too and protect decks, cards and reviews with row-level security keyed to the signed-in user. The draft screen must say plainly that a generated card can be wrong and that the student is the editor.
Native features
The interesting native parts are getting notes in quickly and bringing the learner back each evening. Text recognition from a photographed page runs on the phone, so only the recognized text, not the photo, is offered for sending, and the student sees that text before tapping Generate.
| Feature | Android (Kotlin) | iPhone (SwiftUI) | Notes |
|---|---|---|---|
| Notes from a photo | CameraX plus ML Kit on-device text recognition | VisionKit document camera plus Vision text recognition | Show the recognized text for editing; the camera image is discarded unless the student saves it. |
| Share notes into the app | ACTION_SEND intent filter for plain text | Share extension or paste from the clipboard | A shared snippet lands in Add notes, never straight into the model call. |
| Evening review nudge | NotificationManager with a user-chosen time | UserNotifications calendar trigger | The reminder opens the due queue and says how many cards are waiting. |
Android notes (Kotlin and Jetpack Compose)
Render drafts in a LazyColumn keyed by a temporary draft ID, each row with inline edit fields and Accept and Discard buttons. Keep pending drafts in the ViewModel and a Room table of their own so rotating the phone or switching apps mid-review does not throw away a batch the student paid credits and time to generate.
- Call the edge function with Ktor or Retrofit from a repository, with a timeout, a cancel button and a readable error for no connection or a refused request. Never retry automatically in a loop; one tap means one model call.
- Schedule the next due date with a small SM-2 style rule in Kotlin and store it on each review row. The Study screen queries cards whose next_due is today or earlier, ordered by how overdue they are.
- On an Android phone, photograph a printed page, correct one misread word, generate drafts, accept three and discard two. Force-stop the app and confirm only the three accepted cards exist and the two discarded drafts are gone.
iPhone notes (Swift and SwiftUI)
Use a NavigationStack from Decks to a deck detail, with Add notes presented as a sheet. The Draft review view can be a List with editable TextField rows and swipe actions for discard, so a long answer grows with Dynamic Type instead of being clipped.
- Run the network request with async/await and URLSession against the same edge function. Show a ProgressView with Cancel, and keep the original note text on screen while waiting so the student can compare drafts against the source.
- Model cards and reviews in SwiftData with a relationship from card to its reviews. Compute the due queue with a fetch descriptor filtered on next_due, not by scanning every card on launch.
- The iOS Simulator has no camera, so test the photo path on a physical iPhone. Turn on airplane mode, tap Generate and confirm the app explains the failure while existing decks remain fully studyable offline.
Copy-paste prompt
I have a bio exam on Friday and 30 pages of messy notes. Build me a study buddy app for Android that turns my notes into flashcards and quizzes me every evening. Screens: Decks, Add notes, Draft review, Study, Settings. I can paste text, share text from another app or photograph a page; text recognition runs on the phone and I can fix the recognized text before sending. Send only that text to a model through an edge function in my own Supabase project that keeps the API key as a secret; never put a key in the app. Show the drafted question and answer cards so I can accept, edit or discard each one. Save decks, cards and reviews locally first, and schedule reviews with a simple spaced-repetition rule (Again, Hard, Easy). Add an evening reminder at a time I pick. Handle no connection, a refused or slow model call, camera permission denied and an empty deck. Ask me which model and daily card limit to use before you start.
Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.
Acceptance test
- Paste one page of real class notes, tap Generate and confirm the request shows a progress state with a working Cancel.
- Edit one drafted answer, accept four cards and discard the rest; check the deck count is exactly four.
- Study all four, grading one Again, and confirm that card reappears in the same session while Easy cards move to a later date.
- Reopen the app the next day (or change the device date) and verify the due queue matches the saved review dates.
- Disconnect the network, try to generate again, and confirm a clear error while studying existing cards still works.
Inspect the edge function logs in the owner’s Supabase project after a generation: the request should contain only the note text the student approved, and the response should never be written into cards until the student accepts it. Delete a deck and confirm its note sources go with it, so old notes are not quietly kept around after the student decided to remove them.
Frequently asked questions
Can the generated cards be trusted for an exam?
Treat them as drafts. A model can misread a diagram label or invent a detail, which is why every card passes through Draft review and the student edits or rejects it before studying.
Where does my API key go?
Into a secret on an edge function in your own Supabase project. The app calls that function, and the function calls the model, so the key is never shipped inside the installed app.
Does studying need the internet?
No. Only generating new drafts makes a network call. Accepted cards, the review schedule and reminders all work from local storage.
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.