CASE STUDY · Fullstack · AI · 2025
Estudialo AI
An AI tutor that explains, not just answers
Mobile-first AI study tutor built at Capsule Codes: Gemini-powered, 14 study actions, education levels, Stripe plans, in Spanish and English.
- Role
- Fullstack · AI
- Year
- 2025
- Stack
-
- Next.js 16
- Vercel AI SDK 5
- Gemini 2.5 Flash
- Supabase
- Stripe
- TypeScript
- Tailwind CSS 4
- TanStack Query
- next-intl
The problem
Most “AI for students” apps are a general chatbot with a school logo: paste the assignment, copy the reply. A study tool has a different job. It should explain, adapt to the level of the student, and push them to practice, while staying cheap enough to offer a free tier. We also needed to be honest about what “not cheating” can mean in a product, because a student can always ask for the answer.
The solution
Estudialo AI is a client project that we built from scratch at Capsule Codes. The student opens the app, picks “Study with AI” and chats. Each message is routed to one of 14 study actions: summarize a text, generate a quiz, practice exercises, explain simply, run a study session, correct a text, help with homework, build a visual outline or a mind map, write an essay, and a few more. The action comes from a button the student taps or, when they just type, from a first Gemini call that classifies the intent.
Every action has its own prompt, which is combined with the student’s education level (elementary, high school or university), the interface language, and the plan. Students can attach photos and PDFs, which are sent as context. Past chats are kept in a history list, and there is a notifications screen and a profile.
There are two plans. Basic is limited to 10 messages a day, answers of about 100 words and ads. Premium raises the limits to 30 messages a day and 300 words, advertises a more advanced model and removes ads. Payments run on Stripe. An image generator is on the home screen but is marked as under construction.
The screenshots use invented demo data and sample replies written for the demo, not real model output.
Stack and key decisions
We split the work by area, with Stripe and Gemini on one side and Supabase on another, and merged it through pull requests. These are the decisions that shaped the app:
- Next.js 16 with the App Router: a mobile-first interface built with Tailwind 4 and TanStack Query, with
next-intlfor three locales (en-US, es-ES and es-LA) - Vercel AI SDK with Gemini:
generateTextfor everything, no streaming.gemini-2.5-flashhandles the chat, titles and intent routing, and a multimodal model is used when an image is attached - One message pipeline: a single route checks the session, the subscription and the daily and monthly quotas, detects the action, builds the system prompt, sends the last 50 messages as history, saves the reply and updates the quotas
- Prompts as data: the prompt for each action has a basic and a premium variant and lives in a JSON file per locale, so changing how an action behaves does not touch the pipeline
- Supabase for auth and data: cookie-based sessions with email and password or Google, and tables for profiles, conversations, messages, attachments, notifications and usage. Uploads go to a storage bucket with limits per plan
- Stripe as the source of truth: the app looks up the customer by email and reads the active subscription from Stripe, instead of keeping a copy in its own database. Routes handle subscribing, changing the plan, updating the card, cancelling and reactivating
[WARNING] Localized prompts
The system prompts ship in three languages, not just the interface. If the prompt is in English and the student writes in Spanish, the model tends to mix languages, and the Spanish of Spain and of Latin America differs enough in idioms and formality to deserve separate files.
What we learned
“Teaches, not cheats” was the pitch, and the code only partly delivers it. The general chat is restricted to educational topics and capped in length. Quizzes and exercises hold back the answers until the student asks for a check, and quiz feedback gives hints first. But homework help does give the final answer, with a step-by-step explanation next to it. That is a deliberate middle ground, not a Socratic tutor, and we learned to describe it as “explains, not just answers” rather than promising something a prompt cannot guarantee.
Up to two model calls per message is a good trade. The routing call, only needed when the student does not tap an action, is short and fast with a Flash model, and in return each action gets a specific prompt instead of one generic prompt that tries to do everything.
Reading the subscription live from Stripe kept the system simple, with no webhooks or mirrored state to drift. The cost is a lookup on every message and a hard dependency on Stripe being reachable, so a local copy kept in sync by webhooks is the first thing we would revisit.
And working as a small team made the job mostly about interfaces: agreeing what each pull request touched, reviewing for the product rather than only the code, and keeping prompts, limits and plan copy consistent across three locales.
// 6 img