Host the PWA and every static site on App Platform

Open
#304 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, python

Research direction

Start with .do/sites.yaml and .do/production.yaml, then check DigitalOcean's current App Platform pricing and docs for the free tier requirements listed in the issue. Review the existing site build workflows and .nvmrc to confirm the build inputs and output paths. Done means both specs validate, the sites and PWA meet the listed hosting and routing criteria, and transfer monitoring is recorded; this work depends on #61, #62, and openpickleball/frontend#22.

Written by the indexing model from the issue text.

Description

area:infra priority:p2 size:M type:chore

Epic: #111

Problem: The backend is planned for DigitalOcean App Platform (#61, #62, #183), but OPEN's static sites are on GitHub Pages: the public site (openpickleball/frontend site/, at www.openpb.org) and the developer site (openpickleball/developers, at dev.openpb.org). The PWA (openpickleball/frontend app/, openpickleball/frontend#22) and the partner docs site (#184) have no host yet. Hosting is split across two providers, with two deploy paths, two places to manage domains and HTTPS, and no single cost picture. This issue moves every OPEN site onto App Platform, so the whole of OPEN deploys and is managed in one place.

Cost approach (multi-site workaround): App Platform's free static site allowance applies per app, not per static site. So every static site that does not need to share an origin with the API goes into one free app as separate static site components, as long as the app's combined outbound transfer stays within the free 1 GiB per month. The PWA is the exception: it must be served same-origin with the API (#182, #183), so it is a static site component of the production app.

Layout:

Host Source App
app.openpb.org openpickleball/frontend app/ (static build) production (.do/production.yaml, #61), with /api/, /_allauth/, /oauth/ routed to Django (#183)
api.openpb.org this repository production (#61, #183)
openpb.org, www.openpb.org openpickleball/frontend site/ sites app (free)
dev.openpb.org openpickleball/developers sites app (free)
partner.openpb.org openpickleball/partner-docs (#184), once it exists sites app (free)
status.openpb.org openpickleball/status (#139) stays on GitHub Pages, see Out of scope

Tasks:

  • Check the free tier against DigitalOcean's current pricing and App Platform docs, and record the findings here: that the free static site allowance and its 1 GiB transfer are per app, how many static site components one free app may hold, what happens past 1 GiB (overage price per GiB, or a cutoff), whether custom domains (apex included) are allowed on a free app, and what a static site component costs inside the paid production app
  • Create .do/sites.yaml: one app with a static site component per site in the table, each built from its own repository at main, each with its custom domain. No secret values in the spec
  • Public site component: build site/ with pnpm (Node version from .nvmrc), output site/public. Keep /.well-known/funding-manifest-urls served at openpb.org, and redirect www.openpb.org to openpb.org as Pages does today
  • Developer site component: build with uv and Zensical (uv sync --locked, zensical build --strict, output site). If App Platform's buildpacks cannot run this build, build it in GitHub Actions and deploy the output instead, and record which
  • Partner docs component: add it to the spec when #184 creates openpickleball/partner-docs; until then, note the planned component in the spec
  • PWA component in .do/production.yaml: the static build of app/ on app.openpb.org, with the catch-all route for client-side routing, next to the Django routes from #183. This needs openpickleball/frontend#22's adapter choice to be a static build
  • A custom 404 page and correct caching for each component (hashed assets cached long, HTML not cached), and the PWA's service worker and manifest served with the right headers
  • DNS: move openpb.org, www, dev, and partner from GitHub Pages to App Platform, with HTTPS on each. Check whether the apex domain needs DigitalOcean nameservers. Lower the TTLs before the switch so a rollback (pointing DNS back at Pages) is quick
  • Watch the sites app's monthly transfer against the 1 GiB limit, and set an alert (App Platform or billing) before it is reached. Add the sites app to the cost table in #61 and the README
  • After each site has run on App Platform for a week with no problem, in each site's repository: remove the Pages deploy job (keep the build job and its name, since teaser-build and build are required checks on main), turn off GitHub Pages, and update its README and CLAUDE.md. Open one issue in openpickleball/frontend and one in openpickleball/developers for this
  • Update #182's ADR (or add a note to it) and #184 to say each site is served from App Platform, and which app

Acceptance criteria:

  • doctl apps spec validate passes for .do/sites.yaml and .do/production.yaml
  • openpb.org, www.openpb.org, and dev.openpb.org are served over HTTPS from the sites app, with the same pages as on GitHub Pages
  • app.openpb.org serves the PWA from the production app, and its requests to /api/, /_allauth/, and /oauth/ are same-origin (#183)
  • The sites app stays on the free tier: its findings and the expected monthly transfer are recorded in this issue, and a transfer alert is set
  • The sites load while the production app is stopped
  • GitHub Pages is turned off for frontend and developers, and no site is served from it

Out of scope:

  • The status page (#139): it must keep working while OPEN is down, so it stays on GitHub Pages, outside DigitalOcean
  • The backend's own components, databases, and deploys (#61, #62, #63)
  • The PWA's adapter and build (openpickleball/frontend#22) and the partner docs site's content (#184)

Depends on: #61, #62, openpickleball/frontend#22 (for the PWA component)

Related: #182, #183, #184, #139

Size: M

Dominant language
Python
Stars
0
Forks
1
Avg merge
1h 7m
Merged PRs (30d)
206

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openpickleball/backend

All issues in openpickleball/backend

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.