Netlify
SSR and Static Hosting
Netlify hosts two Amply sites:
| Site | URL | Framework | Rendering |
|---|---|---|---|
| Public Website | amply-impact.org (dev: dev.amply-impact.org) | Next.js 16 | SSR + ISR |
| Documentation | docs.amply-impact.org | Docusaurus | Static |
Why Netlify
| Feature | Benefit |
|---|---|
| Automatic deploys | Push to main → live in minutes |
| Preview deploys | Every PR gets a preview URL |
| Global CDN | Fast worldwide access |
| Free tier | Generous for documentation sites |
| Easy DNS | Simple CNAME setup |
Public Website (amply-web)
Repository
Repository: StayMeaty/amply-web
Branch: master
Build command: npm run build
Publish directory: .next
netlify.toml
[build]
command = "npm run build"
publish = ".next"
[[plugins]]
package = "@netlify/plugin-nextjs"
The @netlify/plugin-nextjs plugin enables full Next.js support on Netlify: server-side rendering, ISR (Incremental Static Regeneration), API routes, and middleware.
Environment Variables
| Variable | Purpose | Dev Value |
|---|---|---|
NEXT_PUBLIC_API_URL | Backend API base URL | https://api.dev.amply-impact.org/v1 |
NEXT_PUBLIC_SITE_URL | Canonical site URL (SEO, sitemap) | https://dev.amply-impact.org |
DNS Configuration
In Route 53 (see Route 53):
- Name: dev.amply-impact.org
Type: CNAME
TTL: 300
ResourceRecords:
- amply-web.netlify.app
SEO Protection (Non-Production)
Dev sites are blocked from search engine indexing via:
robots.tsreturnsDisallow: /whenIS_PRODUCTIONis false- Root layout adds
<meta name="robots" content="noindex, nofollow">on non-production
See Public Website Overview for full details.
Documentation Site (amply-docs)
Repository
Repository: StayMeaty/amply-docs
Branch: main
Build command: npm run build
Publish directory: build
netlify.toml
[build]
command = "npm run build"
publish = "build"
[build.environment]
NODE_VERSION = "20"
# SPA routing for Docusaurus
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Force HTTPS
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
X-XSS-Protection = "1; mode=block"
Referrer-Policy = "strict-origin-when-cross-origin"
DNS Configuration
In Route 53 (see Route 53):
- Name: docs.amply-impact.org
Type: CNAME
TTL: 300
ResourceRecords:
- amply-docs.netlify.app
Shared Netlify Settings
Domain Settings
SSL: Automatic (Let's Encrypt)
Force HTTPS: Enabled
Deploy Settings
Production Deploys
- Branch: main
- Auto-publish: Yes
- Deploy notifications: Slack channel
Preview Deploys
- Pull request previews: Enabled
- Deploy preview subdomain:
deploy-preview-{number}--amply-docs.netlify.app
Build Settings
Build command: npm run build
Publish directory: build
Functions directory: (none)
Environment Variables
| Variable | Purpose |
|---|---|
NODE_VERSION | Node.js version (20) |
DOCUSAURUS_URL | Base URL for sitemap |
Build Hooks
Webhook URL for triggering builds programmatically:
# Trigger rebuild (e.g., after content update)
curl -X POST -d {} https://api.netlify.com/build_hooks/XXXXXXXX
Monitoring
Deploy Notifications
Configure in Netlify UI:
- Deploy succeeded → Slack
- Deploy failed → Slack + Email
Analytics
Netlify Analytics (optional):
- Page views
- Top pages
- Bandwidth usage
Team Access
| Role | Permissions |
|---|---|
| Owner | Full access, billing |
| Developer | Deploy, settings |
| Viewer | View deploys only |
Costs
| Tier | Price | Limits |
|---|---|---|
| Starter (Free) | $0/month | 100GB bandwidth, 300 build minutes |
| Pro | $19/month | 1TB bandwidth, 25,000 build minutes |
Documentation site fits well within free tier.
Troubleshooting
Build Failures
# Check build logs in Netlify UI
# Common issues:
# - Node version mismatch
# - Missing dependencies
# - Build command errors
Cache Issues
# Clear cache and retry deploy
# In Netlify UI: Deploys → Trigger deploy → Clear cache and deploy site
Related: