A RESTful API backend for a YouTube-like video-sharing platform, built with Laravel and MySQL.
- User authentication and authorization
- Video upload, streaming, and management
- Channel creation and subscription
- Commenting and liking system
- Playlist management
- Search functionality
- API documentation
- Framework: Laravel
- Language: PHP
- Database: MySQL
- Web Server: Nginx
- Containerization: Docker
- Package Manager: Composer
├── 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
-
Clone the repository:
git clone https://github.com/AHMED1CB/youtube-clone-api.git cd youtube-clone-api -
Copy the example environment file and configure it:
cp .env.example .env
-
Install PHP dependencies:
composer install
-
Generate application key:
php artisan key:generate
-
Run database migrations:
php artisan migrate
-
Start the development server:
php artisan serve
-
Build and run the Docker containers:
docker-compose up -d --build
-
Access the application: The API will be available at
http://localhost:8000.
POST /api/auth/register- Register a new userPOST /api/auth/login- Authenticate a userPOST /api/auth/logout- Logout the authenticated userPOST /api/auth- Get Profile Details
POST /api/videos- Retrieve all videosPOST /api/videos/upload- Upload a new videoPOST /api/videos/{slug}- Retrieve a specific videoPOST /api/videos/{id}/delete- Delete a videoPOST /api/videos/{id}/comment- Comment on VideoPOST /api/videos/{id}/savedata- Add View To Video And Save To User HistoryPOST /api/videos/{id}/react- React on Video
POST /api/channels/{channel}/subscribe- Subscribe ChannelPOST /api/channels/{username}- get Channel Data
POST /api/comments/- get All user CommentsPOST /api/comments/{comment}/update- Update CommentPOST /api/comments/{comment}/delete- Delete a comment
POST /api/- get All History Videos Of UserPOST /api/history/changestate- Pause or Start Saving History VideosPOST /api/history/clear- Clear History of user
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
Execute the test suite using PHPUnit:
php artisan testThis project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please fork the repository and submit a pull request.
For support or inquiries, open an issue on GitHub.