Recurse · learning app · web and Android · TypeScript
Building Recurse, an app for learning Rust and computer science in a few minutes a day
Recurse teaches computer science in short daily lessons, a few minutes at a time, on your phone. I built all of it alone: the product idea, the design, the lessons, the website, the Android app and the marketing. It has five courses, from Rust to running AI models in production, and 3,281 questions. This page covers why each part works the way it does, and what broke along the way.
Role
Built it alone: product, design, code, marketing
Learners
100+ active
Courses
5, with 3,281 questions
Stack
Next.js, Hono, Expo, Postgres
What's in Recurse
Recurse runs on the web and as an Android app, which is in testing on Google Play.
Part
What's in it
Courses
Rust, operating systems, system design, data-intensive systems, and inference engineering, which is about running AI models in production. 126 units in all.
Lessons
Three to five minutes each, and every answer is a tap, so they work on a phone. A few short teaching cards come first, then questions of eight kinds: will it compile, what does it print, find the bug, put the lines in order, and more.
Practice
Mistakes come back on a review schedule. There's also a daily question, a 60-second speed round and a 10-minute interview mode.
Habit
Streaks with freezes, daily quests, a daily gift, gems and a shop, and rewards all the way to a 365-day streak.
Friends
Weekly leagues, friends, 1-on-1 races and streak buddies.
Android app
Home screen widgets, reminders, lessons that survive a bad network, and Google sign-in inside the app.
Who Recurse is for, and why lessons fit on a phone
The people I had in mind already write code, or are studying to. More and more of their code is written by AI. What they're missing is the layer underneath: why the borrow checker refuses a program, why two threads race, why a database query crawls. Someone on every team has to understand that, and interviews still test it.
They don't have an hour a day for a textbook. They have a few minutes in a queue or on the ride home, usually on a phone. Most decisions in the app follow from that: a lesson fits in five minutes, every answer is a tap, and code in a question is never longer than 12 lines, so it fits on the screen.
Before building anything I wrote down five rules, and I checked new features against them: small and daily beats long and rare; every code claim must be true; feedback should teach, whether you're right or wrong; rewards should mark real progress, not empty clicks; and a lesson has to respect the learner's time.
What I learned from studying how Duolingo builds a lesson
Before writing any code, I studied how Duolingo's web app builds a lesson. I recorded what it sends and receives while you learn, and wrote up how its lessons are put together: how many questions there are, how it picks them, and what happens to a wrong answer.
Then I went through it one piece at a time and decided what to keep and what to change. I kept the learning loop and made the look my own: the mascot is a capybara called Kapi, and none of Duolingo's brand, colours or art is used.
What Duolingo does
What I did
A lesson is about 17 questions
12 to 15 shorter ones, so a lesson fits in five minutes.
It picks questions you'll get right about 9 times in 10
The same idea: hard enough to teach you something, easy enough that you keep going.
Wrong answers come back at the end of the lesson
Kept exactly, and they come back again later on a review schedule.
Around 60 kinds of exercise
8 kinds made for code, like 'will it compile' and 'put the lines in order'.
Hearts that stop a lesson after too many mistakes
Left out of lessons. Getting things wrong is part of learning here. Only the skip-ahead tests use hearts.
Onboarding, and why each setup step is there
Setup takes under a minute, and every step earns its place.
Step
Why it's there
Pick your first course
Five big coloured tiles and one tap. Choosing makes the course feel like yours from the start.
How well do you know it?
A beginner starts at lesson one. Someone who knows a bit takes a short test and skips ahead, so they aren't bored on day one.
Your daily goal
Five to twenty minutes. The smallest one is marked as the best start, because a goal you can keep beats a big one you drop.
When will you learn?
Picking a set time is what turns something into a habit. That hour becomes the reminder.
The reminder ask
Before Android asks for permission, Kapi explains it in plain words: one nudge a day, only when your streak needs it. People say yes more easily when they know what they're agreeing to.
How did you find us?
One tap, or skip it. It tells me which of my marketing actually brings people in.
Your plan, and "I'm in"
The plan repeats what they chose: Rust, 10 minutes a day, 7 PM. Pressing "I'm in" is a small promise to themselves, and the first lesson starts straight away.
How a lesson works: teach first, then ask
A lesson teaches first and asks after. Each detail below is there to keep someone learning for the next five minutes.
Detail
Why
Teaching cards before questions
You see one idea and a tiny example before you're tested on it.
Watch the code run
Some cards step through the code a line at a time and show what's in memory. That's how you start to picture a program running, which reading alone doesn't give you.
A hint instead of a fail
A wrong answer on a teaching card gives a hint and lets you try again, because you're still learning the idea.
Every answer is explained
Right or wrong, a sentence or two says why.
Wrong answers come back
Anything you get wrong comes back at the end of the lesson, and again later on a review schedule.
Continue sits where Check was
You tap the same spot twice to check and move on, so your thumb never has to travel.
The end screen gives a reason to return
It shows the XP, the streak, the daily goal, and tomorrow's reward.
Five courses: Rust, operating systems, system design, databases and AI inference
Every course follows the same rules, and each explains its ideas through something everyday. Inference engineering starts with a chef: training a model is learning to cook once, and inference is cooking every night from what you know. Operating systems asks how many processes there are when you open the same notes app twice. System design starts with your browser asking a server for a page.
Gamification without dark patterns: streaks, leagues and rewards
Rewards are how an app like this keeps people coming back, so I used the techniques that are known to work. I set one rule first: nothing fake. No fake timers or numbers, no guilt trips, no hidden unsubscribe link, and no boxes ticked for you.
Technique
How it shows up in the app
Show how close the next reward is
"5 XP to your daily goal", "3 to go" on a unit, and one "Next:" line on the end screen. A goal feels worth finishing when you can see how near it is.
Streaks you can save
Streak freezes, and if you miss exactly one day, two lessons the next day win the streak back. Losing a long streak to one bad day is when people quit.
Small surprises
About one lesson in 8 pays a bonus 10 XP, and a chest gives gems plus a surprise like a streak freeze or double XP.
Daily quests
Three small goals a day. Finishing all three starts 15 minutes of double XP, with a real countdown.
A gift for showing up
A 7-day calendar that grows each day, so day 7 is worth coming back for.
Leagues
Groups of 30 race on XP each week through five tiers: Byte, Stack, Heap, Kernel and Compiler. While Recurse is small, quiet tiers share a group, so nobody races alone.
Friends
1-on-1 races, a shared streak with a buddy, and a nudge for a friend who hasn't learned today.
Kapi has moods
On the home screen widget, Kapi wears shades once you've learned today, looks worried in the evening, cries in the last hours, and falls asleep if the streak is lost.
A long road
Rewards from day 2 all the way to day 365, where a 365-day streak earns a free Recurse T-shirt.
Social features: streak buddies, races and leagues
Learning alone is easy to skip. Most of the social features exist so that someone else notices when you don't show up.
Feature
What it does, and why
Streak buddies
You and a friend share one flame, and it only lights when you both learn that day. Letting a friend down pulls harder than letting yourself down.
Nudges
Friends who haven't learned today get a gold bell next to their face. One tap reminds them.
1-on-1 races
A 7-day XP race with a friend, or with anyone you send a link to. The winner gets a badge.
Team quests
Team up with a friend for the week: earn 300 XP together and you both get 40 gems. Unlike a race, you win together.
Someone passed you
When a friend or someone in your league overtakes you, you hear about it, with at most one push a day.
Cheers and the feed
Your milestones show up in your friends' feed, where they can react with Kapi's faces, and anyone can cheer you once a day on your profile.
Friends and safety
Everyone has an @username, and friend requests need the other person to accept. Blocking works both ways at once, and the blocked person isn't told.
From my own account. Other learners' names and photos are blurred.
XP, gems and the shop
There are two currencies, and each has one job. XP measures learning, and gems are for spending.
Feature
What it does, and why
XP
Every lesson pays XP, with a combo for right answers in a row. Your daily goal, leagues, races and team quests all run on XP, so one number ties the whole game together.
An easy streak
Any learning keeps the streak alive: one daily question, right or wrong, a speed round or an interview. A streak should reward showing up, not punish a busy day.
Gems
5 per lesson, or 10 for a perfect one. Chests give 15 to 40 plus a surprise, the top places in a league win 50, 30 and 20, and every badge pays once. The server records every gem in and out, so a retry can never pay twice.
Shop and wardrobe
Gems buy streak freezes, double XP, stickers, and eight outfits for Kapi, from a bow tie to a wizard hat. You try an outfit on first, and if you can't afford it yet, it shows how many gems are left and becomes something to save for. Kapi then wears it on your map, profile and widgets.
Badges
Badges for streaks, XP, lessons, perfect lessons and finished units. Earned ones are never taken away, and the rest show how close you are, like "12 / 30".
Month in review
In the first week of each month, a card of last month: the days you learned, your best streak, your strongest skill, and a Share key.
Practice modes: daily question, speed round and interview mode
Feature
What it does, and why
Daily question
One question a day from the units you've reached, with how everyone did and what your friends picked. The percentage waits for 5 answers, so it never shows 100% from one person.
Speed round
60 seconds of one-tap questions, graded again on the server, with friends' best scores and a beat-my-score link.
Interview mode
10 harder questions on one clock, with no grading until the end, like a real interview. Afterwards, every answer is explained.
Workout
The Practice tab starts with your weak spots and the skills you're about to forget.
Skip ahead, or master a unit
A short test lets someone who already knows a section skip it. A harder test turns a finished unit gold with a crown.
Unit guides
Short notes for each unit, with a reading bar and a button into your next lesson, for people who like to read first.
Look back in a lesson
A back key shows earlier questions with your answer and the explanation, then returns you to where you were.
Report a problem
Every answer has a report link, and reports land on an admin page where I review them.

