Deployment

Deployment architecture and CI/CD procedures for the GetSmart Token platform.

Deployment

The GetSmart Token platform runs on Cloudflare Pages with Edge Workers for serverless functions. Deployments are automated from the main branch on GitHub.


Architecture

ComponentPlatformRepo
Main site (Next.js 15)Cloudflare Pagesgetsmart-web
Chatbot workerCloudflare WorkersCloudflare dashboard
AI Agent (standalone)gemma_airgap
Help docs (Hugo)Netlifygs_help_int
DatabaseMongoDB Atlas

Main Site — Cloudflare Pages

The main site (getstoken.org) is a Next.js 15 app compiled for Cloudflare Pages using @cloudflare/next-on-pages.

Build Command

npx @cloudflare/next-on-pages

Environment Variables (Cloudflare Dashboard)

VariablePurpose
NEXT_PUBLIC_GEMINI_API_KEY_1Google AI Studio API key (Gemma 4 cloud inference)
NEXT_PUBLIC_APP_URLPublic site URL
NEXT_PUBLIC_CHATBOT_URLCloudflare chatbot worker URL
COINBASE_CLIENT_IDCoinbase OAuth app ID
COINBASE_CLIENT_SECRETCoinbase OAuth secret
MONGODB_URIMongoDB Atlas connection string

Deployment Flow

  1. Push to main on GitHub
  2. Cloudflare Pages automatically builds (next build + next-on-pages)
  3. Deployment to production completes in ~2 minutes
  4. Edge Workers are updated globally via Cloudflare’s network

Important Notes

  • NEXT_PUBLIC_* variables must be set in Cloudflare Pages before the build runs — they are inlined at build time
  • Edge API routes (e.g. /api/chat) must use getRequestContext() from @cloudflare/next-on-pages to access Cloudflare env bindings at runtime
  • The export const runtime = 'edge' declaration is required on all API routes

Help Docs — Netlify

This documentation site is built with Hugo Extended and hosted on Netlify.

Build Command

npm run build   # runs hugo

Local Development

npm install     # installs hugo-extended
npm run serve   # http://localhost:1313

Or with Docker:

docker-compose up

Chatbot Worker

The GetSmart Assistant chatbot runs as a Cloudflare Worker at:

https://getsmart-chatbot.multipleintelligencesuk.workers.dev

It is embedded on the main site via a <script> tag in the layout.


CI/CD

  • Cloudflare Pages: automatic deploy on push to main (getsmart-web)
  • Netlify: automatic deploy on push to main (gs_help_int)
  • Dependabot: weekly dependency updates via PR

Rollback

To roll back Cloudflare Pages to a previous deployment:

  1. Go to the Cloudflare Pages dashboard
  2. Select the project → Deployments
  3. Find the previous successful deployment and click Rollback to this deployment

Submitting Documentation Issues

Submit a new issue to the gs_help_int repo for documentation corrections or improvements.


Internet Architecture

Current internet architecture and URL structure of the GetSmart Token platform.

Blue-Green Workflow Diagram

Blue-Green deployment strategy for the GetSmart Token Project’s Internet Architecture.

Database Synchronization in Blue-Green Deployments

A practical guide to database synchronization in Blue-Green deployments using snapshots and migrations.