From cdd9536368ca161f6384adc9ea1592e6f9a30ade Mon Sep 17 00:00:00 2001 From: Alejandro Veras Date: Tue, 13 Oct 2026 09:37:53 -0400 Subject: [PATCH] Document VPS deployment and the environment variables --- .env.example | 9 ++++++ .gitignore | 1 + README.md | 85 +++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 74 insertions(+), 21 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6933ea4 --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +# Resend — sends contact form submissions by email +RESEND_API_KEY= +CONTACT_FROM="AI Growth Website " +# Optional: inbox for enquiries (defaults to rey@aigrowth360.io) +# CONTACT_TO= + +# Optional: Cloudflare Turnstile bot check +# TURNSTILE_SECRET_KEY= +# NEXT_PUBLIC_TURNSTILE_SITE_KEY= diff --git a/.gitignore b/.gitignore index 5ef6a52..7b8da95 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example # vercel .vercel diff --git a/README.md b/README.md index e215bc4..780cf1f 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,79 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# AI Growth Technologies — website -## Getting Started +Next.js 16 (App Router) site for aigrowthtechnologies.com. -First, run the development server: +## Local development ```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +npm ci +npm run dev # http://localhost:3000 ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## Environment variables -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +Copy `.env.example` to `.env.production` (or `.env.local` for development) and fill it in. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. +| Variable | Required | Purpose | +|---|---|---| +| `RESEND_API_KEY` | yes | Resend key with sending access to `aigrowthtechnologies.com`. Without it the contact form shows an error. | +| `CONTACT_FROM` | yes | Sender, on the domain verified in Resend: `AI Growth Website ` | +| `CONTACT_TO` | no | Inbox that receives enquiries. Defaults to `rey@aigrowth360.io`. | +| `TURNSTILE_SECRET_KEY` / `NEXT_PUBLIC_TURNSTILE_SITE_KEY` | no | Cloudflare Turnstile. When both are set, the form shows the challenge. `NEXT_PUBLIC_*` values are baked in at build time, so rebuild after changing it. | -## Learn More +## Deploying to a VPS -To learn more about Next.js, take a look at the following resources: +Requirements: Node.js 20.9 or newer (22 LTS recommended), npm, nginx, and a process manager such as pm2. -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +```bash +git clone https://github.com/AlejandroVeras/aigrowth-website.git +cd aigrowth-website +cp .env.example .env.production # then edit it +npm ci +npm run build +pm2 start npm --name aigrowth-website -- start -- -p 3000 +pm2 save && pm2 startup # restart on reboot +``` -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +To update later: -## Deploy on Vercel +```bash +git pull && npm ci && npm run build && pm2 restart aigrowth-website +``` -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. +### nginx -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +Put nginx in front of the Node server and turn off buffering so streamed pages arrive progressively: + +```nginx +server { + server_name aigrowthtechnologies.com www.aigrowthtechnologies.com; + + location / { + proxy_pass http://127.0.0.1:3000; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_buffering off; + } +} +``` + +Then issue HTTPS with `sudo certbot --nginx -d aigrowthtechnologies.com -d www.aigrowthtechnologies.com`. + +### DNS + +At Hostinger, point the `A` records for `@` and `www` to the VPS IP. Leave the MX records (Titan email) and the Resend +records (`send`, `resend._domainkey`) as they are. + +## Content + +Inner pages are generated from the Word copy decks: + +```bash +python3 -E scripts/convert-docs.py "" +``` + +This rewrites `src/content/pages/*.json`. The homepage (`src/app/page.tsx`) is written by hand.