A Laravel 12 + ReactJS Full Stack Starter Boilerplate. This is a secure, modular, production-ready base project using Laravel 12 with ReactJS frontend, ideal for building scalable web applications without Blade.
What LaraBaseX Is
A starter kit for developers who want to skip repetitive setup work and start building features right away.
- Laravel 12 backend β clean REST API architecture, ready for production.
- ReactJS frontend β Vite-based, integrated with API, UI ready with Shadcn.
- Security baked in β CSRF, CORS, Rate limiting, Sanitization.
- Roles & Permissions β Spatie permissions + UI protection.
- Full CRUDs ready β Users, Employees, Enquiries.
- Deployment ready β Works with Docker, VPS, or shared hosting.
Why Itβs Useful
- Saves weeks of setup time by giving you authentication, authorization, logging, validation, helper functions, and database structure out of the box.
- Gives a modern dev experience β API response helpers, centralized error handling, custom commands, and frontend integration.
- Provides flexibility β you can scale it from small apps to enterprise-level solutions.
Included Major Features
- Backend β Laravel 12 API, Sanctum Auth, MySQL, Redis queues, Spatie permissions, custom helpers.
- Frontend β React + Shadcn UI, API integration, role-based UI.
- Dev Tools β PHPStan, Pest tests, ESLint, Pint, Postman tests, Docker dev setup.
- Security β HTTPS enforcement, CORS setup, CSRF tokens, rate limits.
- Production Ready β Queue workers, caching, mailers, exception logging, activity logs.
| No. | Topics |
|---|---|
| 0. | Tech Stack |
| 1 | Features and Integrations |
| 2 | Getting Started |
| 3 | Documentations |
| 4 | Folder Structure |
A modern tech stack for building scalable web applications.
- Backend: Laravel 12 (REST API)
- Frontend: ReactJS (Vite + Axios) + Shadcn UI
- Database: MySQL
- Authentication: Laravel Sanctum
- Deployment Ready: Docker / Shared Hosting / VPS
| Category | Integrations & Features |
|---|---|
| RDBMS | MySQL, SQLite (default) |
| Storage | Local, Unix File System |
| Message Queues | Redis, Database (queue driver), Supervisor (production) |
| Mailers | SMTP, Mailgun (via Laravel config) |
| Caching | Redis, File |
| Logging | Monolog, custom exception handler, Spatie Activity Log |
| Validations | FormRequest, custom validation rules |
| Transformers | API response helpers |
| Helpers | Centralized helpers for API, formatting, utilities |
| Internationalisation | Laravel's built-in i18n, language files |
| Console Commands | Custom Artisan commands, scheduler |
| Security | HTTPS, CORS, CSRF, Rate Limiting, Authorization, Input Sanitization |
| Frontend | ReactJS (Vite), Shadcn UI, Inertia.js SPA routing |
| Deployment | Docker, Shared Hosting, VPS |
| Authentication | Full login & registration flow with database-backed users |
| Dashboard | Working dashboard UI and backend |
| Roles & Permissions | Create/manage roles, assign permissions, protect routes and UI |
| User Management | Full users CRUD (create, read, update, delete) and assign Roles & Permissions |
| Employee Management | Employee CRUD (create, read, update, delete) and assign Roles & Permissions |
| Enquiry | Enquiry section for user/customer queries |
-
Clone the repo:
git clone https://github.com/ayush-sleeping/LaraBaseX.git cd LaraBaseX -
Install backend dependencies:
composer install
-
Install frontend dependencies:
npm install
-
Copy and configure environment files:
cp .env.example .env
- Update
.envwith your database credentials (MySQL recommended, SQLite supported). - Set up mail, cache, and other environment variables as needed.
- Update
-
Generate application key:
php artisan key:generate
-
Run database migrations and seeders:
php artisan migrate --seed
-
Build frontend assets:
npm run build
-
Start the Laravel backend server:
php artisan serve
- Or use Docker for local development:
docker-compose up
- Or use Docker for local development:
-
Start the React frontend (Vite):
npm run dev
-
Access the app:
- Backend API: http://localhost:8000
- Frontend: http://localhost:5173
-
Run tests and code quality checks:
- PHPStan (static analysis):
./vendor/bin/phpstan analyse
- Pest (unit/feature tests):
./vendor/bin/pest
- Pint (code style):
./vendor/bin/pint
- ESLint (frontend lint):
npm run lint
- Postman/Newman (API tests):
bash postman/test.sh
- Health check:
php test_health.php
- PHPStan (static analysis):
Comprehensive guides and references for the codebase.
| No. | Topics | Includes |
|---|---|---|
| 1 | Security Essentials Documentation | HTTPS Enforced, CORS Configured Properly, CSRF Protection and Others ... |
| 2 | Architecture & Structure Essentials | Helpers, Services, Job Queues, and Others ... |
| 3 | Packages to Include Documentation | Spatie Laravel Permission, Laravel Sanctum, and Others ... |
| 4 | Developer Experience Documentation | Global Exception Handler, Standard API Response, Seeder & Factory and Others ... |
| 5 | Frontend Integration Documentation | Serve React with Vite, Proxy Setup, React Router and Others ... |
| 6 | User Management Essentials | Auth APIs, Password Management, Roles & Permissions and Others ... |
| 7 | Helper Functions Documentation | Helper Functions |
| 8 | MySQL Best Practices Documentation | MySQL Best Practices |
| 9 | Deployment & Production Readiness | Deployment on server |
| 10 | Authentication Flow Documentation | Authentication Flow |
| 11 | Authorization Flow Documentation | Authorization Flow |
| 12 | Setting Profile Information Update | Profile Information Update |
| 13 | Setting Password Update | Password Update |
| 14 | Permission Based UI Implementation | Permission Based UI Implementation |
| 15 | LaraBaseX Postman Collection | Postman Collection |
| 16 | Testing | Testing Documentation |
LaraBaseX/
βββ app/
β βββ Http/
β β βββ Controllers/
β β β βββ Api/
β β β β βββ AuthController.php
β β β β βββ BaseApiController.php
β β β β βββ HomeController.php
β β β βββ Auth/
β β β β βββ AuthenticatedSessionController.php
β β β β βββ ConfirmablePasswordController.php
β β β β βββ EmailVerificationNotificationController.php
β β β β βββ EmailVerificationPromptController.php
β β β β βββ NewPasswordController.php
β β β β βββ PasswordController.php
β β β β βββ PasswordResetLinkController.php
β β β β βββ RegisteredUserController.php
β β β β βββ VerifyEmailController.php
β β β βββ Backend/
β β β β βββ DashboardController.php
β β β β βββ EmployeeController.php
β β β β βββ EnquiryController.php
β β β β βββ RoleController.php
β β β β βββ UserController.php
β β β βββ Frontend/
β β β β βββ (empty)
β β β βββ Settings/
β β β β βββ PasswordController.php
β β β β βββ ProfileController.php
β β β βββ Controller.php
β β β βββ HealthController.php
β β βββ Kernel.php
β β βββ Middleware/
β β β βββ AdminAccess.php
β β β βββ Authenticate.php
β β β βββ BasicAuth.php
β β β βββ EncryptCookies.php
β β β βββ ForceHttps.php
β β β βββ HandleAppearance.php
β β β βββ HandleInertiaRequests.php
β β β βββ PreventBackHistory.php
β β β βββ PreventRequestsDuringMaintenance.php
β β β βββ RedirectIfAuthenticated.php
β β β βββ Token.php
β β β βββ TrimStrings.php
β β β βββ TrustHosts.php
β β β βββ TrustProxies.php
β β β βββ ValidateSignature.php
β β β βββ VerifyCsrfToken.php
β β βββ Requests/
β β βββ Auth/
β β β βββ LoginRequest.php
β β βββ Settings/
β β β βββ ProfileUpdateRequest.php
β β βββ (empty)
β βββ Repositories/
β β βββ Contracts/ (empty)
β βββ Scopes/
β β βββ HierarchyScope.php
β βββ Services/
β β βββ BackupMonitoringService.php
β β βββ CacheWarmupService.php
β β βββ QueryCacheService.php
β βββ Traits/
β β βββ Cacheable.php
β β βββ Hashidable.php
β βββ helpers.php
βββ bootstrap/
β βββ cache/
β β βββ .gitignore
β β βββ config.php
β β βββ packages.php
β β βββ routes-v7.php
β β βββ services.php
β βββ app.php
β βββ providers.php
βββ config/
β βββ app.php
β βββ auth.php
β βββ backup.php
β βββ broadcasting.php
β βββ cache.php
β βββ cors.php
β βββ database.php
β βββ debugbar.php
β βββ filesystems.php
β βββ hashids.php
β βββ hashing.php
β βββ inertia.php
β βββ l5-swagger.php
β βββ logging.php
β βββ mail.php
β βββ permission.php
β βββ proxy.php
β βββ queue.php
β βββ sanctum.php
β βββ services.php
β βββ session.php
β βββ telescope.php
β βββ trusted.php
β βββ view.php
βββ database/
β βββ .gitignore
β βββ database.sqlite
β βββ factories/
β β βββ UserFactory.php
β βββ migrations/
β β βββ 0001_01_01_000000_create_users_table.php
β β βββ 0001_01_01_000001_create_cache_table.php
β β βββ 0001_01_01_000002_create_jobs_table.php
β β βββ 2025_08_01_000000_create_permissiongroups_table.php
β β βββ 2025_08_01_000001_create_permissions_table.php
β β βββ 2025_08_01_000002_create_roles_table.php
β β βββ 2025_08_01_000003_create_model_has_permissions_table.php
β β βββ 2025_08_01_000004_create_model_has_roles_table.php
β β βββ 2025_08_01_000005_create_role_has_permissions_table.php
β β βββ 2025_08_01_134338_create_personal_access_tokens_table.php
β β βββ 2025_08_04_000001_create_employees_table.php
β β βββ 2025_08_04_000002_create_enquiries_table.php
β β βββ 2025_08_04_075755_add_avatar_column_to_users_table.php
β β βββ 2025_08_08_063250_create_telescope_entries_table.php
β β βββ 2025_08_08_063402_create_activity_log_table.php
β β βββ 2025_08_08_063403_add_event_column_to_activity_log_table.php
β β βββ 2025_08_08_063404_add_batch_uuid_column_to_activity_log_table.php
β βββ seeders/
β βββ DatabaseSeeder.php
β βββ PermissionSeeder.php
βββ documentation/
β βββ 1. Security Essentials/
β βββ 2. Architecture & Structure Essentials/
β βββ 3. Packages to Include/
β βββ 4. Developer Experience (DX)/
β βββ 5. Frontend Integration (ReactJS)/
β βββ 6. User Management Essentials/
β βββ 7. Helper Functions/
β βββ 8. MySQL Best Practices/
β βββ 9. Deployment & Production Readiness/
β βββ 10. Authentication Flow Documentation/
β βββ 11. Authorization Flow Documentation/
β βββ 12. Setting Profile Information Update/
β βββ 13. Setting Password Update/
β βββ 14. Permission Based UI Implementation/
β βββ 15. Testing/
βββ lang/
β βββ en/
β βββ vendor/
βββ node_modules/
β βββ
βββ postman/
β βββ
βββ public/
β βββ .htaccess
β βββ apple-touch-icon.png
β βββ build/
β βββ favicon.ico
β βββ favicon.svg
β βββ index.php
β βββ logo.svg
β βββ robots.txt
βββ resources/
β βββ css/
β β βββ app.css
β βββ js/
β β βββ app.tsx
β β βββ ssr.tsx
β β βββ ziggy.js
β β βββ components/
β β βββ hooks/
β β βββ layouts/
β β βββ lib/
β β βββ pages/
β β β βββ auth/
β β β βββ backend/
β β β βββ frontend/
β β β βββ settings/
β β β βββ dashboard.tsx
β β β βββ error.tsx
β β β βββ welcome.tsx
β β βββ types/
β βββ views/
β βββ app.blade.php
β βββ vendor/
β βββ l5-swagger/
βββ routes/
β βββ api.php
β βββ auth.php
β βββ backend.php
β βββ channels.php
β βββ console.php
β βββ frontend.php
β βββ settings.php
β βββ web.php
βββ scripts/
β βββ phpstan.sh
βββ storage/
β βββ api-docs/
β βββ app/
β βββ debugbar/
β βββ framework/
β βββ logs/
β βββ pail/
βββ stubs/
β βββ
βββ tests/
β βββ Feature/
β βββ Pest.php
β βββ TestCase.php
β βββ Unit/
βββ vendor/
β βββ ... (all composer dependencies)
βββ .editorconfig
βββ .env
βββ .env.example
βββ .gitattributes
βββ .github/
βββ .gitignore
βββ .prettierignore
βββ .prettierrc
βββ LICENSE
βββ README.md
βββ artisan
βββ components.json
βββ composer.json
βββ composer.lock
βββ eslint.config.js
βββ package-lock.json
βββ package.json
βββ phpstan-baseline.neon
βββ phpstan.neon
βββ phpunit.xml
βββ postman/
βββ test_health.php
βββ tsconfig.json
βββ vite.config.ts

