Overview
SushiGo is a monorepo project with a Laravel API and React webapp. Development is done inside a Docker container using VS Code’s devcontainer feature for a consistent, isolated environment.Prerequisites
Before you begin, ensure you have installed:- Docker Desktop (latest version)
- VS Code with the “Dev Containers” extension (
ms-vscode-remote.remote-containers) - Git for version control
Quick Start
Configure hosts file
Add the following entries to your system’s hosts file:Linux/macOS:
Windows:
/etc/hostsWindows:
C:\Windows\System32\drivers\etc\hostsOn Linux/macOS, use:
sudo nano /etc/hostsOpen in VS Code
.devcontainer/devcontainer.json file and prompt you to reopen in container.Reopen in Container
Click “Reopen in Container” when prompted, or use:
- Press
Ctrl+Shift+P(orCmd+Shift+Pon macOS) - Select “Dev Containers: Reopen in Container”
Wait for container initialization
The container will automatically:
- Install PHP dependencies via Composer
- Install Node.js dependencies via npm
- Run database migrations
- Seed the database
- Generate Swagger documentation
Container Structure
The monorepo maps to the following paths insidedev_container:
| Sub-project | Host path | Container path |
|---|---|---|
| API (Laravel) | code/api/ | /app/code/api |
| Webapp (React) | code/webapp/ | /app/code/webapp |
| Documentation | doc/ | /app/doc |
Access URLs
After setup, you can access:| Service | URL | Credentials |
|---|---|---|
| Webapp | https://sushigo.local | [email protected] / admin123456 |
| Webapp (direct Vite) | http://localhost:5173 | - |
| API | https://api.sushigo.local/api/v1 | - |
| Swagger UI | http://localhost:8080/api/documentation | - |
| PgAdmin | http://localhost:5050 | [email protected] / admin |
| Mailhog | http://localhost:8025 | - |
Default Test Users
| Role | Password | |
|---|---|---|
| Super Admin | [email protected] | admin123456 |
| Admin | [email protected] | admin123456 |
| Inventory Manager | [email protected] | inventory123456 |
VS Code Extensions
The devcontainer automatically installs these recommended extensions:AI & Productivity
- GitHub Copilot
- GitHub Copilot Chat
- ChatGPT (OpenAI)
Laravel / PHP
- Laravel Extra Intellisense
- Laravel Goto Controller
- Laravel Artisan
- Intelephense (PHP IntelliSense)
- Laravel Blade
React / JavaScript / TypeScript
- ESLint
- Prettier
- ES7+ React/Redux snippets
- Auto Rename Tag
DevOps & Tools
- Docker
- Remote Containers
- GitLens
SSL Certificates
The development environment uses self-signed SSL certificates for HTTPS.Installing Root Certificate
- macOS
- Linux (Ubuntu/Debian)
- Windows
Clearing Chrome HSTS Cache
If you see SSL errors in Chrome, clear the HSTS cache:Delete domain security policies
In the “Delete domain security policies” section:
- Enter:
localhostorsushigo.local - Click Delete
Cmd+Shift+N (macOS) or Ctrl+Shift+N (Windows/Linux)
Database Setup
Creating Test Database
The test database is created automatically, but if you need to recreate it manually:Running Migrations and Seeders
Common Setup Issues
Port already in use
Port already in use
If ports 80, 443, 5432, or 5173 are already in use:
Permission denied errors
Permission denied errors
If you encounter permission errors in the container:
Database connection refused
Database connection refused
Wait for PostgreSQL to be fully ready:
Vite HMR not working
Vite HMR not working
If Hot Module Replacement doesn’t work:
- Ensure
sushigo.localis in your hosts file - Check
VITE_HMR_HOSTenvironment variable indocker-compose.yml - Restart the dev container:
Next Steps
Docker Compose
Learn about the Docker services architecture
Testing
Run backend, frontend, and E2E tests
Conventions
Follow project code and Git conventions