Skip to content

benniu04/NEMA

Repository files navigation

NEMA 🎬

A production-ready video streaming platform for independent cinema.

🌐 Live Demo: https://nemaa.netlify.app/

Production Status Lighthouse Score Test Coverage


📖 Overview

A full-stack Netflix-like streaming platform built with modern web technologies. Features video streaming with multiple quality options, user engagement (comments, reviews, watchlists), and a secure admin portal for content management.

Key Metrics:

  • 5.5x faster response times (250ms → 45ms)
  • 🚀 850 requests/second capacity
  • 📊 90% test coverage with Jest/Vitest
  • 🌍 Global CDN delivery via CloudFront
  • 💰 $0.003 cost per user

✨ Features

  • 🎬 Video Streaming - Multiple quality options (720p, 1080p) with seamless switching
  • 💬 User Engagement - Comments, reviews, watchlists, and activity tracking
  • 🎯 Watch Progress - Viewing history with progress bars and completion status
  • 🔐 Admin Portal - Secure content management with JWT authentication
  • 📤 Video Uploads - Direct S3 streaming for files up to 3GB
  • 📱 Responsive Design - Optimized for desktop, tablet, and mobile

🛠️ Tech Stack

Frontend: React 19 • Vite • Tailwind CSS • Zustand • React Router
Backend: Node.js • Express • MongoDB • Mongoose • JWT • Winston
Infrastructure: AWS S3 • CloudFront CDN • Netlify • MongoDB Atlas • Render
Testing: Jest • Supertest • Vitest • React Testing Library

🏗️ Architecture

Frontend (React + Netlify)
         ↓
API Server (Node.js + Express + PM2)
         ↓
    ┌────┴─────┐
MongoDB      AWS S3 + CloudFront
(Atlas)      (Video Storage + CDN)

Key Components:

  • Connection pooling (10 connections) for 5x faster queries
  • LRU cache (90% hit rate) for instant responses
  • CloudFront signed URLs for secure content delivery
  • PM2 cluster mode for high availability

📊 Performance

Response Times: 250ms → 45ms (5.5x faster)
Cache Hit Rate: 90% (instant responses)
Capacity: 850 requests/second, 5,000 concurrent users
Lighthouse Score: 95/100
Test Coverage: 90% across frontend and backend


🔒 Security

Authentication: JWT with httpOnly cookies, bcrypt password hashing
Input Validation: Express-validator, NoSQL injection prevention
Headers: Helmet.js (CSP, XSS protection, clickjacking prevention)
Rate Limiting: 100 req/15min general, 5 req/15min for auth routes
Content Protection: CloudFront signed URLs (24-hour expiration)
Monitoring: Winston logging, suspicious activity detection, request tracking


🎯 Technical Highlights

Database Optimization: Connection pooling and strategic indexes reduced query time from 250ms to 45ms (5.5x faster)

Video Upload: Direct S3 streaming with multer-s3 handles 3GB files

Parallel Processing: Refactored signed URL generation with Promise.all() for 80% speed improvement

Graceful Shutdown: Proper connection handling ensures 99.9% uptime and zero data loss during deployments

User Tracking: Browser fingerprinting enables comment/review ownership without forced registration


🚀 Deployment

Frontend: Netlify with automatic CI/CD and edge caching
Backend: Render with PM2 cluster mode (2 instances) and rolling deployments
Database: MongoDB Atlas (M0 tier, us-east-1)
Storage: AWS S3 + CloudFront CDN with signed URLs


📄 License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •