Skip to content

advyy100i/MediaBridge

Repository files navigation

Media Access & Analytics Platform Backend

A secure media management backend with user auth, media metadata management, streaming URLs, view logging, analytics with caching, and rate limiting.

  • Users can upload media and generate secure streaming links.
  • Tracks who is watching your media, when, and from where.
  • Adds performance, security, and production-readiness features.

Key Features

  • User Authentication (Signup/Login with JWT)
  • Media Management (Add media metadata, stream URLs)
  • View Logging (IP + timestamp)
  • Analytics with Redis caching
  • Rate Limiting on view logging endpoint
  • Automated Tests (Jest)
  • Dockerized for easy deployment
  • Config via .env

Database Schemas

  • MediaAsset: id, title, type (video/audio), file_url, created_at
  • AdminUser: id, email, hashed_password, created_at
  • MediaViewLog: media_id, viewed_by_ip, timestamp

APIs

  • POST /auth/signup
  • POST /auth/login → returns JWT token
  • POST /media (auth) → add media metadata
  • GET /media/:id/stream-url → returns secure 10-minute expiring URL
  • POST /media/:id/view → log a view (with IP & timestamp), rate limited
  • GET /media/:id/analytics → return view stats, cached with Redis

Setup & Usage

  • Clone repo

  • Copy .env.example to .env and configure

  • Build and run with Docker:

    docker compose up --build
  • Run tests:

    # Example for Node.js (adjust for your stack)
    npm test

Notes

  • Streaming URLs are signed and expire after 10 minutes for security.
  • Redis caches analytics responses to improve performance.
  • Rate limiting protects view logging endpoint from abuse.
  • Tests cover auth, media, logging, analytics, and middleware.

Results:

Untitled.video.-.Made.with.Clipchamp.7.mp4
Screenshot 2025-08-12 163924 Screenshot 2025-08-13 005810

About

Media Backend API - A secure, Dockerized backend for media management featuring JWT authentication, media uploads, streaming URL generation, view logging with rate limiting, Redis-powered analytics caching, and comprehensive automated tests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors