· Lucas Resende · portfolio · 8 min read

Tao Ch'an Mandarin: EdTech Platform

Web ecosystem for Mandarin learning combining video lessons, FSRS v4.5 spaced repetition, smart dictionary, turn-based dialogue simulator, and interactive exams.

Web ecosystem for Mandarin learning combining video lessons, FSRS v4.5 spaced repetition, smart dictionary, turn-based dialogue simulator, and interactive exams.

From pedagogical necessity as a volunteer Mandarin teacher at Tao Ch’an Temple to full-stack software engineering: how I architected and built an educational ecosystem with Next.js, Supabase, FSRS v4.5 spaced repetition, and deterministic validation with AI agents.


📌 Overview and Context

  • My role: Product Owner, context architect, full-stack developer, and QA engineer
  • Context: EdTech applied to Mandarin language education (Tao Ch’an Temple)
  • Scope: Full web ecosystem (LMS, FSRS v4.5 engine, smart dictionary, dialogue simulator, and quiz engine)
  • Official links: Live Web Application and GitHub Repository
  • Primary tech stack: Next.js 16 (App Router), React 19, TypeScript 5, Tailwind CSS v4, Supabase (PostgreSQL, RLS, Storage), ts-fsrs v5, TanStack Query v5, @dnd-kit, Tiptap, PostHog

🛠️ The Pedagogical Challenge and Operational Bottlenecks

Teaching and learning Mandarin Chinese as a Portuguese speaker introduces pedagogical hurdles that generic online course platforms fail to resolve. While volunteering as a Mandarin instructor at the Tao Ch’an Temple, transitioning from a Marketing background, and starting my degree in Systems Analysis and Development at Fatec, I experienced these recurring friction points firsthand:

  • Fragmented study workflow: Students had to juggle disparate YouTube links for recordings, Google Drive folders for PDF handouts, WhatsApp groups for audio drills, and external flashcard apps burdened with steep setup curves.
  • The tonal and Hanzi barrier: Without immediate visual differentiation across the 4 tones (mā, má, mǎ, mà) and a structured daily active recall routine, character retention dropped sharply between weekly live classes.
  • Conversational practice hesitation: Beginner students often felt uncertain formulating Mandarin replies and lacked an interactive environment to practice situational turn-based dialogues with instant feedback.
  • Manual grading overhead: Designing quizzes, managing loose audio submissions in ad-hoc folders, and writing individualized pedagogical feedback for dozens of students required countless hours of volunteer effort.

To address these pain points directly at their source, I created Portal Tao Ch’an Mandarim, consolidating the entire learning lifecycle into a single, mobile-first web platform.


⚙️ System Architecture and Technology Stack

The platform was built with an uncompromising focus on strict end-to-end typing, robust data isolation through Row-Level Security (RLS), and instant UI response times:

Architectural LayerTechnologies DeployedStrategic Role in the Solution
Frontend FrameworkNext.js 16.2 (App Router)Hybrid rendering (Server Components and Client Components), type-safe Server Actions, and optimized page routing
Language & UITypeScript 5, React 19, Tailwind CSS v4Strict data contracts, modern concurrency hooks, and a design system powered by native CSS tokens
Backend & DatabaseSupabase (PostgreSQL with RLS)Relational persistence across 16 tables, granular RLS policies per user role, and student audio storage
State & CacheTanStack React Query v5Optimistic UI updates, background data revalidation, and stratified cache invalidation tiers
Spaced Repetition Enginets-fsrs v5 (FSRS v4.5 Algorithm)Mathematical review scheduling calculating memory stability and retrieval difficulty over time
Media & Audio CaptureWeb MediaRecorder APINative WebM audio recording directly in the browser with strict hardware track release lifecycles
Editor & InteractionsTiptap Custom Suite and @dnd-kitRich-text editor for cultural notes and accessible drag-and-drop for Chinese sentence restructuring
Telemetry & QualityPostHog and Python 3.12Product analytics telemetry via reverse proxy and deterministic CLI audit scripts

🧪 Zero-Backend Portfolio Sandbox Architecture

To safeguard student privacy while allowing recruiters and fellow software engineers to test every feature without barriers, I implemented an In-Browser Supabase and PostgREST Sandbox (lib/demo/supabaseSandbox.ts):

  • Transparent request interception: The sandbox intercepts requests to Supabase endpoints (/auth/v1, /rest/v1, and /storage/v1) across both server components and client-side code.
  • PostgREST engine in TypeScript: Implements filtering operators (eq, neq, in, not, or, ilike), relational joins between tables, pagination with Prefer: count=exact headers, conflict-handling upserts, and remote RPC execution.
  • Local persistence and role switching: Maintains application state inside localStorage using anonymized, realistic initial seed data. A floating control bar at the bottom right enables switching between Student Mode (Maria Fernanda) and Teacher Mode (Prof. Lucas) with a single click.

🖼️ Visual Walkthrough of the Platform

Dual-Role Instant Sandbox Login

Clean entrance interface featuring one-click demo role selection and a direct link to the open-source GitHub repository.

System login screen highlighting the demo environment and one-click role buttons for student and instructor modes. System login screen highlighting the demo environment and one-click role buttons for student and instructor modes.

Main Student Dashboard

Displays overall course completion, the active study streak calculated by the FSRS engine, primary learning module shortcuts, and a collapsible lesson stack.

