https://github.com/ahmed1cb/youtube-clone-api
A Restful Api of Youtube Clone
https://github.com/ahmed1cb/youtube-clone-api
api-rest database laravel youtube-api
Last synced: 3 months ago
JSON representation
A Restful Api of Youtube Clone
- Host: GitHub
- URL: https://github.com/ahmed1cb/youtube-clone-api
- Owner: AHMED1CB
- Created: 2025-05-26T06:08:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-21T08:09:06.000Z (12 months ago)
- Last Synced: 2025-10-14T18:33:47.744Z (9 months ago)
- Topics: api-rest, database, laravel, youtube-api
- Language: PHP
- Homepage: https://youtube-clone-api-dnru.onrender.com/api/
- Size: 2.38 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฌ YouTube Clone API
A RESTful API backend for a YouTube-like video-sharing platform, built with Laravel and MySQL.
---
## ๐ Features
- User authentication and authorization
- Video upload, streaming, and management
- Channel creation and subscription
- Commenting and liking system
- Playlist management
- Search functionality
- API documentation
---
## ๐ ๏ธ Technologies Used
- **Framework**: Laravel
- **Language**: PHP
- **Database**: MySQL
- **Web Server**: Nginx
- **Containerization**: Docker
- **Package Manager**: Composer
---
## ๐ Project Structure
```
โโโ app/ # Application core
โโโ bootstrap/ # Application bootstrap files
โโโ config/ # Configuration files
โโโ database/ # Migrations and seeders
โโโ public/ # Publicly accessible files
โโโ resources/ # Views and assets
โโโ routes/ # API and web routes
โโโ storage/ # Logs and file storage
โโโ tests/ # Test cases
โโโ Dockerfile # Docker configuration
โโโ .env.example # Environment variables example
โโโ composer.json # PHP dependencies
โโโ package.json # JavaScript dependencies
โโโ README.md # Project documentation
```
---
## ๐ฆ Installation
1. **Clone the repository:**
```bash
git clone https://github.com/AHMED1CB/youtube-clone-api.git
cd youtube-clone-api
```
2. **Copy the example environment file and configure it:**
```bash
cp .env.example .env
```
3. **Install PHP dependencies:**
```bash
composer install
```
4. **Generate application key:**
```bash
php artisan key:generate
```
5. **Run database migrations:**
```bash
php artisan migrate
```
6. **Start the development server:**
```bash
php artisan serve
```
---
## ๐ณ Docker Setup
1. **Build and run the Docker containers:**
```bash
docker-compose up -d --build
```
2. **Access the application:**
The API will be available at `http://localhost:8000`.
---
## ๐ API Endpoints
### ๐ Authentication:
- `POST /api/auth/register` - Register a new user
- `POST /api/auth/login` - Authenticate a user
- `POST /api/auth/logout` - Logout the authenticated user
- `POST /api/auth` - Get Profile Details
### ๐น Videos And Shorts:
- `POST /api/videos` - Retrieve all videos
- `POST /api/videos/upload` - Upload a new video
- `POST /api/videos/{slug}` - Retrieve a specific video
- `POST /api/videos/{id}/delete` - Delete a video
- `POST /api/videos/{id}/comment` - Comment on Video
- `POST /api/videos/{id}/savedata` - Add View To Video And Save To User History
- `POST /api/videos/{id}/react` - React on Video
### ๐บ Channels:
- `POST /api/channels/{channel}/subscribe` - Subscribe Channel
- `POST /api/channels/{username}` - get Channel Data
### ๐ฌ Comments:
- `POST /api/comments/` - get All user Comments
- `POST /api/comments/{comment}/update` - Update Comment
- `POST /api/comments/{comment}/delete` - Delete a comment
---
### ๐ฌ History:
- `POST /api/` - get All History Videos Of User
- `POST /api/history/changestate` - Pause or Start Saving History Videos
- `POST /api/history/clear` - Clear History of user
---
## ๐๏ธ Database Configuration
Ensure your `.env` file is configured with the correct database settings:
```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
```
---
## ๐งช Running Tests
Execute the test suite using PHPUnit:
```bash
php artisan test
```
---
## ๐ License
This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.
---
## ๐ค Contributing
Contributions are welcome! Please fork the repository and submit a pull request.
---
## ๐ซ Contact
For support or inquiries, open an issue on [GitHub](https://github.com/AHMED1CB/youtube-clone-api/issues).
---