Learning & study

Build a language learning app like Duolingo

A native build brief for a bite-size language app with XP, a daily streak, hearts, spoken words and an evening reminder, with an optional friends leaderboard.

Apirex TeamUpdated AndroidiOS
On this page
  1. Screens
  2. Data model
  3. Native features
  4. Android notes (Kotlin and Jetpack Compose)
  5. iPhone notes (Swift and SwiftUI)
  6. Copy-paste prompt
  7. Acceptance test
  8. Frequently asked questions
5screens
4data tables
180word prompt
2platforms: Android, iOS

The loop that keeps people coming back to a language app is simple: a two-minute lesson, a little XP, a streak you do not want to break and a nudge in the evening. This brief rebuilds that loop as your own original app, with your own words, colours and mascot if you want one. Android comes first here because TextToSpeech, notification channels and Room cover the core loop on the phone; the iPhone version uses AVSpeechSynthesizer and needs a Mac with Xcode to build. The first proof is one finished lesson that awards XP once, keeps today's streak and speaks each word aloud.

Screens

  • Path: A vertical trail of short units, with the next lesson unlocked and finished ones ticked.
  • Lesson: Five to ten quick exercises such as pick the meaning, tap the words in order and listen and choose.
  • Results: XP earned, mistakes to retry and the streak flame for today.
  • Leaderboard: Weekly XP among friends who joined with a code, only if accounts are switched on.
  • Profile and settings: Daily goal, reminder time, sound on or off and the hearts rule.

Data model

Records behind the learning loop
TableKey fieldsPurpose
unitsid (uuid), position (int), title (text), language_pair (text)The order of the course path and which pair it teaches.
exercisesid (uuid), unit_id (uuid), kind (text), prompt (text), answer (text), choices (jsonb)Bite-size questions written or licensed by the owner, never generated silently at runtime.
lesson_runsid (uuid), unit_id (uuid), local_day (date), xp (int), mistakes (int), finished_at (timestamptz)One row per finished lesson, the source for XP totals and streak days.
hearts_stateuser_id (uuid), hearts (int), refill_at (timestamptz)Remaining mistakes allowed and when the next heart comes back.

Run the whole course on the device first: lessons ship with the app and progress lives in Room or SwiftData, so it works on a train with no signal. The leaderboard is the only part that needs a server. For that, connect your own Supabase, store only a display name and weekly XP per learner, and use row-level security so each person can write only their own row while friends in the same league can read totals. Compute weekly XP on the server from submitted lesson runs instead of trusting a number the phone sends.

Native features

Sound and timing make this kind of app feel alive. Each new word should be spoken by the phone's own speech engine in the target language, with a clear message if that voice is not installed. A single evening reminder, 9pm by default and changeable, should open straight into the next lesson. Light haptics on a correct answer are a nice touch, but the app must stay usable with sound and vibration off.

FeatureAndroid (Kotlin)iPhone (SwiftUI)Notes
Speaking wordsTextToSpeech with setLanguage and an availability checkAVSpeechSynthesizer with a matching AVSpeechSynthesisVoiceIf the language voice is missing, show the word and an install hint instead of reading it in the wrong accent.
9pm reminderAlarmManager or WorkManager plus a notification channelUNCalendarNotificationTrigger at the chosen hourSkip the reminder on days the goal is already met; never send several a day.
Streak and XPRoom queries over lesson_runs by local_daySwiftData fetch grouped by dayDerive the streak from dated runs, not from a counter that a double tap can inflate.
Answer feedbackHapticFeedback and a short SoundPool clipsensoryFeedback and a bundled soundRespect silent mode and an in-app sound switch.

Android notes (Kotlin and Jetpack Compose)

