Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jaydeepc/tube-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SphurtiTube

A video sharing platform for Piramal Finance.

Features

  • Video upload with thumbnail
  • Admin panel for content management
  • User authentication and authorization
  • Video playback
  • Responsive design

Tech Stack

  • Frontend: React, TailwindCSS, Framer Motion
  • Backend: Node.js, Express
  • Database: MongoDB
  • Authentication: JWT

Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or Atlas)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/sphurti-tube.git
cd sphurti-tube
  1. Install dependencies:
# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install
  1. Create a .env file in the backend directory:
PORT=5000
MONGO_URI=mongodb://localhost:27017/sphurti-tube
JWT_SECRET=your_jwt_secret

Running the Application

  1. Start the backend server:
cd backend
npm run dev
  1. Start the frontend development server:
cd frontend
npm start
  1. Create an admin user:
cd backend
npm run create-admin

This will create an admin user with the following credentials:

Usage

  1. Open your browser and navigate to http://localhost:3000
  2. Log in with the admin credentials
  3. Use the admin panel to upload videos and manage content

Folder Structure

sphurti-tube/
├── backend/
│   ├── config/
│   ├── controllers/
│   ├── middleware/
│   ├── models/
│   ├── routes/
│   ├── scripts/
│   ├── uploads/
│   └── server.js
├── frontend/
│   ├── public/
│   └── src/
│       ├── components/
│       ├── context/
│       ├── hooks/
│       ├── pages/
│       ├── services/
│       └── styles/
└── README.md

API Endpoints

Authentication

  • POST /api/users/register - Register a new user
  • POST /api/users/login - Login user
  • GET /api/users/me - Get current user

Videos

  • GET /api/videos - Get all videos
  • GET /api/videos/trending - Get trending videos
  • GET /api/videos/:id - Get a single video
  • POST /api/videos - Create a new video (requires authentication)
  • PUT /api/videos/:id - Update a video (requires authentication)
  • DELETE /api/videos/:id - Delete a video (requires authentication)
  • POST /api/videos/:id/thumbnail - Upload a thumbnail for a video (requires authentication)
  • PUT /api/videos/:id/like - Like a video (requires authentication)
  • PUT /api/videos/:id/dislike - Dislike a video (requires authentication)

Features

  • Clean, Modern UI with intuitive navigation
  • Smooth Video Playback with a distraction-free player
  • Easy Content Management through an admin panel
  • High Performance & Scalability optimized for fast loading
  • Dark/Light Theme toggle for user preference
  • Responsive Design for all device sizes

Tech Stack

  • Frontend: React.js, Tailwind CSS, Framer Motion
  • Backend: Node.js (Express.js)
  • Database: MongoDB (Mongoose ORM)

Project Structure

sphurti-tube/
├── frontend/                # React.js frontend
│   ├── public/              # Static assets
│   └── src/
│       ├── components/      # Reusable UI components
│       ├── pages/           # Page components
│       ├── hooks/           # Custom React hooks
│       ├── context/         # Context providers
│       ├── services/        # API service functions
│       ├── utils/           # Utility functions
│       ├── assets/          # Images, icons, etc.
│       └── styles/          # Global styles
│
└── backend/                 # Node.js/Express backend
    ├── controllers/         # Request handlers
    ├── models/              # Mongoose models
    ├── routes/              # API routes
    ├── middleware/          # Custom middleware
    ├── config/              # Configuration files
    ├── utils/               # Utility functions
    └── server.js            # Entry point

Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or Atlas)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/sphurti-tube.git
    cd sphurti-tube
    
  2. Install backend dependencies:

    cd backend
    npm install
    
  3. Install frontend dependencies:

    cd ../frontend
    npm install
    
  4. Create a .env file in the backend directory with the following variables:

    NODE_ENV=development
    PORT=5000
    MONGO_URI=mongodb://localhost:27017/sphurti-tube
    JWT_SECRET=your_jwt_secret_key_here
    JWT_EXPIRE=30d
    

Running the Application

  1. Start the backend server:

    cd backend
    npm run dev
    
  2. Start the frontend development server:

    cd frontend
    npm start
    
  3. Open your browser and navigate to http://localhost:3000

API Endpoints

Videos

  • GET /api/videos - Get all videos (with pagination)
  • GET /api/videos/trending - Get trending videos
  • GET /api/videos/:id - Get a single video
  • POST /api/videos - Create a new video (requires authentication)
  • PUT /api/videos/:id - Update a video (requires authentication)
  • DELETE /api/videos/:id - Delete a video (requires authentication)
  • PUT /api/videos/:id/like - Like a video
  • PUT /api/videos/:id/dislike - Dislike a video

License

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages