
Case Study
A full-featured AI-powered learning management system with student and instructor experiences
Overview
Cognify is a production-grade LMS with student and instructor dashboards, course creation, multi-format lesson delivery (video, PDF, text), progress tracking, and an AI tutor. I built the entire frontend solo while a backend developer handled the Node.js, Express, and MongoDB layer.
Most LMS products are either too complex for small educators or too limited for serious course delivery. Cognify was scoped to hit the middle: a clean, fast interface for instructors to build and manage courses, and a focused learning experience for students with AI-assisted support. The frontend challenge was building two completely different user experiences with different data needs, different navigation structures, and different permissions without the codebase becoming unmanageable.
The product scope came from collaborative planning between me and the backend developer. We drew from common LMS patterns (Udemy, Moodle) and stripped them to what actually mattered for a first version.
Core instructor needs identified: create a course with multiple sections and lessons, upload different content types per lesson, see which students enrolled, track completion rates.
Core student needs: browse and enrol in courses, pick up where they left off, get help when stuck on a concept, see their progress clearly.
Key technical constraint identified early: the instructor and student dashboards needed to share some components (course cards, progress bars, video players) but have completely different data access patterns. This shaped the architecture more than anything else.
I established a clear data flow before writing any component: API service functions at the bottom, TanStack Query hooks in the middle, and presentational components at the top. No component fetches data directly. No hook stores UI state. Zustand handles only what TanStack Query cannot: modal state, active sidebar item, drawer open/close. This separation meant I could build and test each layer independently. For role handling I put guards in hooks rather than layout components so the access logic could be reused across different parts of the app without duplication. OpenAI integration was scoped as a stub in this phase, structured to accept any LLM provider without touching the UI.
Student dashboard: course library with enrolment flow, a dedicated learning view for each lesson with progress tracking, a sidebar showing course structure and completion status, and an AI tutor panel that accepts questions about the current lesson content.
Instructor dashboard: course creation wizard with section and lesson management, a file upload interface for video, PDF, and text content per lesson, an analytics overview showing enrolled students and completion rates, and a student roster per course.
Established a ServerType / NormalizedType pattern: raw API responses are transformed at the service layer into a consistent shape before they touch any hook or component. This meant no scattered null-checking or shape-mapping across the UI.
Hooks return both data and handler functions and own their own toast notifications. Parent components call a hook and get back everything they need without wiring up separate mutation handlers.
Role guards implemented as hook-level checks rather than layout wrappers. This made the guards reusable, testable, and independent of where in the component tree a protected feature lives.
Cognify has been live for approximately two months and has tracked 500+ unique visitors via Vercel Analytics. I tested the core flows myself extensively before launch: full course creation as an instructor, full enrolment and lesson completion as a student, and the AI tutor response quality across different question types. I did not run formal user testing sessions but the analytics data and the absence of critical bug reports from visitors suggests the core flows are stable.
The AI tutor in the current version is a stub. It sends the lesson content and student question to OpenAI but does not maintain conversational context across messages. A proper implementation would include message history in the prompt, which increases token usage and cost and was deferred to a later phase.
Video content is uploaded and served via the backend rather than through a dedicated video CDN. This works at current scale but will not hold up under heavy concurrent load. A migration to a service like Mux or Cloudinary Video is planned before any significant user growth.
Course analytics in the instructor dashboard are basic: enrolment count and completion rate only. Deeper engagement data (time per lesson, drop-off points, replay frequency) would require more instrumentation than the current backend exposes.
No mobile-optimised learning view in this phase. The lesson player layout breaks below 768px in ways that need a dedicated redesign rather than just responsive tweaks.
Cognify is live, functional, and has had over 500 unique visitors since launch. The architecture decisions made on this project, specifically the ServerType/NormalizedType pattern, hook-level role guards, and the strict Zustand/TanStack Query separation, have carried into every project I have built since. It is the project that shifted how I think about frontend architecture from component-first to data-flow-first.