| type | Guide | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | GitHub Codespaces | ||||||||||||||||||||||
| description | Run XYZ/MAPP in the browser from a fork in GitHub Codespaces, without a local install; use for a first try or a workshop. | ||||||||||||||||||||||
| tags |
|
||||||||||||||||||||||
| status | draft | ||||||||||||||||||||||
| sources |
|
A codespace runs VS Code and a Linux container in the browser. Everything in local development applies; this guide lists the steps which differ. It needs a GitHub account and nothing installed locally.1
Fork the repository from https://github.com/GEOLYTIX/xyz/fork. A codespace
also works on the public repository, but a fork keeps your changes. Only the
main branch is needed.
On the fork, open Code → Codespaces → Create codespace on main. The
repository has no .devcontainer, so GitHub's default image is used.
node -v # must be 22 or later
nvm install --lts # only if it is older
npm install -g pnpm@11 # the root packageManager pins pnpm 11.3.0
pnpm installmain carries the built MAPP and MAPP.UI bundles, so pnpm build is only
needed after changing apps/mapp or apps/ui, or on a development branch,
where the bundles are gitignored, see
release builds.2
public/workspace.json already exists in the repository with an OSM tile
layer on the default locale.3 Point the environment at it in a
root .env:
WORKSPACE=file:/public/workspace.jsonfile: paths resolve from XYZ_CWD, the repository root by default. The
workspace concepts describe locales and layers.
pnpm dev runs the server through Varlock, which reads .env together with
an .env.schema (copy both from varlock/, see
local development). In the Run and Debug
panel (Ctrl+Shift+D) a launch configuration can start the server instead; use
one which reads .env, see
running locally.
The program is apps/xyz/server.js. The root express.js of v4 is gone.
The Ports tab lists the forwarded port, 3000 by default. Open it to see the default view with the OSM layer. A port can be made public to open it in another browser or on a phone; anyone with the URL can then reach the instance.
- Add a PostGIS layer from a hosted database: Neon.
- Explore the layer keys and
location views. Things to try: name
the layer, display it by default, let users toggle edit mode, add a
typefield with the optionsNewandExistingand a theme on it, add infoj filters, and try the plugins inapps/mapp/lib/plugins. - Deploy to Vercel from the codespace terminal.