Files
preregister/documentation/Setup.md

117 lines
2.5 KiB
Markdown

# PreRegister — Quick Start (Docker)
## Prerequisites
- PHP >= 8.2 with extensions: mbstring, xml, curl, mysql, gd
- Composer >= 2.7
- Node.js >= 20
- Docker & Docker Compose
## Step-by-step setup
### 1. Create the Laravel project
```bash
composer create-project laravel/laravel preregister
cd preregister
```
### 2. Copy the project files into the Laravel root
Copy these files into the `preregister/` folder:
- `docker-compose.yml`
- `Makefile`
- `PreRegister-Development-Prompt.md`
### 3. Start the Docker containers
```bash
make up
# or: docker compose up -d
```
This starts three services:
| Service | URL | Purpose |
|---|---|---|
| MySQL 8.0 | `localhost:3306` | Database |
| phpMyAdmin | [http://localhost:8080](http://localhost:8080) | Database browser |
| Mailpit | [http://localhost:8025](http://localhost:8025) | Local email catcher |
### 4. Configure .env
Open `.env` and replace the DB and MAIL sections with:
```env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=preregister
DB_USERNAME=preregister
DB_PASSWORD=preregister
MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
QUEUE_CONNECTION=database
```
### 5. Install Breeze and build frontend
```bash
composer require laravel/breeze --dev
php artisan breeze:install blade
npm install
```
### 6. Run migrations and seed
```bash
php artisan migrate
php artisan db:seed # after seeders are created
```
### 7. Start developing
```bash
make dev
# This runs php artisan serve + npm run dev in parallel
# App: http://localhost:8000
```
### 8. Start Claude Code
Open a second terminal in the project root:
```bash
claude
```
Then paste:
> Read the file `PreRegister-Development-Prompt.md` in this project root. This is the full specification. Docker containers are already running (MySQL on 3306, phpMyAdmin on 8080, Mailpit on 8025). Breeze is installed. Start from Phase 1, Step 2 (create migrations). Work step by step and confirm before moving to the next phase.
## Useful commands
| Command | What it does |
|---|---|
| `make up` | Start Docker containers |
| `make down` | Stop Docker containers |
| `make fresh` | Drop all tables, re-migrate, re-seed |
| `make queue` | Start the queue worker (for Mailwizz sync) |
| `make dev` | Start Laravel + Vite dev servers |
| `make routes` | Show all registered routes |
| `make clear` | Clear all Laravel caches |
## Service URLs
| Service | URL |
|---|---|
| Application | http://localhost:8000 |
| phpMyAdmin | http://localhost:8080 |
| Mailpit (email UI) | http://localhost:8025 |