Naming conventions
Use the same words everywhere—Git branch, Fly app, Cloudflare hostname, and Atlas labels should trace back to the GitHub repo name without a lookup table.
Pattern list
Section titled “Pattern list”| Area | Pattern | Examples |
|---|---|---|
| Git branch (sacred) | staging, uat, main | Never production, prod, or master for deploy |
| Fly config file | fly.<branch>.toml | fly.staging.toml, fly.uat.toml, fly.main.toml |
| GitHub workflow | fly-deploy-<branch>.yml | fly-deploy-staging.yml, fly-deploy-main.yml |
| Fly app name | Repo name + tier suffix when needed | penn-station-api (prod), penn-station-staging-api, usfs-api-staging |
| Cloudflare hostname | Product URL; staging often prefixed | s-api-portal… → staging app, api-portal… → production |
| Tunnel origin | http://<fly-app-name>.internal:8080 | Must match Fly app = in fly.*.toml |
| Sentry project | Usually repo name | penn-station-api, usfs-api |
| MongoDB Atlas IP access | Label = Fly app + tier + egress | penn-station-staging-api — Fly egress iad |
Git repos — staging and main
Section titled “Git repos — staging and main”stagingbranch → staging Fly org, staging secrets, staging hostnames.mainbranch → production Fly org (file still namedfly.main.toml, notfly.production.toml).uatwhen the product has a UAT tier—same rules as staging.
See Branches and GitHub for the full sacred-branch table.
Fly — use the repo name
Section titled “Fly — use the repo name”- Start from the GitHub repo name (e.g.
penn-station-api,creed-api,usfs-api). - Production Fly
app =is often the repo name or repo + clear prod suffix (creed-api-prod,usfs-api-production)—pick one style per repo and stay consistent. - Staging adds a tier suffix:
-staging-api,-staging, or-staging-apipattern already in use—must match the Cloudflare.internalorigin.
Do not invent unrelated Fly app names that do not map to the repo.
MongoDB Atlas — IP access rule naming
Section titled “MongoDB Atlas — IP access rule naming”When an API uses a dedicated Fly egress IPv4 (see Fly.io):
-
Allocate egress once per Fly app:
fly ips allocate-egress --region iad -a <fly-app-name> --yes -
In Atlas → Network Access → IP Access List, add the egress IP (from
fly ips list, type egress). -
Name the rule so it is obvious in audits:
<fly-app-name> — Fly egress (iad)Examples:
penn-station-staging-api — Fly egress (iad),usfs-api-production — Fly egress (iad). -
One rule per Fly app per environment—staging egress ≠ production egress.
Mongo IP access rules rotate when egress is re-allocated or apps move tiers. That rotation is part of the SDLC timeline key-rotation goal—not a one-time setup.
Keys and credentials to manage
Section titled “Keys and credentials to manage”Rotation inventory with priority, what each key protects, and proposed schedule (mostly TBD today): Rotation inventory.
Related
Section titled “Related”- Branches · GitHub · Fly.io · Fly tunnel
- Timeline — key rotation and Mongo IP rule rotation on the roadmap
- Fly checklist — tier promotion