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.
- Project Overview
- Key Features
- Technology Stack
- System Architecture
- Installation Guide
- API Documentation
- Contributing
- License
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.
- 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.
- 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)
The application follows a monorepo-style structure with a clear separation of concerns between the frontend and backend.
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;
- Simulated AI: To avoid costs associated with actual video content moderation APIs, the AI analysis is simulated using a
setTimeoutfunction 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.
- Node.js (v14 or higher)
- MongoDB Atlas Account (or a local MongoDB instance)
- Cloudinary Account
git clone <repository-url>
cd pulse-streamcd backend
npm installCreate 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 devIn a new terminal:
cd frontend
npm install
npm run devOpen your browser at http://localhost:5173.
| Method | Endpoint | Description | Access |
|---|---|---|---|
| POST | /api/users/register | Register a new user | Public |
| POST | /api/users/login | Login user & get JWT | Public |
| 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 |
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.