Picast Laravel is a comprehensive web application built with Laravel framework, designed for managing domains with WHOIS tracking, YouTube video processing, and role-based user access control. The application follows Domain-Driven Design ( DDD) principles with a clean separation between business logic and technical implementation.
- π Domain Management: Complete CRUD operations for domain tracking with automated WHOIS updates
- π₯ User Role & Permission System: Flexible role-based access control using Spatie Laravel Permission
- π§ User Invitation System: Secure user onboarding via invite codes
- π Domain Expiration Monitoring: Automated reminders for domain renewal deadlines
- π₯ YouTube Video Processing: Download and manage YouTube videos with queue processing
- π± Telegram Notifications: Custom notification channel for important alerts
- π REST API: Comprehensive API for external integrations and automation
- π€ ChadGPT Integration: Chat bot system with conversation history and word statistics
- π Tournament Management: Tournament and group management system
- π³ Containerized Development: Full Docker environment for consistent development
- π Static Analysis: PHPStan at maximum level with Larastan for Laravel-specific analysis
- β¨ Code Quality: Laravel Pint for PSR-12 code formatting
- π§ͺ Comprehensive Testing: PHPUnit tests with coverage reports
- π CI/CD Pipeline: GitHub Actions for automated testing and deployment
- π API Documentation: Auto-generated OpenAPI documentation with Scribe
- Framework: Laravel 12.x
- PHP: 8.4+ (Latest stable version)
- Database: MySQL 8.3
- Cache: Memcached
- Queue: Laravel Queue with Supervisor
- Authentication: Laravel Sanctum for API tokens
- Build Tool: Vite 7.0+
- CSS Framework: Tailwind CSS 4.0
- JavaScript: Axios for HTTP requests
- UI: Laravel Blade templates
spatie/laravel-permission- Role and permission managementio-developer/php-whois- WHOIS data retrievalnorkunas/youtube-dl-php- YouTube video downloadingalaouy/youtube- YouTube API integrationirazasyed/telegram-bot-sdk- Telegram bot functionalityintervention/image- Image processingguzzlehttp/guzzle- HTTP clientknuckleswtf/scribe- API documentation generator
larastan/larastan- PHPStan for Laravellaravel/pint- Code style fixerbarryvdh/laravel-debugbar- Debug toolbarfakerphp/faker- Test data generation
- Containerization: Docker & Docker Compose
- Web Server: Nginx 1.17
- Process Manager: Supervisor for queue workers
- Email Testing: MailHog for development
- Database Admin: Adminer
- Debugging: XDebug with IDE integration
The application implements Domain-Driven Design (DDD) with the following structure:
app/Context/
βββ Domains/ # Domain management context
β βββ Domain/ # Business models and entities
β βββ Application/ # Services, policies, and contracts
β βββ Infrastructure/ # Controllers, jobs, and external integrations
βββ User/ # User management context
β βββ Domain/ # User-related models
β βββ Infrastructure/ # User controllers and services
βββ Youtube/ # YouTube processing context
β βββ Domain/ # Video models and entities
β βββ Application/ # Video processing services
β βββ Infrastructure/ # Video controllers and jobs
βββ ChadGPT/ # Chat bot context
β βββ Domain/ # Conversation and statistics models
β βββ Infrastructure/ # Chat controllers and services
βββ Tournaments/ # Tournament management context
βββ Domain/ # Tournament models and entities
βββ Infrastructure/ # Tournament controllers and services
- Docker & Docker Compose
- Make (for convenience commands)
- Git
-
Clone the repository:
git clone https://github.com/Simtel/picast-laravel.git cd picast-laravel -
Build Docker containers:
make build
-
Start the development environment:
make up
-
Install PHP dependencies:
make composer-install
-
Create environment configuration:
cp .env.example .env
Edit
.envfile with your configuration:DB_CONNECTION=mysql DB_HOST=db DB_PORT=3306 DB_DATABASE=picast DB_USERNAME=root DB_PASSWORD=example YOUTUBE_API_KEY=your_youtube_api_key TELEGRAM_BOT_TOKEN=your_telegram_bot_token
-
Create databases:
- Access Adminer at http://localhost:8080
- Login with: Server:
db, Username:root, Password:example - Create databases:
picastandpicast_test
-
Run database migrations:
make migrate
-
Seed the database with initial data:
make seed
-
Install and build frontend assets:
npm install npm run build
Once started, the following services will be available:
| Service | URL | Description |
|---|---|---|
| Application | http://localhost | Main application |
| Adminer | http://localhost:8080 | Database administration |
| MailHog | http://localhost:8025 | Email testing interface |
| API Documentation | http://localhost/docs | Interactive API docs |
| API Documentation | http://localhost/api/documentation | Interactive API docs |
make help # Show all available commands
make up # Start all containers
make down # Stop all containers
make restart # Restart containers
make cli # Access PHP container shell
make mysql-console # Access MySQL console
make migrate # Run database migrations
make seed # Seed database with test data
make test # Run PHPUnit tests
make test-coverage # Generate test coverage report
make phpstan # Run static analysis
make pint # Fix code style
make worker # Start queue workerThe application provides a comprehensive REST API for automation and external integrations.
https://your-domain.com/api/v1
API uses token-based authentication. Include the token in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN
GET /api/v1/user/current # Get current authenticated userGET /api/v1/domains # List all user domains
POST /api/v1/domains # Create new domain
GET /api/v1/domains/{id} # Get domain details with WHOIS
PUT /api/v1/domains/{id} # Update domain
DELETE /api/v1/domains/{id} # Delete domainGET /api/v1/video # List user videos
POST /api/v1/video # Queue video for download
GET /api/v1/video/{id} # Get video details
PUT /api/v1/video/{id} # Update video
DELETE /api/v1/video/{id} # Delete videocurl -X POST https://your-domain.com/api/v1/domains \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "example.com"}'curl -X POST https://your-domain.com/api/v1/video \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://youtube.com/watch?v=VIDEO_ID"}'All API responses follow a consistent JSON format:
{
"data": {
"id": 1,
"name": "example.com",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
},
"meta": {
"pagination": {
"current_page": 1,
"total": 50
}
}
}API errors return appropriate HTTP status codes with detailed error messages:
{
"message": "Validation failed",
"errors": {
"name": ["The name field is required."]
}
}For detailed API documentation with interactive examples, visit:
- Local: http://localhost/docs
- OpenAPI Spec: http://localhost/docs/openapi.yaml
# Run all tests
make test
# Run tests with coverage
make test-coverage
# Run specific test
docker exec -it picast_php php artisan test --filter DomainTest- Feature Tests:
/tests/Feature/- Integration tests for full workflows - Unit Tests:
/tests/Unit/- Isolated unit tests for specific components - API Tests:
/tests/Feature/Api/- API endpoint tests
# Run PHPStan analysis
make phpstan
# Fix code style
make pintSet up Git hooks for automatic code quality checks:
make set-githooks- PHP 8.3+
- MySQL 8.0+
- Nginx or Apache
- Supervisor for queue workers
- SSL certificate for HTTPS
Key environment variables for production:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-domain.com
# Database
DB_CONNECTION=mysql
DB_HOST=your-db-host
DB_DATABASE=picast
DB_USERNAME=your-db-user
DB_PASSWORD=your-secure-password
# External APIs
YOUTUBE_API_KEY=your-youtube-api-key
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
# Queue
QUEUE_CONNECTION=database
# Cache
CACHE_DRIVER=memcached
MEMCACHED_HOST=127.0.0.1- Clone repository to production server
- Install PHP dependencies:
composer install --no-dev --optimize-autoloader - Configure environment variables
- Run migrations:
php artisan migrate --force - Build assets:
npm run build - Set up queue workers with Supervisor
- Configure web server (Nginx/Apache)
- Set up SSL certificate
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes following PSR-12 standards
- Run tests:
make test - Run static analysis:
make phpstan - Fix code style:
make pint - Commit changes:
git commit -am 'Add new feature' - Push to branch:
git push origin feature/new-feature - Create Pull Request
This project is licensed under the MIT License.
For issues and questions:
- Create an issue on GitHub
- Check the API documentation for API-related questions
- Review test files for usage examples