Skip to content

Enos2/Narra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Narra

Node.js MongoDB Express React Vite License


🚀 Project Overview

Narra is a modern pay-per-view streaming platform designed for content creators, administrators, and public viewers.
It allows creators to upload videos, go live, and monetize content, while administrators manage users, content approvals, and platform moderation.

This repository includes both the backend (Node.js + Express + MongoDB) and frontend (React + Vite + Tailwind CSS) for a full-featured, scalable streaming platform.


🔑 Features

General

  • User registration, login, and password reset
  • JWT-based authentication and session management
  • Role-based access control:
    • user – regular viewer
    • supportadmin – support/admin functions
    • platformadmin – content & platform management
    • superadmin – full access, including admin management
  • Account status management (active, restricted, banned, permanently_banned)

Video & Streaming

  • Upload videos with title, description, thumbnail, and file
  • Admin approval workflow for uploaded videos
  • Trending and live video feeds
  • Pay-per-view content support and purchase handling
  • Live streaming feature with real-time viewers
  • Video rejection and approval workflow for admins

Admin Panel

  • Admin Dashboard with real-time stats:
    • Total users
    • Total videos
    • Live streams
    • Inactive admins
  • Audit logs of all admin actions
  • Inactive admin detection and forced logout
  • Admin management (promote/demote roles, view users)

Frontend

  • React with Vite for fast, modern development
  • Global state management with AppContext
  • Protected routes and admin route wrappers
  • Dynamic video feed, notifications, and user account handling
  • Responsive UI with Tailwind CSS

🛠️ Tech Stack

Backend

  • Node.js (v18+)
  • Express.js
  • MongoDB with Mongoose
  • Authentication: JWT & bcrypt
  • Middleware: dotenv, cors

Frontend

  • React 18
  • Vite 4.x
  • Tailwind CSS
  • React Router v6 for routing
  • Context API for global state management

⚙️ Setup Instructions

Backend

  1. Clone the repository:
git clone https://github.com/Enos2/Narra.git
  1. cd Narra/backend

  2. Install dependencies:

npm install
  1. Set environment variables (.env):
PORT=5000
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
  1. Start the backend server:
npm run dev

Frontend

1 Navigate to frontend:

cd ../frontend

2 Install dependencies:

npm install

3 Start the frontend development server:

npm run dev

Open the app:

http://localhost:5173

🧩 Folder Structure

backend/
├─ controllers/
├─ models/
├─ routes/
├─ middleware/
├─ utils/
frontend/
├─ src/
│  ├─ api/
│  ├─ assets/
│  ├─ components/
│  ├─ context/
│  ├─ pages/
│  │  ├─ admin/
│  ├─ utils/
│  └─ App.jsx

🔐 Security & Permissions

  • Passwords hashed using bcrypt

  • Role-based route protection in both frontend and backend

  • Account restrictions for banned or restricted users

  • Admins can only access allowed pages based on role (AdminRoute & SuperAdminRoute)

📈 Admin Panel

  • View platform-wide stats

  • Manage users, videos, and live streams

  • Audit logs for monitoring admin actions

  • Force logout inactive admins (7+ days inactivity)

⚡ Future Improvements

  • Real-time live streaming chat and interactions

  • Enhanced analytics and reporting for admin dashboard

  • Improved payment handling and subscription management

  • Video recommendations based on user preferences

📄 License

  • This project is licensed under the MIT License.
  • See LICENSEfor details.

👨‍💻 Authors

  • Enos Omenda – Full-stack developer & project lead

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors