Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ateendra24/youtube-backend
A robust backend for a YouTube-like website built with Node.js, Express, MongoDB, JWT, and more. Includes authentication, video upload, playlist management, tweet, like and comment system.
https://github.com/ateendra24/youtube-backend
expressjs javascript jwt jwt-authentication mongodb mongoose nodejs
Last synced: 17 days ago
JSON representation
A robust backend for a YouTube-like website built with Node.js, Express, MongoDB, JWT, and more. Includes authentication, video upload, playlist management, tweet, like and comment system.
- Host: GitHub
- URL: https://github.com/ateendra24/youtube-backend
- Owner: ateendra24
- Created: 2024-09-04T12:33:59.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-12T13:49:35.000Z (2 months ago)
- Last Synced: 2024-10-10T14:40:18.633Z (about 1 month ago)
- Topics: expressjs, javascript, jwt, jwt-authentication, mongodb, mongoose, nodejs
- Language: JavaScript
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Youtube Backend
A backend for a YouTube-like website. This project is built using Node.js, Express, MongoDB, and Mongoose, featuring user authentication, video uploads, playlist management, and more.
## Features
- User authentication (sign up, login, token-based authentication)
- Video upload and storage (using Cloudinary)
- Playlist management
- Commenting system
- Secure password handling (using bcrypt)
- Token-based authentication (JWT)
- Cross-origin resource sharing (CORS)
- Environment variable configuration (dotenv)## Tech Stack
- **Node.js**: JavaScript runtime
- **Express.js**: Web framework
- **MongoDB & Mongoose**: NoSQL database and ODM for database modeling
- **JWT**: Secure user authentication
- **Cloudinary**: Cloud storage for video uploads
- **Multer**: Middleware for handling file uploads
- **bcrypt**: Password hashing
- **dotenv**: Environment variable management## Installation
To run this project locally, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/ateendra24/Youtube-Backend/.git
```2. Navigate to the project directory:
```bash
cd Youtube-Backend
```3. Install dependencies:
```bash
npm install
```4. Set up your environment variables. Create a `.env` file in the root directory and add the following:
```bash
PORT=8000
MONGODB_URL=
CORS_ORIGIN=*
ACCESS_TOKEN_SECRET=
ACCESS_TOKEN_EXPIRY=1d
REFRESH_TOKEN_SECRET=
REFRESH_TOKEN_EXPIRY=10dCLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
```5. Start the development server:
```bash
npm run dev
```## API Endpoints
Here are some of the key endpoints provided by this backend:
- **User Authentication**
- POST `/users/register` – User registration
- POST `/users/login` – User login- **Videos**
- POST `/videos/` – Upload a video
- GET `/videos/:id` – Get video details
- DELETE `/videos/:id` – Delete a video- **Playlists**
- POST `/playlist/` – Create a new playlist
- GET `/playlists/:id` – Get playlist details- **Comments**
- POST `/comments/:videoId/` – Add a comment to a video
- GET `/comments/:videoId/` – Get comments for a video## License
This project is licensed under the ISC License.
## Author
Created by Ateendra Pratap Solanki