Android app features: widgets, reminders and offline lessons
Feature
What it does, and why
Home screen widgets
Three widgets: your streak, your week and XP, and today's question with its choices, which you can tap to answer. They change layout when you resize them, like other apps' widgets.
Reminders
Scheduled on the phone itself: a morning hello, a lunch nudge, your own hour, and a late warning when the streak would end at midnight. None of them come once you've learned that day.
Play first, sign up later
You can learn as a guest, and everything moves to your account when you sign in: XP, streak, badges and progress.
Sign in without leaving the app
"Continue with Google" opens Google's own account sheet inside the app, through a small native module I wrote, instead of jumping out to a browser.
App design, and the small details
The map is drawn as a git history, because the people using it are developers. Each section is a stretch of the main branch, each unit is a branch, and each lesson is a commit with a hash. Your next lesson is HEAD, a chest is a tag, and the unit review merges back in.
Kapi, the capybara in pixel sunglasses, is on every screen that needs a face: cheering a right answer, worried when a streak is at risk. Green and red only ever mean right and wrong, so they're never confused with decoration, and every text colour was checked for contrast in both light and dark.
Most of the work, though, went into small things people only notice when they're wrong.
Small detail
Why
Course names shrink to fit
On narrow phones, "Operating" was splitting across two lines as "Oper" and "ating".
Widgets work with large text
Android makes widget text bigger with the phone's text size, which was cutting labels in half.
Most taps only buzz
A tester said a click sound on every press was too much. Answers, combos and chests keep their sounds.
A lesson left halfway picks up where it was
Every answer is kept on the phone, so closing the app doesn't lose your place or your combo.
"1 day", not "1 days"
Small, but people notice.
Reminders change every day
Each kind of reminder has several lines in Kapi's voice, picked by learner and day so they don't get stale. A retry sends the same line, not a new one.
How I marketed it: campus posters and social posts
I treated marketing as part of the product, not something to do after it.
The campus posters each ask one question, and each is made for a place on campus where people wait or spend: the lift, the canteen, the stationery shop, the ride home, outside an interview room. You read the question, you want to know the answer, and the QR code is right there. Every poster comes in two versions: one points to the website now, and the other points to Google Play for after launch.