Student dashboard displaying daily study streak metrics, primary learning modules, and an interactive lesson queue. Student dashboard displaying daily study streak metrics, primary learning modules, and an interactive lesson queue.

Smart Tonal Dictionary with Color-Coded Pinyin

Vocabulary unlocks progressively as students advance through units. Every entry features Simplified and Traditional Hanzi, syllable-level tonal color-coded Pinyin, native audio playback, and cultural annotations.

Personal dictionary featuring syllable tonal color-coding, audio pronunciation, and one-click deck imports. Personal dictionary featuring syllable tonal color-coding, audio pronunciation, and one-click deck imports.

FSRS v4.5 Spaced Repetition Flashcards

Active recall interface driven by the FSRS algorithm, organizing cards into daily queues for new terms, learning items, and reviews, accompanied by an annual GitHub-style study heatmap.

Flashcard study hub with review scheduling powered by the FSRS algorithm and an annual study consistency heatmap. Flashcard study hub with review scheduling powered by the FSRS algorithm and an annual study consistency heatmap.

Turn-Based Dialogue Simulator

Conversational interface modeled after messaging applications. Students listen to audio prompts from a native speaker, evaluate the available written reply choices, and select the correct response to advance the conversation, receiving instant feedback and corrections upon any mistake.

Turn-based dialogue simulator with native audio playback and dynamic reply selection. Turn-based dialogue simulator with native audio playback and dynamic reply selection.

Interactive Quiz and Exam Engine

Supports 9 question formats, including multiple-choice, phonetic Pinyin typing, drag-and-drop sentence ordering, listening comprehension, and live oral audio submission.

Interactive quiz environment featuring real-time cloud auto-saving and live oral audio recording. Interactive quiz environment featuring real-time cloud auto-saving and live oral audio recording.

Teacher Administration Dashboard (Laoshi)

Centralized administrative hub featuring real-time analytics integrated with PostHog, student activity logs, assignment submission queues, and cohort management tools.

Teacher administration panel displaying engagement metrics, real-time telemetry, and course management shortcuts. Teacher administration panel displaying engagement metrics, real-time telemetry, and course management shortcuts.

Hybrid Assessment Grading with Audio Playback

Objective questions are automatically scored upon submission, while open-ended written answers and audio recordings are organized for instructor playback, scoring, and per-item pedagogical remarks.

Assessment grading interface with embedded audio player for student voice recordings and individual feedback fields. Assessment grading interface with embedded audio player for student voice recordings and individual feedback fields.


🧠 Software Engineering with AI Agents

I value honesty about my path: coming from a Marketing career and being at the beginning of my Systems Analysis and Development studies at Fatec Taubaté, I had not yet built years of manual coding experience to write a full-stack system with 16 relational tables, PostgREST queries, and an FSRS engine line by line from memory. Nonetheless, my students at the temple needed a working solution without delay.

Rather than relying on unstructured and fragile coding practices, I designed a disciplined methodology centered on Agentic Software Engineering, acting as Product Owner, requirements analyst, and quality auditor. I established a 3-tier architecture directly inside the repository:

  1. Living architectural context (.agents/context/ and DOCUMENTATION.md): Before proposing code modifications, agents reference 15 modular technical chapters documenting database schemas, Row-Level Security rules, routing conventions, and component lifecycles.
  2. Domain-specialized skills (.agents/skills/): Five modular instruction bundles governing cumulative vocabulary whitelisting in exams, Unicode normalization for tonal Pinyin, Next.js Server and Client Component boundaries, and Supabase data sanitization.
  3. Deterministic Python quality gates (scripts/): CLI scripts that strictly enforce rules prior to commits, ensuring a 100-point total on every exam (validate_exam.py), blocking untaught Chinese characters, and auditing PostgreSQL migrations for unindexed foreign keys (schema_validator.py).

🔧 Engineering Challenges and Real-World Bug Resolution

Validating the platform with active students surfaced practical edge cases that demanded rigorous technical debugging:

  • Mobile Safari media stream leaks with MediaRecorder: When students switched browser tabs while recording audio, MediaStream hardware instances remained open in background tabs on mobile devices, keeping the red microphone icon active and draining the battery. The solution required encapsulating media capture within a custom React hook with strict cleanup routines, explicitly traversing stream.getTracks() and calling track.stop() both on recording completion and during React component unmount cycles.
  • Race conditions in TanStack Query cache: During rapid flashcard review sessions, successive rating requests competed with the active card queue query. I implemented optimistic mutations paired with explicit cancellation of active queries (queryClient.cancelQueries) and queued batch synchronization before writing updated FSRS card states to the database.

📈 Impact and Key Takeaways

  • Proven in production: The platform supports active Mandarin students at the Tao Ch’an Temple, demonstrating stability and addressing genuine educational needs.
  • Comprehensive full-stack proficiency: Solidified hands-on competence across the Next.js App Router, relational database design with RLS, cognitive spaced repetition algorithms, and context-driven AI engineering.
  • Zero-infrastructure interactive portfolio: Thanks to the in-browser sandbox emulator, anyone can explore and test the entire application directly in their browser with zero latency and zero backend overhead.
  • nextjs
  • react
  • typescript
  • supabase
  • postgresql
  • fsrs
  • ai-engineering
  • edtech
  • mandarin
Share:
Back to Portfolio