Deployment Guide — Overview¶
This guide takes you from nothing to a running, secured app at oncall.totlcom.com, plus this documentation site at docs.oncall.totlcom.com. It assumes you've never used Cloudflare, GitHub, or a terminal. Follow the pages in order.
What you're building¶
Microsoft 365 sign-in
│
▼
┌───────────────────┐
You ─────────► │ Cloudflare Access │ (only TOTLCOM staff get past here)
└─────────┬─────────┘
▼
┌───────────────────────────────────────┐
│ Cloudflare Pages │
│ • React app (the screens you see) │
│ • API functions (/api/v1/*) │
│ • D1 database (people, schedule…) │
└───────────────────────────────────────┘
- Cloudflare Pages hosts the website and its API.
- Cloudflare D1 is the database (a SQLite database that lives in your Cloudflare account).
- Cloudflare Access + Microsoft 365 make sure only your staff can sign in.
- GitHub stores the code; Cloudflare watches it and auto-deploys whenever the code changes.
The order of operations¶
| Step | Page | What you'll do |
|---|---|---|
| 1 | Before you start | Install the few tools you need. |
| 2 | Cloudflare account & login | Create the account and log the CLI in. |
| 3 | Create the database (D1) | Make the database and record its ID. |
| 4 | Put the code on GitHub | Get the code into a GitHub repository. |
| 5 | Create the Pages project | Connect GitHub to Cloudflare Pages. |
| 6 | Environment variables | Set the app's settings (incl. admins). |
| 7 | Run database migrations | Create the tables in the live database. |
| 8 | Custom domain | Point oncall.totlcom.com at the app. |
| 9 | Microsoft 365 SSO | Lock the app behind staff sign-in. |
| 10 | Deploying updates | How to ship changes later. |
| 11 | Deploy this docs site | Publish these docs behind Access. |
Do them in order the first time
Each page builds on the previous one. After the initial setup, you'll mostly only revisit Deploying updates and occasionally Environment variables or Microsoft 365 SSO.
If something goes wrong, jump to Troubleshooting.