Run locally
Prerequisites
Section titled “Prerequisites”Make sure you have completed:
Quick start
Section titled “Quick start”With Laravel Herd (Recommended)
Section titled “With Laravel Herd (Recommended)”If you use Laravel Herd, the backend is automatically available at https://xetasuite-core.test.
-
Start backend services
Terminal window cd XetaSuite-corecomposer run devThis command launches:
- The Laravel server
- The queue worker
-
Start the frontend
Terminal window cd XetaSuite-Reactnpm run dev -
Access the application
Open
http://localhost:5173in your browser.
Without Herd
Section titled “Without Herd”cd XetaSuite-corephp artisan servecd XetaSuite-corephp artisan queue:workcd XetaSuite-Reactnpm run devDemo account
Section titled “Demo account”After running the seeders, you can log in with:
| Password | Role | |
|---|---|---|
admin@xetasuite.test | password | HQ Admin |
manager@xetasuite.test | password | Site 1 Manager |
user@xetasuite.test | password | Site 1 User |
Useful commands
Section titled “Useful commands”Backend
Section titled “Backend”# Run testsphp artisan test
# Run a specific testphp artisan test --filter=CompanyController
# Refresh the databasephp artisan migrate:fresh --seed
# Format codevendor/bin/pint --dirtyFrontend
Section titled “Frontend”# Development servernpm run dev
# Production buildnpm run build
# Run linternpm run lintTroubleshooting
Section titled “Troubleshooting”CORS errors
Section titled “CORS errors”Check that SPA_URL in .env matches your frontend URL:
SPA_URL=http://localhost:5173419 CSRF token mismatch
Section titled “419 CSRF token mismatch”Make sure you’re calling /sanctum/csrf-cookie before login:
await axios.get('/sanctum/csrf-cookie');await axios.post('/api/v1/auth/login', credentials);Session not persisting
Section titled “Session not persisting”Check these settings:
SANCTUM_STATEFUL_DOMAINS=localhost:5173,xetasuite.testSESSION_DOMAIN=localhost