Technology Stack
EducaStream is built with a modern React-based architecture using Vite as the build tool and bundler.Frontend Framework
React 18.2
Core UI library with hooks and context API
Vite 4.4
Next-generation frontend build tool
React Router 6
Client-side routing and navigation
Axios
HTTP client for API communication
Core Dependencies
The application relies on several key libraries as defined inpackage.json:12-28:
Application Architecture
Entry Point
The application bootstraps frommain.jsx:10-18 with the following configuration:
Backend API
The frontend connects to a Railway-hosted backend API:
https://backend-educastream-production.up.railway.app/Build Configuration
Vite configuration fromvite.config.js:1-8:
Application Structure
Context Providers
EducaStream uses React Context for state management:- UserContext (
App.jsx:31) - Manages user authentication and profile data - CartProvider (
CartContext.jsx:94-106) - Manages shopping cart state with localStorage persistence
State Management Pattern
The cart uses a reducer pattern with the following actions:ADD_TO_CART- Adds courses to cart with duplicate checkingREMOVE_FROM_CART- Removes courses from cartCLEAR- Clears the entire cart
Storage Strategy
localStorage
Cart items, user session, and payment data
Firebase Storage
Course videos, images, and media files
Routing Architecture
Route Protection
The application implements role-based routing fromApp.jsx:73-151:
Authenticated Routes
Available to logged-in users:
/student/:id- Student profile/instructor/:id- Instructor dashboard/cart/:id- Shopping cart/config/:id- User settings
Authentication Flow
Key Features
Course Management
- Course creation and editing (
/instructor/:id/form) - Lecture creation (
/instructor/:courseId/createLecture) - Course catalog browsing
- Detailed course views with video playback
Payment Processing
- Stripe integration for checkout
- Cart management with localStorage persistence
- Payment success handling (
/payment/checkout/sucess)
User Roles
- Student
- Instructor
- Admin
- Browse and purchase courses
- Access purchased content
- View class lists and lectures
- Manage cart and payments
Development Scripts
Frompackage.json:6-10:
Performance Features
Suspense for code splitting and lazy loading
Vite for fast HMR and optimized builds
localStorage for reduced API calls
React Router for client-side navigation
Next Steps
Setup Guide
Get your development environment ready
Firebase Config
Configure Firebase services
Stripe Integration
Set up payment processing