# Frontend Deployment Guide

The shared-hosting deployment flow for this project now lives in [scripts/README_DEPLOY_WEB.md](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/scripts/README_DEPLOY_WEB.md).
The admin deployment flow now lives in [scripts/README_DEPLOY_ADMIN.md](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/scripts/README_DEPLOY_ADMIN.md).

Use that guide when deploying the public website to:

```bash
/home/fbrlwqbb/madibengwebsite.kitsonomouscorp.co.za
```

The admin module is now separated to:

```bash
https://admin.madibengwebsite.kitsonomouscorp.co.za
/home/fbrlwqbb/admin.madibengwebsite.kitsonomouscorp.co.za
```

For local Ubuntu/WSL usage, run the deployment scripts from:

```bash
/mnt/d/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite
```

In WSL, ensure `node` and `npm` are Linux binaries and Node.js is version 20 or newer before running the deploy scripts.

## Summary

- Public website pages can be exported and deployed to shared hosting.
- Admin routes under `/admin` are not included in that static deployment and are intended for the separate `admin.madibengwebsite.kitsonomouscorp.co.za` host.
- The deployment scripts build from a temporary copy of the app, so your local `frontend/` tree is not modified.

## Files

- [scripts/deploy_web_prod.sh](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/scripts/deploy_web_prod.sh)
- [scripts/deploy_web_dev.sh](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/scripts/deploy_web_dev.sh)
- [scripts/deploy_web_config.sh](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/scripts/deploy_web_config.sh)
- [scripts/deploy_admin_prod.sh](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/scripts/deploy_admin_prod.sh)
- [scripts/deploy_admin_dev.sh](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/scripts/deploy_admin_dev.sh)

## Next.js Behavior

[next.config.js](/D:/Casket/Business/KitsoCentric/Projects/Municipality/Madibeng/MadibengWebsite/frontend/next.config.js) now supports a conditional export mode:

- normal `npm run build` keeps the standard Next.js build
- `NEXT_OUTPUT_MODE=export npm run build` enables static export mode for the public site

This is used automatically by the shared-hosting deploy scripts.
