A compact, production-minded course player built with Next.js (App Router), React 19, and TypeScript. This project demonstrates a modular UI, accessible patterns, and client-driven UX for learning platforms: video playback with mobile PiP, curriculum navigation, PDF embedding, exams, comments, and leaderboard.
Last updated: October 19, 2025
-
Live demo: live Demo
-
Video demo: Video Demo
-
Figma File: Figma File
- What youβll find
- Architecture & Design
- Key Features
- Developer Setup
- Code Walkthrough (where to look)
- A responsive Course page with:
- Custom video player (playback, volume, seek, PiP, fullscreen)
- Curriculum sidebar (week/lesson grouping, locked lessons)
- Course materials panel (duration, topics, price)
- Comments, exams, and a leaderboard (modal-driven flows)
- PDF integration (react-pdf-viewer) with a simple server-side proxy for Google Drive files
- Client-side state via a custom hook
useCoursePage()and dynamic imports for heavy pieces
Design goals:
- Composability: Features are grouped under
src/features/*. Each feature owns its components, hooks, and types. - Performance: Large viewers (PDF, exam UI) are lazy-loaded using Next.js dynamic imports.
Quick file tour
βββ src
βββ app
β βββ layout.tsx # global layout, fonts, pdf worker
β βββ page.tsx # route entry (mounts CoursePage)
β βββ not-found.tsx
β βββ global-error.tsx
β βββ api/proxy-pdf/route.ts # server-side PDF proxy
βββ components
β βββ shared
β βββ ui
β βββ button.tsx # primary UI primitive
β βββ modal.tsx # modal primitive used across features
βββ features
β βββ course
β βββ components/CoursePage.tsx # main composition
β βββ hooks/useCoursePage.ts # central page state & interactions
β βββ features
β β βββ video-player
β β βββ sidebar
β β βββ ...other feature modules (comments, ask-question, etc.)
β βββ exams
β βββ pdf-viewer
βββ lib
β βββ utils.ts # utility helpers
βββ features/course/utils/mockCourseData.ts # demo data
Recommended quick read order:
1. src/features/course/components/CoursePage.tsx
2. src/features/course/hooks/useCoursePage.ts
3. src/features/course/features/video-player/components/VideoPlayer.tsx
4. src/app/layout.tsxCore concepts:
- App layer (
src/app) wires routes and global layout (fonts, PDF worker tag). - Feature modules (
src/features/*) are independent: e.g.,course,pdf-viewer,exam. - Shared UI (
src/components/ui/*) contains atomic components (Button, Modal, Slider). - Small server API (
src/app/api/proxy-pdf/route.ts) safely proxies Google Drive PDFs, returningapplication/pdfto the client.
- β Responsive video player with a modern control bar and accessible buttons
- β Mobile-first Picture-in-Picture (auto-activated on scroll)
- β Dynamic PDF viewing with a robust viewer (react-pdf-viewer)
- β Exam workflow (questions, timed sessions, scoring)
- β Comments and leaderboard for social proof and user engagement
Local dev commands:
pnpm install
pnpm dev # start dev server
Open
http://localhost:3000Configuration notes:
src/app/layout.tsxinserts a CDNpdf.worker.min.jsthat matches thepdfjs-distversion ( keep these in sync if you upgradepdfjs-dist).- No environment variables are required for the demo.
- Entry:
src/app/page.tsxβ mounts CoursePage - Composition:
src/features/course/components/CoursePage.tsxβ layout and dynamic imports - Player:
src/features/course/features/video-player/components/VideoPlayer.tsx& hooks - UI primitives:
src/components/ui/*β Button, Modal, Slider, Textarea - Local hook:
src/features/course/hooks/useCoursePage.tsβ central UI state for the page - API:
src/app/api/proxy-pdf/route.tsβ proxy endpoint for PDFs - Mocks:
src/features/course/utils/mockCourseData.tsβ demo dataset
Primary signals to check:
- Code structure & modularity: look for feature folders and small reusable UI primitives
Suggested inspection checklist:
- Open
CoursePage.tsxand follow how components are dynamically imported and wired. - Review
useCoursePage.tsfor client logic.
Next.js, React 19, TypeScript, Tailwind CSS, Shadcn UI, react-pdf-viewer, lucide-react
π§ Email: mostafa.mohamed.se@gmail.com
π LinkedIn: LinkedIn