thesunbg
Back

Bobi Learning

AI-powered learning platform for Vietnamese primary school students (grades 1-5) covering Math, Vietnamese, and English. Features an AI tutor, adaptive difficulty, gamification, and online smart games (Sudoku, Chess, Xiangqi).

Tech

Vue 3TypeScriptVitePiniaExpressMongoDBMongooseSocket.IOOpenAIStockfish.jschess.jspnpm workspacesDocker

Overview

Bobi Learning is an AI-powered learning platform built for Vietnamese primary school students (grades 1-5). It turns studying Math, Vietnamese, and English into a delightful adventure with a personal AI tutor that adapts to each child's pace.

Highlights

Smart Learning

  • Three subjects: Math (algorithmic generators — zero AI cost), Vietnamese (reading comprehension, dictation, fluency via TTS), and English (vocabulary, matching, stories).
  • Adaptive difficulty: combines SM-2 spaced repetition with a 20-item sliding-window accuracy tracker.
  • Bobi the AI tutor: live chat for step-by-step explanations whenever a student is stuck.
  • OpenAI TTS with MD5-hashed disk cache — never pay twice for the same line.
  • "Did You Know?": grade-appropriate AI-generated trivia, persisted to a shared pool so parents without an API key still get content.

Gamification

  • Points, streaks, multi-tier achievements, daily challenge (2x points).
  • Virtual pet, avatar shop, narrative chapters, leaderboard, adventure map.

Smart Games

  • Sudoku: backtracking puzzle generator with 5 difficulty levels and a 2-player online race mode.
  • Chess: Stockfish.js (WASM) at 5 skill levels, custom Vue board, invite-code rooms.
  • Xiangqi: hand-rolled minimax + alpha-beta with piece-square tables, 5 levels.
  • All games support online matchmaking via 6-character invite codes with real-time sync over Socket.IO.

Parent Tools

  • Progress dashboard, weak-point tracking, time-on-task per day.
  • Author custom exercises for your child, share exam links.
  • BYO AI provider (OpenAI / Gemini / Deepseek) with encrypted API key storage.

Architecture

A pnpm-workspaces monorepo with three packages:

  • packages/shared — common types and constants.
  • apps/backend — REST API + Socket.IO realtime layer.
  • apps/frontend — Vue 3 SPA.

Backend: Express + TypeScript, MongoDB via Mongoose, JWT + Google OAuth, Socket.IO rooms for game matches, Passport strategies.

Frontend: Vue 3 Composition API + TypeScript, Vite, Pinia, Vue Router, Axios. SEO meta tags + JSON-LD EducationalApplication schema.

Deployment: Multi-stage Docker (Alpine), pnpm with node-linker=hoisted to play nicely with Docker overlay-fs, rsync + docker-compose deploy to a VPS.

Engineering Challenges Solved

  • pnpm 10 + Docker symlinks: switched to node-linker=hoisted and invoke binaries via node /app/node_modules/<pkg>/bin/<bin> to bypass per-workspace shim path bugs.
  • TypeScript module resolution: moved backend tsconfig from bundler to NodeNext to reliably resolve hoisted packages from a subdirectory.
  • Stockfish in a Web Worker: loaded WASM from CDN via a Blob URL to sidestep CORS without bloating the bundle.
  • Adaptive difficulty: blended SM-2 ease factor + interval days + a 20-item sliding window to balance "drill now" against "review later."

Roadmap

Ship a beta to ~50 parents, iterate on content and difficulty curves. Next up: a Science subject, grade 6-9 expansion, and a Pikafish WASM upgrade for Xiangqi.