LearnEngine

Full-Stack AI Platform

2026

Key Features

The Learning Suite

A complete ecosystem featuring LearnEngine (Architect), LearnSubject (Classroom), and Help With (Assistant).

Public Dictionary

Context-aware translations and conjugations accessible to anyone without an account.

Adaptive Quizzes

Questions adjust difficulty based on your performance in real-time.

AI Tutor Chat

Ask questions anytime with full lesson context and persistent history.

Quiet Confidence

A premium, minimal aesthetic with high contrast, generous typography, and smooth micro-interactions.

Secure by Design

Multi-layer security with auth, rate limiting, and data isolation.

Overview

This project grew from a simple curriculum generator into a full Suite of learning tools. Built on Next.js 16 + React 19 with a "Quiet Confidence" design theme, think high contrast, minimal UI, smooth GSAP animations, and generous typography. The core Engine still hooks up to multiple AI models through OpenRouter to generate and grade adaptive content.

The Suite introduced dedicated spaces: "LearnSubject" provides a distraction-free classroom for generated lessons and quizzes. "Help With" acts as an assistant for breaking down specific problems. I also built a public-access Dictionary tool with context-aware translations and conjugations, designed to be the entry point to the ecosystem, no login required.

The backend was where things got spicy. Supabase for the database and auth, which was honestly great until I spent 3 hours debugging why Row Level Security wasn't working. The AI stuff goes way beyond just calling an API; I had to build injection protection because apparently people WILL try to break your prompts. Learned that one the hard way.

Security nearly killed me. Had to implement rate limiting after I realized someone could theoretically spam the AI endpoints and rack up my API bill. Added input sanitization, fixed an open redirect bug that was embarrassing, and strengthened the password requirements. Basically paranoia-driven development.

How It Started

From notebook to reality

1

The Idea

Dynamically generated learning engine
2

High Level Approach

Avoid rebuilding app depending on OS
Probably organized a backend accessed using API calls
3

Viability Research

Research cost of models for backend
Start with open source models, ideally free
OpenRouter is the window into these models
Test models to find the right fit
4

Build Phase 1

Build Next.js app using Bun
Code with Antigravity
Add Supabase to App
sketchLogin flow
sketch"What to learn" search bar
sketchExisting lessons cards
OpenRouter for AI use
5

Backend & Complexity Testing

Create backend to test complexity of minimal requirements
Learning: storing User Data is hard
Create a frontend to access the backend
Pivot to Next.js build of front and back — still backend centric + faster to launch
Explore saving User Data!!! → Supabase to the Rescue?
6

Deep Dive & Model Selection

Supabase hands-on build
Test AI models for fit (must be free)
DeepSeek R1 T2 → meets criteria ✓
MiMo V2 Flash → same but faster ✓

Architecture

System Architecture

User Interface
🏠Landing Page
📊Dashboard
📖Lesson View
💬Chat Panel
API Layer
🔐Authentication
  • Session handling
  • Route protection
🤖AI Routes
  • Generate Plan
  • Generate Content
  • Grade Answer
🛡️Security
  • Rate limiting
  • Input sanitization
💬Chat
  • Conversation management
  • Message history
External Services
🗄️Supabase
  • PostgreSQL
  • Auth
  • RLS Policies
🧠OpenRouter AI
  • Mimo Flash
  • GPT-120B
  • GLM 4.5 Air

User Journey

User Learning Journey

✏️Enter Topic
🤖AI Generates Plan
📋Review & Customize
📚Learn Content
Practice Quiz
💬AI Tutor Help
🎓Master Topic

Adaptive Algorithm

Adaptive Learning Algorithm

📊User Performance
Analyze
< 50% Accuracy
Easier
50-80% Accuracy
Same
> 80% Accuracy
Harder
🎯Personalized Path

How It Works

< 50%Easier questions with basic definitions
50-80%Same level, mix of recall and application
> 80%Harder questions with critical thinking

Security

Security Architecture

👤User Request
🔐Authentication
⏱️Rate Limiting
🛡️Input Sanitization
Authorization
🗄️Row Level Security
Safe Request

Database Design

Database Schema

User Data
👤profiles
  • id
  • display_name
  • created_at
📈user_progress
  • is_correct
  • user_answer
  • time_spent
Learning Content
📋lesson_plans
  • topic
  • outline
  • status
📄lesson_sections
  • title
  • content
  • difficulty
questions
  • question_text
  • options
  • correct_answer
Chat System
💬chat_conversations
  • title
  • lesson_id
  • model_id
📝chat_messages
  • role
  • content
  • model_id

Work Items

AI-Generated Curricula

ai

Type literally any topic and get a structured lesson plan in seconds. The AI breaks it down into 4-6 sections with time estimates. Getting different AI models to format their output consistently was... an adventure.

  • OpenRouter integration, had to debug each model separately because they all have quirks
  • Mimo Flash, GPT-120B, GLM 4.5 Air support (each returns slightly different JSON, fun times)
  • Prompt injection sanitization after someone tried some creative inputs
  • JSON parsing with fallbacks because AI outputs aren't always clean

