This repository combines a Laravel API backend with a React frontend in a single monorepo, configured to work with VS Code Dev Containers.
- Docker Desktop
- Visual Studio Code
- Dev Containers extension for VS Code
/api
- Laravel backend/client
- React frontend/.devcontainer
- Development container configuration
- Clone this repository
- Open in VS Code
- When prompted "Reopen in Container", click "Reopen"
- Wait for container build and initialization scripts
- Follow the prompts for Git configuration and package installation
Start the backend:
cd api
php artisan serve --host=0.0.0.0 --port=8000
Start the frontend:
cd client
npm run dev
Access your applications:
- API: http://localhost:8000
- Frontend: http://localhost:3000
- Test Backend:
cd api
php artisan serve --host=0.0.0.0 --port=8000
# In another terminal:
curl http://localhost:8000/api/test
# Should return: {"status":"ok"}
- Test Frontend:
cd client
npm run dev
# Visit http://localhost:3000 in browser
- Test Database:
cd api
php artisan migrate:status
If you encounter permission issues:
sudo chown -R vscode:vscode /workspace
chmod +x .devcontainer/scripts/*.sh
For database connection issues:
- Check .env file in /api
- Verify MySQL service is running
- Default credentials:
- DB_HOST=db
- DB_DATABASE=laravel
- DB_USERNAME=laravel
- DB_PASSWORD=secret