# AAU Frontend Runbook

## Development

```bash
cd /home/frappe/frappe-bench/apps/aau_university/AAU-16.24
rm -f .next/dev/lock
npm run dev:hosted
```

- Domain target: `https://auusite.yemenfrappe.com`
- Local health check: `http://127.0.0.1:3000/api/health`

## Production Build

```bash
cd /home/frappe/frappe-bench/apps/aau_university/AAU-16.24
npm install
npm run build
npm run start:hosted
```

## systemd

```bash
sudo cp deploy/systemd/auusite-frontend.service /etc/systemd/system/auusite-frontend.service
sudo systemctl daemon-reload
sudo systemctl enable --now auusite-frontend
sudo systemctl status auusite-frontend --no-pager
```

## nginx

```bash
sudo cp deploy/nginx/auusite.yemenfrappe.com.conf /etc/nginx/conf.d/auusite.yemenfrappe.com.conf
sudo nginx -t
sudo systemctl reload nginx
```

## Verification

```bash
curl -I http://127.0.0.1:3000/api/health
curl -I https://auusite.yemenfrappe.com/api/health
curl -I https://auusite.yemenfrappe.com
```

## Recovery

```bash
sudo systemctl restart auusite-frontend
sudo systemctl status auusite-frontend --no-pager
journalctl -u auusite-frontend -n 100 --no-pager
```
