# CyberGuard — GoDaddy cPanel/Passenger deployment

This is a **new app I built from scratch** for this session — `apps/cyberguard-web`
was an empty directory in the repo (referenced by the root `package.json`'s
`dev:cyberguard` script and `.env.example`, but no source ever existed). It's
now real: a standalone Next.js marketing site that overlays live SOC stats
from the platform's public `GET /api/soc-stats` onto static marketing copy,
per the contract documented in `apps/web/app/api/soc-stats/route.ts`. The
actual source lives in the repo at `apps/cyberguard-web/` going forward, not
just in this zip.

Same deploy model as the other EtherTech Next.js apps: **not static
hosting** — needs GoDaddy's cPanel "Setup Node.js App" (Passenger), Node 20+.
Built and boot-tested before zipping (server starts, `GET /` returns `200`,
all four stat cards and their static fallback values render correctly).

## ⚠️ One build-time gotcha, specific to this app

`NEXT_PUBLIC_SOC_STATS_URL` (which platform origin to read live stats from)
gets **inlined into the client JS bundle at build time** — it is not
something you can just set as a cPanel environment variable after the fact,
unlike every other env var in the other EtherTech packages. This zip was
built with it pointed at a placeholder
(`https://your-ethertech-platform-domain.com`). Two ways to fix that:

1. **Rebuild it yourself** pointed at your real deployed platform origin:
   ```
   cd apps/cyberguard-web
   npm install
   NEXT_PUBLIC_SOC_STATS_URL=https://your-real-domain.com npm run build
   ```
   then re-run the packaging steps (copy `.next/static` and `public/` into
   `.next/standalone/`, as this zip already has done for the placeholder
   build).
2. Or deploy this zip as-is — the page still works and looks correct, it
   just always shows the static marketing numbers instead of live SOC
   figures (the fetch to the placeholder domain fails and the page falls
   back silently, exactly as designed for a platform-unreachable case).

## What's in the zip

```
app.js               ← Passenger entry point (requires ./server.js)
server.js            ← the real Next.js standalone server
.next/                ← compiled app + static assets
public/               ← favicon
package.json
node_modules/         ← only the production deps Next traced as actually used
```

This app was deliberately built standalone (just `next`/`react`/`react-dom`,
~58MB standalone bundle) — it isn't part of the monorepo's npm workspaces,
matching how it was already described in the root `.env.example` before any
code existed for it.

## Upload

1. Extract the zip into the Node app's application root on GoDaddy.
2. In cPanel → Setup Node.js App:
   - **Node version**: 20.x or newer
   - **Application root**: the folder you extracted into
   - **Application startup file**: `app.js` (or `server.js` directly)
   - **Application mode**: Production

`PORT` is injected automatically by Passenger — don't set it yourself.

## What it actually shows

- Hero section, four live-overlay-capable stat cards (Threats Neutralized,
  AI Detection Accuracy, Mean Time to Respond, Threat Enrichment Time — the
  last two are never populated by the live endpoint today, per its own code
  comments, so they always show the static marketing figure), a "Live view"
  card for the most recent IDS detection, a capabilities section, and a
  footer.
- No secrets, no auth, no database — it only ever does a public, read-only
  cross-origin fetch to the platform's already-CORS-open `/api/soc-stats`.
