Document VPS deployment and the environment variables
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
# Resend — sends contact form submissions by email
|
||||||
|
RESEND_API_KEY=
|
||||||
|
CONTACT_FROM="AI Growth Website <hello@aigrowthtechnologies.com>"
|
||||||
|
# Optional: inbox for enquiries (defaults to rey@aigrowth360.io)
|
||||||
|
# CONTACT_TO=
|
||||||
|
|
||||||
|
# Optional: Cloudflare Turnstile bot check
|
||||||
|
# TURNSTILE_SECRET_KEY=
|
||||||
|
# NEXT_PUBLIC_TURNSTILE_SITE_KEY=
|
||||||
@@ -32,6 +32,7 @@ yarn-error.log*
|
|||||||
|
|
||||||
# env files (can opt-in for committing if needed)
|
# env files (can opt-in for committing if needed)
|
||||||
.env*
|
.env*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
# vercel
|
# vercel
|
||||||
.vercel
|
.vercel
|
||||||
|
|||||||
@@ -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
|
```bash
|
||||||
npm run dev
|
npm ci
|
||||||
# or
|
npm run dev # http://localhost:3000
|
||||||
yarn dev
|
|
||||||
# or
|
|
||||||
pnpm dev
|
|
||||||
# or
|
|
||||||
bun dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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 <hello@aigrowthtechnologies.com>` |
|
||||||
|
| `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.
|
```bash
|
||||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
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 "<folder with the .docx files>"
|
||||||
|
```
|
||||||
|
|
||||||
|
This rewrites `src/content/pages/*.json`. The homepage (`src/app/page.tsx`) is written by hand.
|
||||||
|
|||||||
Reference in New Issue
Block a user