Dynamic Content Generation

ai

Each lesson gets detailed, AI-written content in Markdown with math equation support. Getting the difficulty slider to actually change the language complexity took way more prompt iterations than I want to admit.

  • 400-600 words per section (had to tweak prompts to stop AI from writing novels)
  • Difficulty scale 1-10 that actually works (mostly)
  • Markdown rendering with syntax highlighting for code examples
  • KaTeX for math equations, surprisingly smooth to integrate

Adaptive Quiz Engine

feature

Questions get easier if you're struggling (<50% accuracy) or harder if you're crushing it (>80%). The algorithm tracks your last 10 answers. First version was way too aggressive with difficulty swings, had to tune it.

  • Multiple choice, true/false, and short answer question types
  • AI grading for open-ended responses (this took forever to get right)
  • Performance context tracking that actually influences new questions
  • Difficulty adjustment in -2 to +2 range, aggressive enough to feel adaptive, not so much it's jarring

AI Tutor Chat

ai

Built-in AI tutor that knows what lesson you're on. Ask questions anytime and get contextual help. The first version lost chat history on page refresh, that was a fun bug to explain to testers.

  • Persistent chat history that actually persists (took a few attempts)
  • Model picker so you can choose your AI
  • Lesson context injection so the AI knows what you're learning
  • Message streaming for that ChatGPT-like typing feel

Progress Tracking System

feature

Tracks accuracy, time spent, and improvement over time. Everything persists across sessions. The database schema for this went through like 3 revisions before it made sense.

  • Per-question answer tracking (yes, I store every answer)
  • Time spent per section and per question
  • Accuracy calculations that update in real-time
  • Visual progress bars that actually feel motivating

Security Architecture

security

Multi-layer security because I'm paranoid. Rate limiting, input sanitization, RLS policies, the works. Found an open redirect vulnerability during my own testing which was embarrassing but better than finding it in prod.

  • Supabase Auth with proper session handling
  • Rate limiting at 10 AI calls/minute (my wallet said so)
  • Prompt injection pattern filtering, people will try to break things
  • Open redirect prevention after I found a vulnerability in my own code
  • RLS policies that actually work (after the semicolon incident)

Database Architecture

architecture

PostgreSQL with 7 interconnected tables. Users, lessons, sections, questions, progress, chat history, the whole thing. Took a while to get the relationships right but now it's actually pretty clean.

  • Profiles, lesson_plans, lesson_sections tables (basic but solid)
  • Questions with difficulty levels and type metadata
  • User progress tracking per section and per question
  • Chat conversation and message storage with proper foreign keys
  • RLS policies on everything, nobody sees anyone else's data

The Learning Suite

architecture

Expanded the platform from a single tool into a complete suite. LearnEngine acts as the curriculum architect, LearnSubject is the distraction-free classroom for generated content, and Help With provides instant breakdowns of specific problems.

  • LearnEngine: Course generation and knowledge graph mapping
  • LearnSubject: Distraction-free study space with lessons and adaptive quizzes
  • Help With: Instant AI assistant for breaking down single questions
  • Seamless navigation logic between the Suite tools

Public Dictionary Network

feature

Built a public-access Dictionary tool with context-aware translations and conjugations designed to act as a frictionless entry point into the LearnEngine ecosystem. No login required.

  • Public-first design allowing immediate utility without account creation
  • Context-aware definitions and real-world usage examples
  • Full verbal conjugation tables generated by AI
  • Visual distinction using emerald accents to signify public resources

"Quiet Confidence" Design

feature

A premium, minimal aesthetic focusing on high contrast, generous typography, and subtle micro-interactions. The goal was to make learning feel elegant rather than gamified.

  • Light and Luxury Dark mode color palettes
  • Typography system combining Inter, Playfair Display, and Lora
  • Sharp edges with no border radius for a strict structural feel
  • GSAP-powered slide-up entrances and hover-lifts

Key Highlights

  • 01

    Designed the "Quiet Confidence" theme with a premium dark/light mode and smooth micro-interactions

  • 02

    Built a complete Suite: LearnEngine (Architect), LearnSubject (Classroom), Help With (Assistant), and a public Dictionary

  • 03

    Integrated public-access Dictionary with context-aware translations as a frictionless entry point

  • 04

    Built full AI curriculum generation with support for Mimo Flash, GPT-120B, GLM 4.5 Air, DeepSeek R1T2

  • 05

    Adaptive difficulty that tracks your last 10 answers and adjusts on the fly

  • 06

    7-table PostgreSQL schema with proper RLS policies and rate limiting

Technologies

Frontend

Next.js 16React 19TypeScriptTailwind CSSshadcn/uiGSAP

Backend

API RoutesSupabase AuthPostgreSQLRow Level Security

AI & Data

OpenRouter APIMimo FlashGPT-120BGLM 4.5 AirDeepSeek R1T2