Skip to content

Commit a61f446

Browse files
tianzhouclaude
andcommitted
Convert site to Next.js static export for Cloudflare Pages
Rebuild the pgplex landing page (previously plain index.html/style.css) as a Next.js 16 + React 19 + Tailwind v4 app, mirroring the pgconsole website stack. The site is statically exported (output: 'export') to ./out and deployed to Cloudflare Pages. - App Router under src/app with shared components (Nav, Footer, Logo, Container, ProductCard, Elephant, ArchitectureDiagram) - Design ported to Tailwind v4 @theme tokens; fonts self-hosted via next/font (Geist Mono + Instrument Serif) - Cloudflare Pages deploy documented in README + GitHub Actions workflow - Assets moved to public/; orphaned pg.svg removed Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 52c5edf commit a61f446

23 files changed

Lines changed: 2060 additions & 555 deletions

‎.github/workflows/deploy.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
deployments: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: pnpm/action-setup@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
cache: pnpm
23+
24+
- run: pnpm install --frozen-lockfile
25+
26+
- run: pnpm build
27+
28+
- name: Deploy to Cloudflare Pages
29+
uses: cloudflare/wrangler-action@v3
30+
with:
31+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
32+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
33+
command: pages deploy ./out --project-name=pgplex

‎.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
node_modules/
2+
.next/
3+
out/
14
.DS_Store
5+
next-env.d.ts
6+
.wrangler/
7+
.env*.local

‎.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers=false

‎README.md‎

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
1-
# website
2-
pgplex.com
1+
# pgplex.com
2+
3+
Marketing site for [pgplex](https://github.com/pgplex) — the modern developer stack for PostgreSQL.
4+
5+
Built with **Next.js** (App Router) + **React 19** + **Tailwind CSS v4**, exported as a
6+
fully static site and deployed to **Cloudflare Pages**.
7+
8+
## Develop
9+
10+
```bash
11+
pnpm install
12+
pnpm dev # http://localhost:3000
13+
```
14+
15+
## Build
16+
17+
```bash
18+
pnpm build # static export → ./out
19+
```
20+
21+
`next.config.ts` sets `output: 'export'`, so `pnpm build` emits a static site into `./out`
22+
with no server runtime required.
23+
24+
## Deploy to Cloudflare Pages
25+
26+
### Option A — Git integration (recommended)
27+
28+
Connect the repo in the Cloudflare dashboard (**Workers & Pages → Create → Pages → Connect to Git**)
29+
and use these build settings:
30+
31+
| Setting | Value |
32+
| ---------------------- | -------------- |
33+
| Framework preset | Next.js (Static HTML Export) |
34+
| Build command | `pnpm build` |
35+
| Build output directory | `out` |
36+
| Node version (env var) | `NODE_VERSION = 22` |
37+
38+
Every push to `main` then builds and deploys automatically.
39+
40+
### Option B — Direct upload via Wrangler
41+
42+
```bash
43+
pnpm deploy # next build && wrangler pages deploy ./out
44+
```
45+
46+
Requires `wrangler login` (or `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` in the env)
47+
and a Pages project named `pgplex`. Preview a production build locally with `pnpm preview`.
48+
49+
A GitHub Actions workflow for Option B lives in `.github/workflows/deploy.yml`.

‎index.html‎

Lines changed: 0 additions & 188 deletions
This file was deleted.

‎next.config.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { NextConfig } from 'next'
2+
3+
const nextConfig: NextConfig = {
4+
// Emit a fully static site to ./out for Cloudflare Pages.
5+
output: 'export',
6+
// Cloudflare Pages serves the static export directly; skip the Image
7+
// Optimization API, which requires a server runtime.
8+
images: { unoptimized: true },
9+
// Serve each route as a directory with index.html (clean URLs on Pages).
10+
trailingSlash: true,
11+
}
12+
13+
export default nextConfig

‎package.json‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "pgplex-website",
3+
"version": "0.0.1",
4+
"private": true,
5+
"packageManager": "pnpm@10.17.1",
6+
"scripts": {
7+
"dev": "next dev",
8+
"build": "next build",
9+
"start": "next start",
10+
"preview": "wrangler pages dev ./out",
11+
"deploy": "next build && wrangler pages deploy ./out"
12+
},
13+
"dependencies": {
14+
"next": "^16",
15+
"react": "^19",
16+
"react-dom": "^19"
17+
},
18+
"devDependencies": {
19+
"@tailwindcss/postcss": "^4.1.18",
20+
"@types/node": "^20",
21+
"@types/react": "^19",
22+
"@types/react-dom": "^19",
23+
"tailwindcss": "^4.1.18",
24+
"typescript": "^5",
25+
"wrangler": "^4"
26+
}
27+
}

0 commit comments

Comments
 (0)