Skip to content

DPanvish/Pulse-Stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PulseStream - Video Upload & Streaming Application

React NodeJS Express.js MongoDB Socket.io Cloudinary

PulseStream is a full-stack MERN application designed for seamless video uploading, content analysis, and streaming. It features a robust backend that processes videos for safety, provides real-time status updates, and includes role-based access control.

Table of Contents

Project Overview

PulseStream is a comprehensive solution for video content management. The application allows users to upload videos, which are then processed and analyzed for content sensitivity. The frontend provides a user-friendly interface for managing and viewing videos, with real-time updates on the processing status.

Key Features

  • Video Management: Secure video upload and storage using Cloudinary.
  • Content Analysis: Automated simulation of content sensitivity checks.
  • Real-Time Updates: Live processing status updates using Socket.io.
  • Role-Based Access Control (RBAC):
    • Viewers: Can watch videos.
    • Editors/Admins: Can upload and delete videos.
  • Streaming: Integrated video player for MP4 streaming.
  • Search & Filter: Real-time filtering of the video library.

Technology Stack

  • Frontend: React (Vite), Tailwind CSS, Axios
  • Backend: Node.js, Express.js
  • Database: MongoDB (Mongoose)
  • Real-Time Communication: Socket.io
  • Storage: Cloudinary
  • Authentication: JWT (JSON Web Tokens)

System Architecture

The application follows a monorepo-style structure with a clear separation of concerns between the frontend and backend.

System Architecture Diagram

graph TD
    User["End User"] -->|"HTTPS"| FrontendClient;
    FrontendClient["React Frontend (Vite)"] -->|"REST API / Socket.io"| BackendServer;

    subgraph "Backend Services"
        BackendServer["Node/Express Server"] -->|"Auth/Data"| DB[(MongoDB Atlas)];
        BackendServer -->|"File Upload"| Cloud["Cloudinary Storage"];
        BackendServer -->|"Background Process"| AI["Simulated AI Analysis"];
    end

    AI -->|"Update Status"| BackendServer;
    BackendServer -->|"Real-Time Event"| FrontendClient;
Loading

Design Decisions

  • Simulated AI: To avoid costs associated with actual video content moderation APIs, the AI analysis is simulated using a setTimeout function that randomly assigns a "Safe" or "Flagged" status.
  • Stateless Storage: Cloudinary is used for video storage to ensure the application is stateless and easily deployable on cloud platforms.
  • Security: Passwords are hashed using bcryptjs, and API routes are protected using a custom middleware that verifies JWT Bearer tokens.

Installation Guide

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB Atlas Account (or a local MongoDB instance)
  • Cloudinary Account

Step 1: Clone the Repository

git clone <repository-url>
cd pulse-stream

Step 2: Backend Setup

cd backend
npm install

Create a .env file in the backend folder with the following credentials:

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key_12345
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

Create the temporary uploads folder and start the server:

mkdir uploads
npm run dev

Step 3: Frontend Setup

In a new terminal:

cd frontend
npm install
npm run dev

Open your browser at http://localhost:5173.

API Documentation

Authentication

Method Endpoint Description Access
POST /api/users/register Register a new user Public
POST /api/users/login Login user & get JWT Public

Video Management

Method Endpoint Description Access
GET /api/videos Get all videos Private
GET /api/videos/:id Get single video details Private
POST /api/videos/upload Upload a video file Editor/Admin
DELETE /api/videos/:id Delete a video Owner/Admin

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors