Skip to content

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.

License

Notifications You must be signed in to change notification settings

ayush-sleeping/LaraBaseX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Β  LaraBaseX

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.

Product Name Screen Shot Product Name Screen Shot

Overview

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.



Table of content:

No. Topics
0. Tech Stack
1 Features and Integrations
2 Getting Started
3 Documentations
4 Folder Structure


Tech Stack

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



Features and Integrations

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



Getting Started

  1. Clone the repo:

    git clone https://github.com/ayush-sleeping/LaraBaseX.git
    cd LaraBaseX
  2. Install backend dependencies:

    composer install
  3. Install frontend dependencies:

    npm install
  4. Copy and configure environment files:

    cp .env.example .env
    • Update .env with your database credentials (MySQL recommended, SQLite supported).
    • Set up mail, cache, and other environment variables as needed.
  5. Generate application key:

    php artisan key:generate
  6. Run database migrations and seeders:

    php artisan migrate --seed
  7. Build frontend assets:

    npm run build
  8. Start the Laravel backend server:

    php artisan serve
    • Or use Docker for local development:
      docker-compose up
  9. Start the React frontend (Vite):

    npm run dev
  10. Access the app:

  11. 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



Documentations

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



Folder Structure

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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Languages