The social posts are built to get replies, because replies are what spread a post: a tier list of computer science ideas to argue about, SQL against NoSQL with "pick one, defend it", and a code review where the AI's code works but nobody can say why.




And short videos for Instagram that I made, with a voiceover. Swipe or scroll for the next one.
Channel
What I did
Share pictures
Invite, race and profile links show a picture with Kapi, who sent it, and their streak and XP, so a shared link looks worth tapping.
Links that open the app
Invites and races go to Google Play, and the screen the link was for rides along. After installing, the app opens straight to that race or invite.
Search and AI tools
Each course has its own page built from the course content. The site is marked up as a free educational app with its common questions, and a plain file tells AI tools what Recurse is.
Short videos
Reels for Instagram: the launch, new features, and Kapi's story. Each reel's link carries its own tag, like ?ref=ig-reel1, so I can see which video brought people in.
Measuring it
Setup asks "How did you find us?", so I can see which of these actually works.
Checking every Rust question with the real compiler
Most Rust questions are claims about code, like "this doesn't compile" or "this prints 7". If the answer key is wrong, the app teaches people something false, and with confidence. With thousands of questions, checking by hand would miss some, and so would asking an AI.
So the real Rust compiler is the answer key. Before anything ships, a checker compiles every Rust question. If a question says the code fails, it has to fail with the exact error code the question names. If it says the code prints something, it has to print exactly that. That's 1,111 Rust checks right now, and the build fails if any of them stops matching.
How I got there
Explore
First idea: write carefully and read it over
Realise
But a person, or an AI, can be wrong and still sound sure
Insight
So compile every question and check the exact result
Let the compiler decide the answer, not the person writing the question.
From a question to a graded answer
Written as plain files in git
Each unit is a folder of YAML files: its skills, questions and teaching cards. AI drafts them, then they're checked and reviewed.
content/rust/units/
Compiled before it ships
A checker builds every Rust question with a fixed version of the compiler and compares the result with what the question claims.
tools/check-content/src/rustc.ts
Graded on the phone
Answers are checked the moment you tap, so feedback is instant, even offline.
Graded again on the server
When a lesson ends, the server replays your answers with the same grading code. Only then do your XP and streak change, so nobody can fake them from the browser.
packages/api/src/replay.ts
Saving finished lessons on a bad network
A lesson finished on a train with no signal could fail to save, and the learner would lose it. Now every finished lesson is kept on the phone and sent until the server confirms it has it: a few quick tries on the end screen, then again whenever the app opens.
Fixing a React Native app that froze when the network changed
Android sends all of an app's requests down one shared connection. When the phone moves from Wi-Fi to mobile data, that connection can go silent without the phone noticing. React Native's network code has no time limit, so every retry waited on the same dead connection for about a minute. A tester saw "This lesson didn't load" twice while the server was answering in 0.2 seconds.
I gave the connection a 5-second read limit, which marks a dead connection as bad so the retry opens a fresh one, and a ping every 10 seconds to catch one that died while idle. I tested it through a relay that freezes connections on purpose. Before the fix every try failed; after it, the retry loaded in 0.3 seconds.
Cutting latency for learners in India: moving from Neon to Supabase in Mumbai
The database was on Neon's free plan, which sleeps after 5 idle minutes and adds about a second to the next request. It was also close to its monthly limit, and almost every learner is in India.
First the server moved next to the database in Singapore, which cut each call from India to about a third of the time. Then both moved to Mumbai. A round trip from India to Mumbai is about 58ms, against 100ms to Singapore, so every request got about 40ms faster. The server and database stay in the same region, because one request makes several database queries.
Making the app open instantly
The app saves its data on the phone, so the map, streak and friends show at once, even offline, while fresh data loads in the background. The next lesson is fetched while you're still looking at the map, so Start opens it without waiting. Parts of the profile that don't depend on each other load side by side instead of one after another.
Fast leaderboards in Postgres
A leaderboard used to add up every learner's XP for the week each time someone opened it. Now each learner's score is kept in its own table and updated in the same database transaction as their XP, so a board is one quick read from an index. A nightly job checks every kept score against the real data, and fixes and logs any that drifted.
Personalised learning, measured with an A/B test
Recurse adapts to each learner using only their own history. For now it's plain statistics, and nothing is sent to an outside AI service.
Every night, each active learner's day is saved as numbers: days since their last lesson, lessons and XP this week, accuracy, speed, the hour they usually learn, and friends. Later models will learn from this data.
From that history, the app finds the hour you usually learn and moves your reminder close to it. It makes practice harder if you're getting 90% right, keeps reviews easier if you're at 60% or less, and shows your weak spots on the Practice tab.
To know whether any of this helps, it runs as a fair test. 8 in 10 learners get the smart version and 2 in 10 are kept back to compare. The group comes from the learner's id, so it never changes, and each day's settings are logged. When it started, it filled in 90 days of history, using for each day only what was known on that day, so later answers couldn't leak into earlier days.
Bugs the tests didn't catch
These all came from real use, and each one now has a test or a check so it can't come back.
What went wrong
What I changed
The league week switched at 5:30 AM India time, but last week wasn't settled until about 7:30 PM. For 14 hours the board showed a new week with old winners.
One clock: Monday to Sunday in India time, settled ten minutes after midnight.
Rust and System design both had a section called "data", so a System design skip-ahead test asked Rust questions.
Renamed the sections, and the content build now fails if two courses share a name.
Chests in every course after Rust said they were locked, because the server checked units against one long list of all courses.
Each unit is now checked within its own course.
Older versions of the app would crash when a friend wore a new outfit they didn't know how to draw.
The app now sends its version number, and draws any outfit it doesn't know as plain Kapi.
Recurse in numbers
3,281
questions
126 units across 5 courses
1,111
Rust questions compiled
every one matches what it claims
497
tests
441 unit and 56 end-to-end
Source · Counted from the repo on 10 November 2026.






