Draw the course path as a LazyColumn of unit nodes keyed by unit ID, offsetting alternate nodes left and right for the winding trail look. Hold the current exercise, chosen answer and remaining hearts in a ViewModel so a rotation mid-question never resets the lesson or grants a free heart.

  • Create one TextToSpeech instance per lesson screen, wait for onInit, check isLanguageAvailable for the target locale and call shutdown when the screen leaves composition so the engine does not leak between lessons.
  • Request POST_NOTIFICATIONS on Android 13 and later with rememberLauncherForActivityResult, then schedule the daily reminder for the chosen time. If permission is denied, keep the settings toggle honest and show the streak status inside the app instead.
  • On a real handset, finish a lesson at 11:58pm and another at 12:02am. Check that two separate local days are recorded, the streak rises by one each time, and finishing the same lesson twice in one day adds XP but not an extra streak day.

iPhone notes (Swift and SwiftUI)

A NavigationStack can lead from the path to a full-screen lesson presented with fullScreenCover, which keeps the learner focused and makes quitting an explicit choice. Store lesson runs in SwiftData and compute the streak from their saved local days.

  • Configure AVAudioSession for short spoken prompts so a word plays even when other audio is ducked. Keep a strong reference to AVSpeechSynthesizer for the life of the lesson, or speech can stop halfway.
  • Schedule the evening UNCalendarNotificationTrigger after the learner picks a time, and remove it when they turn reminders off. A tap on the notification should deep-link into the next unlocked lesson.
  • On an iPhone, run a lesson with VoiceOver on and the largest text size. Tap-to-order exercises need accessible move actions, and long phrases must wrap instead of hiding the check button.

Copy-paste prompt

Build this yourself 178 words · Android
I want my own little Spanish app that feels as addictive as the big language apps, but totally original. Build a language learning app for Android with Path, Lesson, Results, Leaderboard and Settings. Lessons are five to ten bite-size exercises (pick the meaning, put words in order, listen and choose) from a course file I supply. Give XP per lesson, a daily streak, and five hearts that drop on mistakes and refill over time; ask me the hearts rule before building it. Speak every new word with the phone's text-to-speech in Spanish and tell me if that voice is missing. Send one reminder at 9pm, which I can change, only if I have not practised yet. Save units, exercises, lesson_runs and hearts_state on the phone so it works offline. Keep the leaderboard optional: if I turn it on, use my own Supabase with row-level security and weekly XP calculated on the server. Use my own colours and icons, nothing copied from Duolingo. Acceptance: finish a lesson, hear the words, get XP once, keep today's streak after a restart.

Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.

Acceptance test

  1. Load a short supplied unit with eight exercises and confirm the path shows it unlocked and the next unit locked.
  2. Play every new word through the speaker; switch the phone to a language whose voice is missing and confirm a readable fallback.
  3. Make three mistakes, watch hearts drop to two, finish the lesson and confirm XP and the streak are recorded once.
  4. Close and reopen the app, then finish the same lesson again the same day: XP may rise, the streak day count must not.
  5. Deny notifications, set a 9pm reminder and confirm the app explains reminders are off while lessons still work.

Test the leaderboard only after the offline loop passes. With two accounts in your own Supabase, finish lessons on both phones and confirm each sees the other's weekly total but cannot edit it. Try sending an inflated XP value directly; the server should ignore it and count only recorded lesson runs. Reset the league on the agreed weekday and check that last week's ranks are kept or cleared exactly as the owner decided.

Frequently asked questions

Can I call my app something like Duolingo?

Pick your own name, mascot and colours. A similar learning loop is fine to build, but the brand, logo, owl and screens belong to their owner, so this brief keeps everything original.

Do hearts have to block learning?

That is your call. Some learners enjoy the pressure, others quit when blocked. You can refill hearts over time, let practice earn them back, or switch hearts off for kids.

How is this different from the language learning blueprint?

The language learning blueprint focuses on a licensed course, audio files and vocabulary review. This one is about the game loop: XP, streak, hearts, spoken words, an evening nudge and a friends league.

Build this blueprint

The blueprint prompt, ready for your platform. Edit anything before you send it.

AndroidKotlin · Jetpack ComposeReal source on your computer

Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.