# GPTDefend.com

Marketing and download website for GPTDefend antivirus.

## Stack

- Next.js (App Router) + TypeScript
- Route Handler for OS-specific installer redirects (`/api/download`)

## Getting started

```bash
cp .env.example .env.local
npm install
npm run dev
```

Open [http://localhost:3000](http://localhost:3000).

## Download URLs

Set installer CDN URLs in `.env.local` when binaries are ready:

```bash
DOWNLOAD_URL_WINDOWS=https://cdn.example.com/gptDefend-setup.exe
DOWNLOAD_URL_MAC=
DOWNLOAD_URL_LINUX=
```

Then hit `/api/download?os=windows` (or `mac` / `linux`). Unset URLs return `503` until configured.

## Project layout

```
src/
  app/                 # App Router pages and API routes
  app/api/download/    # Installer redirect stub
  components/          # Shared UI (added during design conversion)
  lib/                 # Site config and download helpers
public/                # Static assets (design CSS/images come next)
```

## Production (PM2)

Build, then start with PM2. Port **7051** is set in `ecosystem.config.cjs` (not in `npm start`).

```bash
npm run build
pm2 start ecosystem.config.cjs
```

Or: `npm run pm2:start` / `npm run pm2:reload`. App listens on `0.0.0.0:7051`.

## Scripts

| Command             | Description                         |
|---------------------|-------------------------------------|
| `npm run dev`       | Development server                  |
| `npm run build`     | Production build                    |
| `npm run start`     | Run production server (port via env)|
| `npm run lint`      | ESLint                              |
| `npm run pm2:start` | Start via PM2 (`ecosystem.config.cjs`)|
| `npm run pm2:reload`| Reload PM2 app                      |
