Skip to main content

Netlify

SSR and Static Hosting

Netlify hosts two Amply sites:

SiteURLFrameworkRendering
Public Websiteamply-impact.org (dev: dev.amply-impact.org)Next.js 16SSR + ISR
Documentationdocs.amply-impact.orgDocusaurusStatic

Why Netlify

FeatureBenefit
Automatic deploysPush to main → live in minutes
Preview deploysEvery PR gets a preview URL
Global CDNFast worldwide access
Free tierGenerous for documentation sites
Easy DNSSimple 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

VariablePurposeDev Value
NEXT_PUBLIC_API_URLBackend API base URLhttps://api.dev.amply-impact.org/v1
NEXT_PUBLIC_SITE_URLCanonical 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.ts returns Disallow: / when IS_PRODUCTION is 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

VariablePurpose
NODE_VERSIONNode.js version (20)
DOCUSAURUS_URLBase 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

RolePermissions
OwnerFull access, billing
DeveloperDeploy, settings
ViewerView deploys only

Costs

TierPriceLimits
Starter (Free)$0/month100GB bandwidth, 300 build minutes
Pro$19/month1TB 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: