doxa-life + doxa-maps drop-in CDN (public/doxa-maps-cdn) — Forgejo working copy
Find a file
2026-09-16 21:02:52 -05:00
app One place for the maps drop-in path 2026-09-16 19:20:00 -05:00
config replace deepl with llm translation via openrouter 2026-09-07 16:30:48 +01:00
i18n/locales add submit updates button to people group profile 2026-09-08 12:24:32 +01:00
migrations Let categories have child categories for nested pages. (#6) 2026-05-21 06:00:54 -05:00
modules Replace country pages with region dashboards (#23) 2026-09-07 11:49:24 +01:00
public Maps drop-in: religion tab night 2026-09-16 21:02:52 -05:00
scripts replace deepl with llm translation via openrouter 2026-09-07 16:30:48 +01:00
server One place for the maps drop-in path 2026-09-16 19:20:00 -05:00
.blueprints.json init 2026-04-21 12:12:54 +01:00
.editorconfig init 2026-04-21 12:12:54 +01:00
.env.example replace mailgun with sendgrid for transactional email 2026-09-15 11:16:44 +01:00
.gitignore Set up home, prayer, adopt and research maps 2026-05-21 03:45:15 -05:00
.mcp.json Implement CMS MCP 2026-04-29 13:06:54 +01:00
bun.lock replace mailgun with sendgrid for transactional email 2026-09-15 11:16:44 +01:00
eslint.config.mjs phase 1 2026-04-21 12:35:27 +01:00
i18n.config.ts phase 2 2026-04-21 13:27:38 +01:00
nuxt.config.ts One place for the maps drop-in path 2026-09-16 19:20:00 -05:00
package.json replace mailgun with sendgrid for transactional email 2026-09-15 11:16:44 +01:00
README.md Maps drop-in moves to /embed/doxa-maps-build; old /js links redirect 2026-09-16 19:05:50 -05:00
tsconfig.json init 2026-04-21 12:12:54 +01:00

doxa-life (doxa-maps-cdn)

The team's shared Nuxt app and CDN host for the Doxa maps. Static drop-in map builds live under public/embed/doxa-maps-build/, and the app serves the Mapbox token endpoint that those maps use at runtime.

Maps & map tokens

The maps support two providers: MapLibre and Mapbox.

MapLibre — no token required

MapLibre-based maps need no API token. The build sets var TOKEN_FREE = true; and mounts the map with an empty token (provider: 'maplibre', using window.maplibregl), skipping the token ladder entirely. See public/embed/doxa-maps-build/doxa-maps/demo-map/demo-map/maplibre/index.html.

Mapbox — requires a public (pk.) token

Mapbox-based maps do require a Mapbox public token (a pk. token).

Server endpoint — GET /api/maps/token (server/api/maps/token.get.ts) returns JSON { token, type } (with an optional expires_in):

  • If a public key (pk.) is configured, it is returned directly as { token, type: 'pk' }.
  • If a secret key (sk.) is configured, the endpoint JWT-decodes the SK to find the Mapbox username, calls the Mapbox Tokens API to mint a short-lived (1-hour) read-only temporary token (tk.), caches it in-process, and returns { token, type: 'tk', expires_in }. The sk. itself is read from a server-only runtime config entry and is never sent to the client.
  • If no key is configured, it responds with a 500 error.

Static drop-in maps — token ladder (precedence order): the built map pages resolve a Mapbox token by walking this ladder (see public/embed/doxa-maps-build/doxa-maps/doxa-simple-map/doxa-simple-map/engagement/index.html). Rungs 1–3 yield a token used directly, with no network call:

  1. A token hardcoded into the page's profile-config (config.tk)
  2. A ?tk= URL parameter carried in a shared link
  3. A baked build token inlined at build time (empty by default)

If none of those provide a token, the page resolves a token endpoint and fetches it — falling through window.MAP_TOKEN_URL, a configured TOKEN_SRC, then the same-origin /api/maps/token.

Configuring a deployment

Environment variable names come from .env.example:

  • NUXT_PUBLIC_MAPBOX_TOKEN — set this to your Mapbox public token (pk.…) and GET /api/maps/token will serve it directly. This is the simplest setup and is what the prayer map on /pray uses.
  • NUXT_MAPBOX_KEY (server-only, exposed as runtime config mapboxKey) — the endpoint prefers this if present. Set it to a secret key (sk.…) to have the server auto-mint short-lived tk. tokens; the secret never reaches the client. If set to a pk. token it is returned as-is.