This document provides a comprehensive guide to the Netflix-style video streaming platform built for IvyLevel's coaching sessions. The system integrates with AWS S3 for video storage, implements intelligent video playback features, and provides a modern, responsive UI for both students and coaches to access their coaching sessions.
- Added Netflix-style video sessions view for coaches
- Coaches can now view all their students' sessions in one place
- Student name filtering instead of coach filtering for coach view
- Smart start time detection for all videos
- 3-tier caching system for optimal performance
- System Architecture
- Technology Stack
- Setup Guide
- Core Features
- Implementation Details
- API Documentation
- Known Limitations
- Future Enhancements
frontend/apps/unified-app/
├── src/
│ ├── components/
│ │ ├── student/
│ │ │ ├── SessionsViewOptimal.tsx # Netflix-style video grid for students
│ │ │ ├── VideoPlayer.tsx # Modal video player
│ │ │ └── StudentDashboard.tsx # Student portal
│ │ ├── coach/
│ │ │ ├── CoachSessionsView.tsx # Netflix-style video grid for coaches
│ │ │ ├── EnhancedCoachDashboard.tsx # Coach dashboard with Sessions tab
│ │ │ └── [Other coach components]
│ │ └── auth/
│ │ └── [Authentication components]
│ ├── services/
│ │ ├── videoPreloadService.ts # Video caching & preloading
│ │ └── metadataCacheService.ts # Session metadata caching
│ └── config/
│ └── api.ts # API endpoints configuration
backend/api/
├── main_s3_simple.py # Main API with S3 integration
├── main_simple.py # Simple API without S3
└── main_production_ready.py # Full production API
- React 18.2 with TypeScript
- Vite 5.4 for build tooling
- Styled Components for styling
- React Router v6 for navigation
- React Query for data fetching
- Intersection Observer API for lazy loading
- FastAPI (Python) for REST API
- Boto3 for AWS S3 integration
- Uvicorn as ASGI server
- Pydantic for data validation
- AWS S3 for video storage
- Presigned URLs for secure video access
- PostgreSQL (optional, for production)
- Node.js v22+
- Python 3.9+
- AWS account with S3 access
- Git
- Clone the repository:
git clone [repository-url]
cd ivylevel_one/backend/api- Create virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set AWS credentials:
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_DEFAULT_REGION="us-east-1"- Start the backend:
python main_s3_simple.pyThe API will be available at http://localhost:8000
- Navigate to frontend:
cd frontend/apps/unified-app- Install dependencies:
npm install- Start development server:
npm run devThe app will be available at http://localhost:5173
Students:
- Email:
hudasir4j@gmail.com, Password:Welcome123! - Email:
kavyamridula@gmail.com, Password:Welcome123!
Coaches:
- Email:
jennyduan@ivymentors.co, Password:Welcome123! - Email:
janice@ivymentors.co, Password:Welcome123!
- Responsive Layout: Adapts from 2-6 columns based on screen size
- Hover Preview: Videos auto-play on hover with smart start time
- Lazy Loading: Uses Intersection Observer for performance
- Skeleton Loading: Smooth loading states
- CSS Containment: Prevents layout shifts
- Automatic Blank Screen Skip: Analyzes transcript files to find when conversation starts
- Multiple Format Support: Handles various transcript JSON formats
- Intelligent Fallbacks:
- Regular sessions: 15 seconds
- Game plans: 30 seconds
- Check-ins: 60 seconds
- Caching: Start times are cached for performance
- Full-Screen Mode: Immersive viewing experience
- Sidebar Navigation: Browse other sessions while watching
- Video Controls: Native HTML5 controls
- Smart Resume: Videos start from smart start time
- Coach Filter: Filter by Jenny, Erin, Rishi, Marissa, Steven, Janice
- Category Filter: Essays, Test Prep, College Planning, etc.
- Search: Real-time search across titles
- Week Sorting: Sessions sorted by week number
- Student Filter: Filter by student name (e.g., Huda, Anoushka, Arshiya, Minseo)
- Category Filter: Same categories as student view
- Multi-Student View: See all students' sessions in one place
- Search: Search across all students' sessions
- Secure Access: Presigned URLs with 1-hour expiration
- Folder Structure:
Students/{StudentName}/organization - Auxiliary Files: Reads transcript.json, metadata.json, aiinsights.md
- Performance: 5-minute metadata cache, 55-minute URL cache
- Three-Tier Cache:
- Metadata cache (LocalStorage)
- Preview URL cache
- Full video URL cache
- Smart Prefetching: Adjacent videos are prefetched
- Offline Support: Blob caching for watched videos
// SessionsViewOptimal.tsx
const handleVideoHover = useCallback((sessionId: string) => {
setHoveredVideo(sessionId);
// Debounced preview loading
if (hoverTimeoutRef.current) {
clearTimeout(hoverTimeoutRef.current);
}
hoverTimeoutRef.current = setTimeout(async () => {
// Load video preview after 500ms hover
const session = sessions.find(s => s.id === sessionId);
if (session && session.video_url) {
// Video auto-plays from smart_start_time
}
}, 500);
}, [sessions]);# main_s3_simple.py
def extract_smart_start_time(bucket_name: str, video_key: str, s3_client) -> int:
# 1. Check for transcript.json in same S3 folder
# 2. Parse transcript for first meaningful speech
# 3. Skip entries with "otterpilot", "notetaker", etc.
# 4. Look for conversation starters like "hi", "hello", "how are you"
# 5. Return timestamp with 2-second buffer
# 6. Fall back to intelligent defaults if no transcriptvideo_url = s3_client.generate_presigned_url(
'get_object',
Params={'Bucket': bucket_name, 'Key': file_key},
ExpiresIn=3600 # 1 hour
)POST /api/auth/login
{
"email": "hudasir4j@gmail.com",
"password": "Welcome123!"
}Response:
{
"success": true,
"user": {
"id": "student_007",
"email": "hudasir4j@gmail.com",
"name": "Huda",
"role": "student"
},
"access_token": "demo_token_12345",
"expires_in": 3600
}GET /api/student/sessions?page=1&limit=20&coach=Jenny&category=Essays
Response:
{
"sessions": [
{
"id": "session_abc123",
"title": "Week 99 - Essay Review with Jenny",
"description": "Essay Review session with Jenny",
"duration": "45:00",
"coach": "Jenny",
"category": "Essays",
"thumbnail": "https://...",
"video_url": "https://s3-presigned-url...",
"date": "2025-07-07",
"week": 99,
"smart_start_time": 95, // seconds
"student": "Huda"
}
],
"coaches": ["Jenny", "Erin", "Rishi"],
"categories": ["Essays", "Test Prep"],
"total": 150,
"page": 1,
"totalPages": 8
}GET /api/coach/sessions?page=1&limit=20&student=Huda&category=Essays
Response:
{
"sessions": [
{
"id": "session_abc123",
"title": "Week 99 - Huda - Essay Review",
"description": "Essay Review session with Huda",
"duration": "45:00",
"student": "Huda", // Note: student name instead of coach
"category": "Essays",
"thumbnail": "https://...",
"video_url": "https://s3-presigned-url...",
"date": "2025-07-07",
"week": 99,
"smart_start_time": 95,
"file_name": "Week99_Huda_Essays_Jenny.mp4",
"watched": false,
"progress": 0
}
],
"students": ["Huda", "Anoushka", "Arshiya", "Minseo"], // Note: students instead of coaches
"categories": ["Essays", "Test Prep", "College Planning"],
"total": 275,
"page": 1,
"totalPages": 14
}- Issue: Some videos start at conservative fallback times (15s) instead of actual speaking time
- Cause:
- Transcript files may not be present for all videos
- Some transcript formats may not be fully supported
- Early detection algorithm may miss nuanced conversation starts
- Example: Week 98 starts at 0:15 but actual conversation begins at 1:35
- Workaround: Manual adjustment of fallback times in code
- Current: Using placeholder images from picsum.photos
- Limitation: No actual video thumbnails extracted
- Future: Implement video frame extraction at smart start time
- Current: Hardcoded to "45:00" for all videos
- Limitation: No actual duration extraction from video files
- Future: Use FFprobe or video metadata API
- Blob Storage: Limited to 500MB total cache
- No Background Sync: Cached videos don't update automatically
- Current: Only searches titles, not transcript content
- No Fuzzy Search: Exact substring matching only
-
Improved Smart Start Detection
- ML-based speech detection
- Visual frame analysis to detect when people appear
- Multiple transcript format support
-
Real Thumbnails
- Extract frame at smart_start_time + 5 seconds
- Generate and cache in S3
-
Video Analytics
- Track watch time and completion rates
- Generate heatmaps of most-watched sections
-
Transcript Search
- Full-text search across all transcripts
- Jump to specific moments in videos
-
AI Insights Integration
- Display key takeaways from aiinsights.md
- Auto-generate session summaries
-
Mobile App
- React Native implementation
- Offline video download
-
Live Streaming
- WebRTC integration for live sessions
- Real-time chat and Q&A
-
Personalized Recommendations
- ML-based content recommendations
- Learning path suggestions
-
Interactive Features
- In-video quizzes and assignments
- Collaborative note-taking
-
Advanced Analytics
- Coach performance metrics
- Student engagement tracking
- ROI measurement
- Lazy Loading: Videos load only when visible
- Debounced Hover: 500ms delay prevents excessive preview loads
- Caching Strategy:
- S3 metadata: 5 minutes
- Presigned URLs: 55 minutes
- LocalStorage: 30 minutes
- CSS Containment: Prevents layout recalculations
- Virtual Scrolling: (Future) For 1000+ videos
- Presigned URLs: Expire after 1 hour
- CORS: Restricted to specific origins
- Authentication: JWT tokens (in production)
- S3 Bucket Policies: Least privilege access
- Check browser console for CORS errors
- Verify S3 presigned URL hasn't expired
- Ensure AWS credentials are valid
- Check if video_url is present in session data
- Verify smart_start_time is reasonable (not 0 or > duration)
- Check browser autoplay policies
- Check S3 bucket region (should be close to users)
- Verify caching is working (check DevTools Network tab)
- Consider implementing CDN for videos
- Feature Branch: Create feature/your-feature-name
- Local Testing: Test with both S3 and mock data
- Code Review: Ensure TypeScript types are correct
- Performance: Check with Chrome DevTools Performance tab
- Accessibility: Test with screen readers
- Set production AWS credentials
- Configure CORS for production domain
- Enable HTTPS
- Set up monitoring (Sentry, etc.)
- Configure CDN for videos
- Set up database backups
- Load test with expected traffic
For questions or issues, please contact the development team or create an issue in the repository.