# Quick Reference - Development & Production

## TL;DR

Use **Makefile commands** to switch between development and production modes:

```bash
make dev          # Development mode (with HMR)
make frontend-dev # Start Vite dev server (after make dev)
make prod         # Production mode (with built assets)
make stop         # Stop containers
make help         # See all commands
```

---F

## Development Mode (Fast Iteration)

**When to use:** Daily development, writing new features

```bash
# 1. Start development environment
make dev

# 2. Start Vite for hot reload
make frontend-dev

# 3. Edit code in ./app directory
# Changes reload automatically!

# Access: http://localhost:83/admin/login
```

**What happens:**
- ✅ Code changes hot-reload instantly
- ✅ Debug mode enabled
- ✅ Vite dev server on port 5174
- ✅ Source code mounted as volume

---

## Production Mode (Testing Builds)

**When to use:** Before deployment, testing production builds

```bash
# Build assets and start production environment
make prod

# Access: http://localhost:83/admin/login
```

**What happens:**
- ✅ Uses pre-built optimized assets
- ✅ Debug mode disabled
- ✅ Automatically removes `hot` file
- ✅ Production-like environment

---

## Common Tasks

```bash
# Switch from dev to prod
make stop
make prod

# Switch from prod to dev
make stop
make dev
make frontend-dev

# Rebuild frontend assets
make frontend-build

# View logs
make logs

# Open shell in container
make shell

# Clean everything
make clean
```

---

## Troubleshooting

### UI not loading / blank page
```bash
# Remove hot file and restart
docker compose exec app rm -f public/hot
docker compose restart app
```

### Changes not reflecting (dev mode)
```bash
# Ensure Vite dev server is running
make frontend-dev
```

### Changes not reflecting (prod mode)
```bash
# Rebuild assets
make frontend-build
docker compose restart app
```

---

## Current Setup

**Admin App:** http://localhost:83/admin/login ✅ (Production mode)  
**Tenant App:** http://demo.localhost:81/login ✅

---

For detailed documentation, see `README_DEPLOYMENT.md`
