Skip to content

Repository files navigation

EduStream - Adaptive Streaming Platform for Education

EduStream is a cloud-native adaptive streaming platform optimized for low-bandwidth environments (100 kbps–1.5 Mbps). It enables educators to deliver high-quality video content to students in regions with limited connectivity.


🎯 Features

  • Adaptive Bitrate Streaming: Automatic quality adjustment based on bandwidth
  • Offline Content Caching: PWA support for offline viewing
  • Low-Bandwidth Optimization: Works reliably on 100 kbps–1.5 Mbps connections
  • Encoding Pipeline: Automated FFmpeg-based video encoding(multiple quality levels)
  • Message Queue: RabbitMQ for async encoding jobs
  • Real-time Monitoring: Prometheus + Grafana dashboards
  • Distributed Tracing: Jaeger for observability
  • Microservices Architecture: Modular, scalable design
  • Secure Authentication: JWT-based auth with role-based access control

πŸ—οΈ Architecture

EduStream (Monorepo)
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ backend/          # NestJS microservices
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/     # JWT authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ users/    # User management
β”‚   β”‚   β”‚   β”œβ”€β”€ content/  # Video content metadata
β”‚   β”‚   β”‚   β”œβ”€β”€ streaming/ # HLS delivery service
β”‚   β”‚   β”‚   β”œβ”€β”€ encoding/ # FFmpeg worker service
β”‚   β”‚   β”‚   └── analytics/ # Usage analytics
β”‚   β”‚   └── package.json
β”‚   └── frontend/         # React + Tailwind frontend
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ services/
β”‚       β”‚   └── hooks/
β”‚       └── package.json
β”œβ”€β”€ infra/                # Infrastructure configs
β”‚   β”œβ”€β”€ docker/
β”‚   β”œβ”€β”€ kubernetes/
β”‚   β”œβ”€β”€ terraform/
β”‚   └── cicd/
β”œβ”€β”€ docker-compose.yml    # Local development stack
└── README.md

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18
  • Docker & Docker Compose
  • Git

1. Clone & Setup

cd edustream
npm install

2. Environment Configuration

cp .env.example .env
# Update .env with your configuration if needed

3. Start Development Stack

npm run docker:up

This will start:

  • MongoDB (27017): Database
  • Redis (6379): Cache & session store
  • RabbitMQ (5672, 15672): Message broker
  • FFmpeg Service: Encoding worker
  • Prometheus (9090): Metrics
  • Grafana (3003): Dashboards
  • Jaeger (16686): Distributed tracing
  • MinIO (9000, 9001): S3-compatible storage

4. Start Backend & Frontend

# In separate terminals:
npm run dev:backend  # Runs on http://localhost:3000
npm run dev:frontend # Runs on http://localhost:3001

Or all at once:

npm run dev

5. Verify Services


πŸ“¦ Project Workspace

edustream/
β”œβ”€β”€ apps/backend/          # NestJS backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.ts
β”‚   β”‚   β”œβ”€β”€ app.module.ts
β”‚   β”‚   └── ... (modules to be created)
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”œβ”€β”€ apps/frontend/         # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   └── ... (components to be created)
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”œβ”€β”€ infra/
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   β”œβ”€β”€ Dockerfile.ffmpeg
β”‚   β”œβ”€β”€ mongodb/init.js
β”‚   β”œβ”€β”€ prometheus/prometheus.yml
β”‚   └── kubernetes/ (manifests)
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ package.json (root)
└── .env.example

πŸ› οΈ Development Commands

Backend

cd apps/backend
npm run start:dev     # Start with hot-reload
npm run build         # Build for production
npm run test          # Run unit tests
npm run test:e2e      # Run integration tests

Frontend

cd apps/frontend
npm start             # Start dev server
npm run build         # Build for production
npm run test          # Run tests
npm run eject         # Eject from CRA (one-way)

Docker

npm run docker:build  # Build all services
npm run docker:up     # Start containers
npm run docker:down   # Stop containers
npm run docker:logs   # View logs

πŸ§ͺ Testing

Unit & Integration Tests

npm run test          # Run all tests
npm run test:backend  # Backend tests only
npm run test:frontend # Frontend tests only

Coverage

npm run test -- --coverage

πŸ“Š Monitoring & Observability

Metrics (Prometheus)

Dashboards (Grafana)

Distributed Tracing (Jaeger)


πŸ” Security

  • JWT Authentication: All API endpoints protected
  • Password Hashing: bcryptjs with salt rounds = 10
  • Rate Limiting: 100 requests per 15 minutes
  • CORS: Configured for localhost:3000 and localhost:3001
  • Environment Secrets: Use .env file, never commit secrets

πŸ“ Next Steps

Phase 2: Core Backend

  • Initialize NestJS app with database setup
  • Create MongoDB schemas (users, videos, encodings)
  • Set up Redis client and caching layer

Phase 3: Authentication

  • JWT auth service
  • User registration & login endpoints
  • Role-based access control (RBAC)

Phase 4: Streaming Service

  • HLS manifest generation
  • Adaptive bitrate selection
  • Progress tracking

Phase 5: Encoding Pipeline

  • FFmpeg worker service
  • RabbitMQ job queue
  • Quality level generation (240p, 360p, 480p, 720p)

Phase 6: Frontend

  • React setup with Tailwind CSS
  • HLS.js video player
  • Offline PWA caching
  • User dashboard

Phase 7: Infrastructure

  • Kubernetes manifests
  • Terraform configs (AWS/GCP/Azure)
  • Helm charts

Phase 8: CI/CD

  • GitHub Actions workflows
  • Automated testing on push
  • Docker image building & registry push
  • Automated deployment

πŸ“š Documentation

See /docs (to be created) for:

  • API specifications (Swagger)
  • Database schemas
  • Encoding quality guidelines
  • Deployment guides
  • Troubleshooting

🀝 Contributing

  1. Create a feature branch: git checkout -b feature/your-feature
  2. Commit changes: git commit -m 'Add feature'
  3. Push: git push origin feature/your-feature
  4. Create a Pull Request

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages