A modern, feature-rich Laravel 12 + React 19 starter kit with comprehensive admin features, real-time notifications, and enterprise-grade security.
- Overview
- Features
- Tech Stack
- Requirements
- Quick Start
- Installation Guide
- Configuration
- Database Setup
- Running the Application
- Available Commands
- Project Structure
- Testing
- Deployment
- Troubleshooting
- Contributing
- License
A production-ready Laravel React starter kit that combines the power of Laravel 12's backend capabilities with React 19's modern frontend features. Built with Inertia.js for seamless SPA experience, TypeScript for type safety, and includes comprehensive admin features out of the box.
- Building modern web applications
- Admin dashboards & CMS
- SaaS applications
- Enterprise applications
- Rapid prototyping with production-ready features
- Laravel Fortify - Complete authentication system
- Two-Factor Authentication (2FA) - OTP-based 2FA with QR codes
- Role & Permission Management - Powered by Spatie Laravel Permission
- Session Management - View and revoke active sessions
- Email Verification - Built-in email verification
- Real-time Statistics
- Total users & active sessions
- Failed login attempts with charts
- Most accessed pages analytics
- Server resource monitoring (CPU, Memory, Disk)
- Blocked IPs statistics
- Email delivery rate tracking
- Beautiful UI - Modern, responsive design
- Interactive Charts - Visual data representation
- Real-time Notifications - WebSocket-powered via Laravel Echo
- Live Counter Updates - Auto-increment notification badge
- Broadcast Notifications - Push notifications to users
- Toast Notifications - Non-intrusive user alerts
- Admin Manual Notifications - Send notifications to specific users
- Advanced Rate Limiting - IP-based with auto-blocking
- Security Headers - CSP, HSTS, X-Frame-Options, etc.
- Blocked IPs/MACs Management - Manual & auto-blocking system
- Activity Logging - Track all user activities
- Login Attempt Tracking - Monitor failed login attempts
- Page Access Tracking - Monitor page views and response times
- Mail Logging - Track all sent emails
- Custom Email Templates - Blade-based templates
- Queue Support - Asynchronous email sending
- Mail Testing - Preview emails before sending
- System Health Monitoring - Powered by Spatie Laravel Health
- Database Health - Connection, size, and count monitoring
- Redis Health - Connection and memory usage
- Cache Health - Cache system status
- Queue Health - Queue worker status
- Disk Space Monitoring - Storage usage tracking
- Visual Dashboard - Beautiful health check UI
- Countries, Provinces, Regencies, Districts, Villages
- Complete Indonesia location data
- CRUD operations for all location types
- Modern Design - Built with shadcn/ui components
- Dark/Light Mode - Theme switching with next-themes
- Responsive Layout - Mobile-first design
- Data Tables - Powered by TanStack Table
- Form Validation - Client & server-side validation
- Loading States - Skeleton loaders & spinners
- TypeScript - Full type safety
- Laravel Wayfinder - Type-safe route helpers
- ESLint & Prettier - Code formatting & linting
- Hot Module Replacement - Fast development with Vite
- API Documentation - Clear inline documentation
- Laravel 12 - PHP framework
- PHP 8.2+ - Modern PHP features
- Inertia.js 2.0 - SPA without API
- Laravel Fortify - Authentication
- Spatie Packages:
- Laravel Permission - Roles & permissions
- Laravel Activity Log - Activity tracking
- Laravel Health - System health monitoring
- Redis - Cache & queue driver
- PostgreSQL/MySQL/SQLite - Database options
- React 19 - UI library
- TypeScript 5.7 - Type safety
- Inertia.js React - Server-side routing
- Vite 7 - Build tool
- Tailwind CSS 4 - Utility-first CSS
- shadcn/ui - Component library
- Radix UI - Unstyled UI primitives
- TanStack Table - Data tables
- Laravel Echo - WebSocket client
- Laravel Reverb - Real-time broadcasting
- Lucide React - Icon library
- Sonner - Toast notifications
- Pest - Testing framework
- Laravel Pint - Code style fixer
- ESLint - JavaScript linter
- Prettier - Code formatter
- Concurrently - Run multiple commands
Before you begin, ensure you have the following installed:
- PHP >= 8.2
- Composer >= 2.5
- Node.js >= 20.x
- npm >= 10.x (or yarn / pnpm)
- Database: PostgreSQL 13+, MySQL 8+, or SQLite 3
- Redis >= 6.x (for cache & queues)
- Git >= 2.x
php -v
composer -v
node -v
npm -vFor experienced developers who want to get started quickly:
# Clone the repository
git clone https://github.com/irhamumam17/laravel_react_starter
cd laravel_react_starter
# Install dependencies & setup
composer setup
# Configure environment
cp .env.example .env
# Edit .env with your database credentials
# Run migrations
php artisan migrate --seed
# Start development servers
composer devVisit http://localhost:8000 🎉
# Clone via HTTPS
git clone https://github.com/irhamumam17/laravel_react_starter.git
# OR clone via SSH
git clone git@github.com:irhamumam17/laravel_react_starter.git
# Navigate to project directory
cd laravel_react_startercomposer installThis will install all Laravel packages including:
- Laravel Framework
- Inertia.js
- Spatie packages
- Laravel Fortify
- And all other backend dependencies
npm install
# OR if you prefer yarn
yarn install
# OR if you prefer pnpm
pnpm installThis installs:
- React & React DOM
- TypeScript
- Vite
- Tailwind CSS
- shadcn/ui components
- All frontend dependencies
# Copy example environment file
cp .env.example .envEdit .env file with your configuration:
# Application
APP_NAME="Laravel React Starter"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost:8000
# Database (PostgreSQL example)
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
# OR SQLite (for quick testing)
# DB_CONNECTION=sqlite
# DB_DATABASE=/absolute/path/to/database.sqlite
# Redis (optional but recommended)
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
# Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
# Broadcasting (for real-time features)
BROADCAST_DRIVER=pusher
# Pusher Configuration (for WebSocket)
PUSHER_APP_ID=your_app_id
PUSHER_APP_KEY=your_key
PUSHER_APP_SECRET=your_secret
PUSHER_APP_CLUSTER=your_cluster
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
# Queue (recommended: redis for production, database for development)
QUEUE_CONNECTION=database
# Session
SESSION_DRIVER=database
SESSION_LIFETIME=120
# Cache
CACHE_DRIVER=redis # or 'file' if Redis not availablephp artisan key:generateThis generates a secure application key for encryption.
php artisan storage:linkCreates symbolic link from public/storage to storage/app/public.
# Create database file
touch database/database.sqlite
# Set in .env
DB_CONNECTION=sqlite
DB_DATABASE=/absolute/path/to/database.sqlite
# Run migrations
php artisan migrate --seed# Create database (using psql)
psql -U postgres
CREATE DATABASE your_database_name;
\q
# Set in .env
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
# Run migrations
php artisan migrate --seed# Create database (using mysql client)
mysql -u root -p
CREATE DATABASE your_database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
exit;
# Set in .env
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
# Run migrations
php artisan migrate --seedThe --seed flag will create:
- Default admin user
- Sample roles and permissions
- Test data (optional)
Default admin credentials:
Email: admin@admin.com
Password: password
Run all development servers simultaneously:
composer devThis will start:
- Laravel Server (
http://localhost:8000) - Queue Worker (for background jobs)
- Vite Dev Server (for HMR)
Start servers individually:
# Terminal 1: Laravel Server
php artisan serve
# Terminal 2: Queue Worker
php artisan queue:work
# Terminal 3: Vite Dev Server
npm run dev# Build frontend assets
npm run build
# Optimize Laravel
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Start with production server (e.g., nginx + php-fpm)# Setup project (install + migrate + build)
composer setup
# Start development servers
composer dev
# Run tests
composer test# Database
php artisan migrate # Run migrations
php artisan migrate:fresh --seed # Fresh database with seed
php artisan db:seed # Run seeders
# Cache
php artisan cache:clear # Clear application cache
php artisan config:clear # Clear config cache
php artisan route:clear # Clear route cache
php artisan view:clear # Clear view cache
# Queue
php artisan queue:work # Start queue worker
php artisan queue:listen # Start queue with auto-reload
php artisan queue:failed # List failed jobs
php artisan queue:retry all # Retry all failed jobs
# Health Check
php artisan health:check # Run health checks
# Generate TypeScript routes
php artisan wayfinder:generate # Generate route helpers
# Maintenance
php artisan down # Enable maintenance mode
php artisan up # Disable maintenance mode# Development
npm run dev # Start Vite dev server
# Production
npm run build # Build for production
npm run build:ssr # Build with SSR support
# Code Quality
npm run lint # Run ESLint
npm run format # Run Prettier
npm run format:check # Check formatting
npm run types # Check TypeScript types.
├── app/
│ ├── Actions/ # Fortify actions
│ ├── Console/ # Artisan commands
│ ├── Events/ # Event classes
│ ├── Http/
│ │ ├── Controllers/ # API & web controllers
│ │ ├── Middleware/ # Custom middleware
│ │ └── Requests/ # Form request validation
│ ├── Listeners/ # Event listeners
│ ├── Models/ # Eloquent models
│ ├── Notifications/ # Notification classes
│ ├── Observers/ # Model observers
│ ├── Providers/ # Service providers
│ └── Services/ # Business logic services
│
├── resources/
│ ├── css/ # Global styles
│ ├── js/
│ │ ├── actions/ # Wayfinder actions (auto-generated)
│ │ ├── components/ # React components
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom React hooks
│ │ ├── layouts/ # Page layouts
│ │ ├── lib/ # Utility functions
│ │ ├── pages/ # Inertia pages
│ │ ├── routes/ # Route helpers (auto-generated)
│ │ ├── types/ # TypeScript types
│ │ └── app.tsx # React entry point
│ └── views/ # Blade templates
│
├── routes/
│ ├── channels.php # Broadcast channels
│ ├── console.php # Console commands
│ ├── settings.php # Settings routes
│ └── web.php # Web routes
│
├── database/
│ ├── factories/ # Model factories
│ ├── migrations/ # Database migrations
│ └── seeders/ # Database seeders
│
├── tests/
│ ├── Feature/ # Feature tests
│ └── Unit/ # Unit tests
│
├── config/ # Configuration files
├── public/ # Public assets
├── storage/ # Storage files
└── vendor/ # PHP dependencies
composer test
# OR
php artisan testphp artisan test --filter=ExampleTestphp artisan test --coveragenpm run types # TypeScript type checking
npm run lint # ESLint- Set
APP_ENV=productionin.env - Set
APP_DEBUG=falsein.env - Generate new
APP_KEY - Configure production database
- Set up Redis for cache & queues
- Configure mail settings
- Set up Pusher for WebSocket
- Build frontend assets:
npm run build - Cache configs:
php artisan config:cache - Cache routes:
php artisan route:cache - Run migrations:
php artisan migrate --force - Set up queue worker (Supervisor)
- Set up scheduler cron job
- Configure web server (Nginx/Apache)
- Set up SSL certificate
- Configure backup strategy
Create /etc/supervisor/conf.d/laravel-worker.conf:
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/your/app/artisan queue:work redis --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=8
redirect_stderr=true
stdout_logfile=/path/to/your/app/storage/logs/worker.log
stopwaitsecs=3600Add to crontab:
* * * * * cd /path/to/your/app && php artisan schedule:run >> /dev/null 2>&1# Fix storage permissions
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache# Clear npm cache
npm cache clean --force
rm -rf node_modules package-lock.json
npm install# Clear Vite cache
rm -rf node_modules/.vite
npm run build- Check database credentials in
.env - Ensure database server is running
- Test connection:
php artisan migrate:status
# Restart queue worker
php artisan queue:restart
# Check failed jobs
php artisan queue:failed
# Retry failed jobs
php artisan queue:retry all- Verify Reverb credentials in
.env - Check browser console for errors
- Ensure
BROADCAST_DRIVER=reverb - Test with:
php artisan test:broadcast
Clear HSTS settings in browser:
- Chrome:
chrome://net-internals/#hsts→ Delete domain - Firefox: Clear history & cookies for localhost
- Solution: Disable HSTS in development (already configured)
- Check Laravel Documentation
- Check Inertia.js Documentation
- Check React Documentation
- Open an issue on GitHub
Additional documentation files:
- Dashboard Features - Admin dashboard documentation
- Health Check System - Health monitoring guide
- Real-time Notifications - Notification system
- Rate Limiting - Rate limiting configuration
- Security Features - Security setup guide
- Security Headers - Security headers configuration
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Run tests
composer test npm run types npm run lint - Commit your changes
git commit -m "feat: add amazing feature" - Push to your fork
git push origin feature/your-feature-name
- Create a Pull Request
- PHP: Follow PSR-12 standard (enforced by Laravel Pint)
- JavaScript/TypeScript: Follow project ESLint config
- React: Use functional components with hooks
- Commits: Follow Conventional Commits
- Code follows project style guidelines
- All tests pass
- New features have tests
- Documentation is updated
- No linter errors
This project is open-sourced software licensed under the MIT license.
Built with these amazing open-source projects:
- Laravel - Backend framework
- React - UI library
- Inertia.js - Modern monolith
- Tailwind CSS - Utility-first CSS
- shadcn/ui - Component library
- Spatie Packages - Laravel packages
- Laravel Fortify - Authentication
- Vite - Build tool
- TypeScript - Type safety
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: irham.umam36@gmail.com
Made with ❤️ by Muhammad Irhamul Umam