Local development
The repository is a pnpm workspace driven by Turborepo.[1] This concept replaces SETUP.md.[2]
The monorepo concept lists its packages: the XYZ API and server (apps/xyz), the MAPP and MAPP.UI libraries, the auth and SAML apps, and the devdb and testhost packages for tests. SETUP.md listed four apps and omitted apps/auth.
Each app has a README with app-specific usage. In the browser, without a local install, see Codespaces.
Prerequisites
gitand Node.js 22 or later. CI runs Node 22; there is noenginesfield.- pnpm 11. The root
packageManagerpinspnpm@11.3.0.[3]
Clone, install, build
git clone https://github.com/GEOLYTIX/xyz.git
cd xyz
pnpm install
pnpm buildThe MAPP and MAPP.UI bundles (public/js/lib, public/css/mapp.css, public/css/ui.css) are gitignored on the development branches, so a branch checkout must be built before the server can serve the default view. A checkout of main or a release tag, eg. --branch v5.0.7, already contains them. See release builds.
Environment
The server reads environment variables. The minimal configuration is the repository workspace with one OSM tile layer:
WORKSPACE=file:./public/workspace.jsonfile: paths resolve from XYZ_CWD, which defaults to the repository root, so file:/public/workspace.json resolves to the same file.
apps/xyz/server.js does not load .env itself; dotenv is no longer imported since v5.[4] An .env in the repository root is read when the process runs through Varlock, which the dev scripts do (varlock run -- node --inspect server.js, with loadPath set to the root).[5] Start from the examples in varlock/:
cp varlock/vanilla.env .env
cp varlock/vanilla.env.schema .env.schemaDeclare new variables in .env.schema, and mark secrets sensitive so Varlock redacts them. pnpm exec varlock load --compact validates the files. See varlock/README.md for secret managers.[6] Commit neither .env* nor .varlock.blob.
Variables often set locally: TITLE, SECRET or SECRET_KEY, DIR, PRIVATE/PUBLIC, DBS_*, CUSTOM_TEMPLATES, TRANSPORT_*, SAML_* and TRUSTED_RETURN_HOSTS. Look each up with pnpm knowledge:find <name>.
Databases and authentication
A database is only needed when the workspace, templates or ACL use one. Set a DBS_* connection per database. The ACL variables PRIVATE and PUBLIC take a connection string and the ACL table, separated by |; the schema defaults to public:
DBS_MAIN=postgres://user:password@localhost:5432/my_database
PRIVATE=postgres://user:password@localhost:5432/my_database|acl_schema.acl_tableSETUP.md showed PRIVATE=localhost:5432|user:password|acl_table, which the ACL module does not parse.[7] For a local PostGIS database without an install, run the devdb with pnpm --filter=@geolytix/xyz-devdb start (port 5433, or DEVDB_PORT); it prints a DBS_DEV connection string.[8] For a hosted database, see Neon.
A PRIVATE SAML instance sets AUTH_PATH=/saml; SAML_LOGIN was removed in v5.0.0. See apps/saml/README.md.
Run the server as described in running locally. For tests see TESTING.md, for the workflow and Biome DEVELOPING.md.
pnpm-workspace.yaml packages list. ↩︎
SETUP.md, folded into this concept. ↩︎
Root package.json
packageManagerand scripts. ↩︎Wiki Getting-started page. ↩︎
apps/xyz/package.json dev script and
varlock.loadPath. ↩︎varlock/README.md. ↩︎
apps/xyz/mod/user/acl.js splits
PRIVATEorPUBLICon|. ↩︎packages/devdb/start.js; the root has no
devdbscript. ↩︎