View file File name : README.md Content :# Database Backup Manager A Laravel-based application for managing database backups with Google Drive integration and automated scheduling. ## Features ✨ **Core Features** - 📊 Dashboard with backup statistics - 🗄️ Manage multiple database configurations - 💾 Manual and automated backups - ☁️ Google Drive integration with OAuth 2.0 - 📅 Flexible scheduling (hourly, daily, weekly, monthly) - 📋 Backup history tracking - 📈 Success/failure status monitoring ## Quick Start Get up and running in minutes! See [QUICKSTART.md](QUICKSTART.md) for a step-by-step guide. ```bash # 1. Setup environment cp .env.example .env php artisan key:generate # 2. Configure database # Edit .env with your database credentials # 3. Run migrations php artisan migrate # 4. Configure Google Drive # Get credentials from Google Cloud Console # Add GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to .env # 5. Start the app php artisan serve ``` Visit http://localhost:8000 and start backing up! ## Documentation - **[Quick Start Guide](QUICKSTART.md)** - Get running in 15 minutes - **[Full Setup Guide](SETUP.md)** - Detailed installation and configuration - **[API Routes](SETUP.md#api-endpoints)** - Available endpoints ## System Requirements - PHP 8.2+ - MySQL 5.7+ or MariaDB 10.2+ - Composer - Google Cloud Account (for Drive integration) - `mysqldump` utility (usually included with MySQL) ## Project Structure ``` app/ ├── Console/Commands/ │ └── RunScheduledBackups.php # Scheduled backup runner ├── Http/Controllers/ │ ├── BackupController.php # Backup management │ ├── DatabaseConfigurationController.php │ ├── DashboardController.php │ └── GoogleDriveController.php # OAuth & Drive ops ├── Models/ │ ├── BackupHistory.php │ ├── BackupSchedule.php │ ├── DatabaseConfiguration.php │ └── GoogleDriveSetting.php └── Services/ ├── BackupService.php # Backup logic └── GoogleDriveService.php # Google Drive API database/migrations/ └── *_create_*.php # Database tables resources/views/ ├── layouts/app.blade.php # Main layout ├── dashboard.blade.php # Dashboard ├── databases/ │ ├── index.blade.php │ ├── create.blade.php │ └── edit.blade.php └── backups/ ├── index.blade.php # Backup history └── schedules.blade.php # Schedule management ``` ## Key Features Explained ### 1. Database Configuration Store credentials for multiple databases you want to backup. ### 2. Manual Backups Instantly backup any configured database to local storage and Google Drive. ### 3. Automated Schedules - **Hourly**: Every hour - **Daily**: Specific time each day - **Weekly**: Specific day and time - **Monthly**: Specific date and time ### 4. Google Drive Integration - OAuth 2.0 authentication - Secure token management - Automatic upload after backup - Track upload status in history ### 5. Backup History Complete audit trail with: - Database name - Filename and size - Success/failure status - Duration - Google Drive upload status - Error messages for failed backups ## Usage Examples ### Add a Database 1. Navigate to **Databases** 2. Click **+ Add Database** 3. Enter credentials and save ### Run a Backup 1. Go to **Dashboard** 2. Click **Backup Now** on any database 3. View results in **Backup History** ### Create a Schedule 1. Click **Schedules** in nav 2. Select database and frequency 3. Set preferred time 4. Click **Create Schedule** ### Connect Google Drive 1. Click **Dashboard** 2. Click **Connect Google Drive** 3. Authorize and you're set! ## Cron Job Setup For automated backups to work, add to your crontab: ```bash * * * * * cd /path/to/project && php artisan schedule:run >> /dev/null 2>&1 ``` **Windows**: Use Task Scheduler instead ## Commands ```bash # Run scheduled backups manually php artisan backups:run-scheduled # List all scheduled commands php artisan schedule:list # Interactive shell php artisan tinker ``` ## Security Considerations - ✅ Passwords encrypted in database - ✅ Google tokens secured - ✅ `.env` never committed - ✅ Input validation on all forms - ⚠️ Use HTTPS in production - ⚠️ Restrict file access - ⚠️ Use strong database passwords - ⚠️ Test restore procedures regularly ## Troubleshooting ### MySQL Connection Error - Check `.env` credentials - Verify MySQL is running - Ensure user has connection privileges ### Google Drive Upload Fails - Verify OAuth credentials in `.env` - Check Google Drive API is enabled - Reconnect Google Drive in dashboard ### Schedules Not Running - Verify cron job is active - Check cron logs - Run `php artisan backups:run-scheduled` manually See [SETUP.md](SETUP.md) for more troubleshooting. ## Technologies Used - **Framework**: Laravel 12 - **Database**: MySQL/MariaDB - **Backup**: mysqldump - **Cloud Storage**: Google Drive API v3 - **Frontend**: Tailwind CSS - **Authentication**: OAuth 2.0 ## License This project is open-sourced software licensed under the MIT license. ## Support - Check the [Setup Guide](SETUP.md) for detailed help - Review logs: `tail -f storage/logs/laravel.log` - Test database: `php artisan tinker` → `>>> DB::connection()->getPdo();` --- **Ready to get started?** Jump to [QUICKSTART.md](QUICKSTART.md) now!