The cloud portion of Nidus
  • Go 56.9%
  • Vue 18%
  • Swift 8.8%
  • TypeScript 6.8%
  • PLpgSQL 4.5%
  • Other 4.9%
Find a file
Eli Ribble 6f52b65e62
All checks were successful
/ golint (push) Successful in 9m59s
/ pnpm-build (push) Successful in 2m41s
/ gotest (push) Successful in 3m38s
/ pnpm-test (push) Successful in 27s
docs: promote the drive-plan design out of in-progress
Phases 1-6 are built and verified, which is the condition the design set for
its own promotion: the note is now the Operations Command Center's routing
design rather than a proposal, so it lives under the design tree instead of
in-progress.

The status block records what is true now — the decisions in §2 are what the
code obeys, and §14/§15 are kept as the plan the work landed against — and the
§13 promotion bullet records that it happened. Every code, migration and query
comment that cited the old path points at the new one; the migration changes a
leading comment only, so no applied schema moves.
2026-11-03 22:18:17 +00:00
.forgejo docs: replace the Node page generator with cmd/docgen 2026-10-21 21:19:50 +00:00
align planet align: parallelize the strip warp in warp_tile 2026-08-26 21:13:51 +00:00
api docs: promote the drive-plan design out of in-progress 2026-11-03 22:18:17 +00:00
arcgis-go@8f2898a159 Bump arcgis-go 2026-11-02 17:51:46 +00:00
auth auth: make a presented device bearer authoritative over session auth 2026-10-28 07:18:01 -07:00
catalogregistry registry: run the seed from the scheduler, not a command 2026-10-30 16:00:15 +00:00
cmd Consolidate the dev loop into one entrypoint, scripts/nidus-dev.mjs 2026-10-30 19:14:18 +00:00
comms Fix duplicate SMS on Voip.MS timeout 2026-08-27 19:43:43 +00:00
config valhalla: add the routing engine integration 2026-11-02 18:22:15 +00:00
container doc: repoint citations at the new tree; serve customer pages as HTML 2026-10-20 13:32:48 +00:00
db docs: promote the drive-plan design out of in-progress 2026-11-03 22:18:17 +00:00
debug Begin work on debugging user behavior in early setup 2026-01-06 14:46:31 +00:00
deepgram Use the Flux Sienna voice and speak every prompt situation 2026-09-15 07:43:15 +00:00
deploy Make cmd/paseo-host-router its own Go module 2026-09-11 16:59:30 +00:00
doc docs: promote the drive-plan design out of in-progress 2026-11-03 22:18:17 +00:00
etc Serve the Planning map through tegola, not a JSON read 2026-11-02 14:35:41 +00:00
extract feat(nlp): recognize the shared product catalog and push district products to Nidus Notes 2026-10-29 07:09:23 -07:00
generated/nlp feat(nlp): recognize the shared product catalog and push district products to Nidus Notes 2026-10-29 07:09:23 -07:00
geomutil Fix: set SRID 4326 on point geometry for CSV import 2026-07-12 03:11:48 +00:00
go-geojson2h3@c2ff1a96ab Add mocks for data entry 2025-12-10 17:06:27 +00:00
go-shp@6759ac7e08 Fix broken go-shp release 2026-08-13 14:01:21 +00:00
h3utils style: lowercase error strings across the codebase 2026-07-09 18:46:41 +00:00
html Give sample labels a public landing page and a QR URL 2026-10-22 17:55:38 +00:00
http Show more information or error with status when printing 2026-06-08 22:12:38 +00:00
internal feat(nlp): recognize the shared product catalog and push district products to Nidus Notes 2026-10-29 07:09:23 -07:00
knowledge extract: speak traps and resolve spoken datetimes 2026-10-16 07:05:59 -07:00
label-studio Fix unused import 2026-07-09 14:20:56 -05:00
lint platform: stop logging client-disconnect write errors on transform tiles 2026-08-27 19:42:53 +00:00
llm platform: rename MVP Core to Map Review 2026-10-20 22:57:48 +00:00
lob Fix API compatibility with resty.dev/v3 v3.0.0-rc.1 upgrade 2026-07-15 18:17:57 +00:00
local: Add sticky ground-truth layer design port to medres 2026-08-21 01:24:56 +00:00
mapvision-go@7ccfc11e7c Read MapVision treatment plans from the map layer 2026-10-23 16:05:53 +00:00
medres Compare the scoring gate against week boundaries, not capture times 2026-09-17 03:03:29 +00:00
middleware lint: remove unused code across api, comms, h3utils, html, middleware, minio, platform, rmo 2026-05-09 14:47:56 +00:00
minio style: lowercase error strings across the codebase 2026-07-09 18:46:41 +00:00
nemish doc: repoint citations at the new tree; serve customer pages as HTML 2026-10-20 13:32:48 +00:00
Nidus-iOS Nidus Notes: fix first-run tracking enrolment and Always authorization 2026-11-02 16:24:34 -07:00
NidusProductPronunciation feat(pronunciation): default the harness to the production recognition profile 2026-10-29 10:47:48 -07:00
nir nir: update the frozen legend palette in the metadata test 2026-09-19 20:53:30 +00:00
nix Update vectorsurv-go for release 2026-10-30 15:18:22 +00:00
orgtransfer vectorsurv: the sync report's routes, its ledger invalidation, and the registry's cutover 2026-10-28 14:34:49 +00:00
placer-mysql-feed@0b67b0a802 Update placer-mysql-feed 2026-08-24 22:54:43 +00:00
planet Distinguish an object-store signature rejection from a licensed-extent refusal 2026-09-17 02:44:04 +00:00
planet-go@e336e44b7a Update planet-go version 2026-09-17 01:44:32 +00:00
platform docs: promote the drive-plan design out of in-progress 2026-11-03 22:18:17 +00:00
postgrid/cmd/send-pdf Save experiment in postgred integration 2026-04-03 15:25:15 +00:00
procedural extract: speak traps and resolve spoken datetimes 2026-10-16 07:05:59 -07:00
prompting extract: speak traps and resolve spoken datetimes 2026-10-16 07:05:59 -07:00
queryspec platform: rename MVP Core to Map Review 2026-10-20 22:57:48 +00:00
resource docs: promote the drive-plan design out of in-progress 2026-11-03 22:18:17 +00:00
rmo Add short links with click tracking and campaign inspections 2026-09-04 21:19:33 +00:00
scripts dev: rebuild on embedded assets and disable Vite's HMR socket in middleware mode 2026-11-02 19:42:48 +00:00
scss docs: rule table cells in public doc stylesheet 2026-10-23 14:50:06 +00:00
speech nlp: generate the extraction vocabulary, goldens and stems from the engine tables 2026-09-19 09:45:56 -07:00
stadia Update files 2026-08-18 18:18:14 +00:00
static docs: replace the Node page generator with cmd/docgen 2026-10-21 21:19:50 +00:00
svg Add avatar placeholer when avatar is empty 2026-04-01 14:48:31 +00:00
sync feat: site tagging and generic map symbology 2026-10-27 15:35:50 +00:00
tegola doc: repoint citations at the new tree; serve customer pages as HTML 2026-10-20 13:32:48 +00:00
tools feat: site tagging and generic map symbology 2026-10-27 15:35:50 +00:00
ts operations: draw the drive plan, state its ETAs and read the day 2026-11-03 22:03:14 +00:00
vastai-go@4d5b14ba70 Move to latest vastai, initial release v0.0.1 2026-08-25 01:19:38 +00:00
vectorsurv-go@b4ae001186 Fix error from merging meek-mantis 2026-11-03 00:35:59 +00:00
version Move to setting version info explicitly in linker flags 2026-05-19 19:46:05 +00:00
vite Consolidate the dev loop into one entrypoint, scripts/nidus-dev.mjs 2026-10-30 19:14:18 +00:00
.air.toml Don't stop the server if there is a build error 2026-02-13 19:18:48 +00:00
.containerignore Initial creation of container image for opencode to run nidus-sync 2026-07-12 23:52:51 +00:00
.gitattributes Add a basic main page with login 2025-11-03 22:13:19 +00:00
.gitignore Stop forking the agent guide; append workspace rules instead 2026-10-30 19:14:18 +00:00
.gitmodules Register swift-h3 as nested submodule of nidus-sync; drop stale Nidus-iOS/.gitmodules 2026-09-03 07:53:04 -07:00
.golangci.yml tegola: serve MVT tiles in-process, org-scoped from the session 2026-10-13 20:10:07 +00:00
.prettierignore docs: replace the Node page generator with cmd/docgen 2026-10-21 21:19:50 +00:00
.prettierrc Update prettier config with latest flake update 2026-06-24 11:21:45 -05:00
AGENTS-WORKSPACE.md Stop forking the agent guide; append workspace rules instead 2026-10-30 19:14:18 +00:00
AGENTS.md Serve an inert Vite HMR client in the middleware dev app 2026-11-02 16:41:58 +00:00
default.nix Update pnpm hash 2026-11-02 18:14:00 +00:00
ensure-icons.js Regenerate custom icon styles before frontend builds 2026-09-08 22:30:09 +00:00
fake-xdg-open Initial creation of container image for opencode to run nidus-sync 2026-07-12 23:52:51 +00:00
flake.lock Use local nemish source to build containers 2026-08-13 21:59:52 +00:00
flake.nix Keep the dev shell independent of the working tree 2026-10-26 15:50:01 +00:00
generate-icons.js icons: tint custom line-art icons with currentColor 2026-10-27 14:25:16 +00:00
go.mod Update vectorsurv-go for release 2026-10-30 15:18:22 +00:00
go.sum Update vectorsurv-go for release 2026-10-30 15:18:22 +00:00
HISTORY.md Stop forking the agent guide; append workspace rules instead 2026-10-30 19:14:18 +00:00
lefthook.yml Pin the comms text tables to their production layout and add a migration drift check 2026-09-25 01:09:59 +00:00
LICENSE Initial commit 2025-11-03 05:12:02 -07:00
main.go Serve Traccar ingest, session and read routes 2026-11-02 18:14:09 +00:00
package-lock.json Add histogram of tasks instead of a table of tasks 2026-07-26 16:39:01 +00:00
package.json Build the Planning workbench and Operations Work queue 2026-11-02 14:35:40 +00:00
paseo.json Consolidate the dev loop into one entrypoint, scripts/nidus-dev.mjs 2026-10-30 19:14:18 +00:00
pnpm-lock.yaml Build the Planning workbench and Operations Work queue 2026-11-02 14:35:40 +00:00
pnpm-workspace.yaml feat: integrate maplibre-gl-terradraw with UI drawing playground 2026-07-24 17:08:35 +00:00
README.md valhalla: add the routing engine integration 2026-11-02 18:22:15 +00:00
result-align Retry transient nidus-sync failures with bounded backoff 2026-08-26 16:28:13 +00:00
sqlcheck.baseline Batch the ledger footer aggregates and count derived labels once per parent 2026-10-23 22:51:29 +00:00
TEST-PLAN.md Add test plan, update cleanup 2026-05-12 14:37:47 +00:00
tsconfig.json voice: read the UI vocabulary from the generated artifact 2026-09-19 09:46:00 -07:00
vitest.config.ts review/transcripts: Phase 4+5 — transcript review API + UI cutover 2026-09-02 15:25:42 +00:00

Nidus Sync

This is the software that powers Nidus Cloud Sync.

Administration

Password resets

If you need to manually reset a password you can do so with:

$ nix-shell -p genpass
$ genpass 12
abc123abc123
# this is from nidus, installed on deployment servers at the system layer
$ passwordgen
Please enter your password: abc123abc123
Password: abc123abc123
Hash: $2a$14$hdtoAtP7joczutY3bxaFqemBApH8xc5NbXLvDQqBfdzWV3jGSy4zi
$ psql -d nidus-sync
nidus-sync=> update user set password_hash='$2a$14$hdtoAtP7joczutY3bxaFqemBApH8xc5NbXLvDQqBfdzWV3jGSy4zi' where id=<something>;

Building from source

First, you'll need Nix.

Then:

nix develop
go build .

Building Custom Theme

We're using a customized Bootstrap theme for this site. You'll need to build the SCSS into CSS:

nix develop
sass --style=compressed --trace "$SASS_SRC_DIR/custom.scss":"$CSS_OUTPUT_DIR/bootstrap.css"

Running

You'll need a number of environment variables for configuring things;

Required

Variable Description
ARCGIS_CLIENT_ID Client ID for ArcGIS OAuth, configured with Esri
ARCGIS_CLIENT_SECRET Client secret for ArcGIS OAuth, configured with Esri
BIND Address and port to bind to. Use :9001 for any address, port 9001 (default)
DOMAIN_NIDUS Domain for the Nidus Cloud Sync site, used for forming callback URLs — e.g. sync.nidus.cloud
DOMAIN_RMO Domain for the RMO site — e.g. rmo.nidus.cloud
ENVIRONMENT Either PRODUCTION or DEVELOPMENT. Controls behaviour like OAuth token length
FIELDSEEKER_SCHEMA_DIRECTORY Directory to write FieldSeeker schema files for debugging
FILES_DIRECTORY Directory for writing first-order (backed-up) content: uploaded user data (audio, images), avatars, logos, CSVs, KML/KMZ, planet orders, public images, vision models
CACHE_DIRECTORY Directory for second-order, derivative content that is rebuilt in disaster recovery (normalized/transcoded audio, planet TIFs, tile caches, vision masks). Map to a separate, non-backed-up drive. Defaults to FILES_DIRECTORY if unset
FORWARDEMAIL_API_TOKEN API token for forwardemail.net
FORWARDEMAIL_RMO_ADDRESS Forward email address for RMO
FORWARDEMAIL_RMO_USERNAME Forward email SMTP username for RMO
FORWARDEMAIL_RMO_PASSWORD Forward email SMTP password for RMO
FORWARDEMAIL_NIDUS_ADDRESS Forward email address for Nidus
FORWARDEMAIL_NIDUS_USERNAME Forward email SMTP username for Nidus
FORWARDEMAIL_NIDUS_PASSWORD Forward email SMTP password for Nidus
LOB_API_KEY Lob.com API key for letter mailing services
PHONE_NUMBER_RMO RMO phone number used for reports (format: +1XXXXXXXXXX)
PHONE_NUMBER_SUPPORT Support phone number (format: +1XXXXXXXXXX)
POSTGRES_DSN DSN for connecting to the PostgreSQL database
SENTRY_DSN Sentry DSN for backend error tracking
SENTRY_DSN_FRONTEND Sentry DSN for frontend error tracking
STADIA_MAPS_API_KEY Stadia Maps API key used for geocoding and tile rendering
TEXT_PROVIDER SMS/MMS provider — must be twilio or voipms
TWILIO_ACCOUNT_SID Twilio Account SID
TWILIO_AUTH_TOKEN Twilio Auth Token
TWILIO_MESSAGING_SERVICE_SID Twilio Messaging Service SID
TWILIO_RCS_SENDER_RMO Twilio RCS sender identity for RMO
VOIPMS_NUMBER VoIP.ms phone number
VOIPMS_PASSWORD VoIP.ms password
VOIPMS_USERNAME VoIP.ms username

Optional

Variable Description
PLANET_API_TOKEN API key for the Planet Data API. If unset, Planet integration is skipped at startup
PLANET_CATALOG_CLIENT_ID OAuth2 client ID for the Planet Catalog API (requires PLANET_CATALOG_CLIENT_SECRET)
PLANET_CATALOG_CLIENT_SECRET OAuth2 client secret for the Planet Catalog API
DIGITAL_OCEAN_ACCESS_TOKEN Digital Ocean API token for vision worker auto-scaling
LAMBDA_LABS_API_KEY Lambda Labs API key for vision worker auto-scaling
VAST_AI_API_KEY Vast.ai API key for vision worker auto-scaling
VISION_WORKER_CONTAINER_IMAGE Container image URL (in the Forgejo registry) that auto-scaled instances run as the vision worker. The container defines the full worker software stack; connection and auth are injected as environment variables at instance creation. Required for auto-scaling on container-native providers (Novita AI, Vast.ai); scale-up fails before provisioning when unset
SSH_AUTHORIZED_KEYS SSH public keys to install on vision worker instances for developer debugging access. Content is appended to /root/.ssh/authorized_keys during the software install job
VERBOSE Set to any non-empty value to enable debug-level logging
PPROF_BIND Address and port for the pprof HTTP server (e.g. :6060). If unset, pprof is disabled
NIDUS_VALHALLA_URL Base URL of the routing engine's HTTP API. Defaults to http://127.0.0.1:8002 (the loopback listener the NixOS valhalla module binds)
NIDUS_VALHALLA_DATA_DIR The engine's state directory, where builds/<id>/ and the promotion marker live. Defaults to /var/lib/valhalla
NIDUS_VALHALLA_BIN_DIR Directory holding valhalla_build_* and osmium. Defaults to /run/current-system/sw/bin
NIDUS_VALHALLA_OSM_SOURCE OSM extract a tile build crops from. Defaults to Geofabrik's California extract
> DOMAIN_NIDUS=sync.nidus.cloud DOMAIN_RMO=rmo.nidus.cloud \
  ARCGIS_CLIENT_ID=foo ARCGIS_CLIENT_SECRET=bar \
  POSTGRES_DSN='postgresql://?host=/var/run/postgresql&dbname=nidus-sync' \
  ./nidus-sync

Tile endpoint

The preferred tile endpoint is GET /api/tile/{provider}/{type}/{z}/{x}/{y}. It accepts either an operator session or a worker Bearer secret.

provider is one of:

Provider Description
stadia Stadia Maps raster basemap
planet Planet imagery (mosaics and scene items)

type depends on the provider:

Provider Type Meaning
stadia alidade_satellite Satellite imagery + labels (JPEG)
stadia alidade_smooth Muted basemap designed for overlays (PNG)
planet mosaic A Planet basemap mosaic
planet pelican Pelican constellation scene items
planet skysat SkySat constellation scene items
planet any Any Planet constellation — highest-resolution item auto-selected

The ?source= query argument narrows the underlying source:

  • stadia: ignored — the type alone selects the style.
  • planet/mosaic: a mosaic ID. When omitted, the most recent downloadable mosaic is used.
  • planet/pelican, planet/skysat, and planet/any: an item ID. When omitted, the most recent item intersecting the tile is auto-selected (constellation-filtered for pelican/skysat; highest-resolution across all constellations for any).

Planet types honor the same rendering query arguments as the legacy vision tile endpoint:

Argument Applies to Description
asset_type pelican, skysat, any Planet asset type (default ortho_analytic_sr)
transform mosaic, pelican, skysat, any blue-excess, ndwi, blue-v-red, pixel-variation
band mosaic, pelican, skysat, any Single band (1-based)
bands mosaic, pelican, skysat, any r,g,b band indices (0 = skip)
brightness mosaic, pelican, skysat, any Brightness multiplier
clip pelican, skysat, any Pass through to the item tile renderer
offset stadia, pelican, skysat, any Half-pixel-offset tile

pelican, skysat, and any also support multipart output via Accept: multipart/x-mixed-replace.

Access constraints

Tiles are area-restricted for operator sessions by organization:

  • Users of the catch-all organization are unrestricted.
  • Other users are limited to tiles intersecting their organization's service area bounding box for stadia and planet/mosaic requests, and their satellite surveillance area bounding box for planet/pelican, planet/skysat, and planet/any requests. Requests outside the applicable bounds return 403.
  • Worker requests (Bearer secret) are unrestricted.

Hacking

air

This project uses air for fast compile-and-test loops. You can run it with:

> DOMAIN_NIDUS=sync.nidus.cloud DOMAIN_RMO=rmo.nidus.cloud \
  ARCGIS_CLIENT_ID=foo ARCGIS_CLIENT_SECRET=bar \
  POSTGRES_DSN='postgresql://?host=/var/run/postgresql&dbname=nidus-sync' air

bob

This uses the bob query framework. You can regenerate the models for bob with:

PSQL_DSN="postgresql://dbname?host=/var/run/postgresql&sslmode=disable" go run github.com/stephenafamo/bob/gen/bobgen-psql@latest"
PSQL_DSN="postgresql://?host=/var/run/postgresql&sslmode=disable&dbname=nidus-sync" go run github.com/stephenafamo/bob/gen/bobgen-psql@latest

This will generate a bunch of files. They're already committed, you only need this if you change the database schema in some way.

goose

This uses goose. You can use the goose command line to check status and make changes

> cd migrations
> GOOSE_DRIVER=postgres GOOSE_DBSTRING="dbname=nidus-sync sslmode=disable" goose status
> GOOSE_DRIVER=postgres GOOSE_DBSTRING="dbname=nidus-sync sslmode=disable" goose down
> GOOSE_DRIVER=postgres GOOSE_DBSTRING="dbname=nidus-sync sslmode=disable" goose up

svg icons

These icons are generated as part of the build system. You can generate them manually with:

pnpm generate-icons

This will produce an scss file at ts/gen/custom-icons.scss

Each icon's fill attributes decide how it is drawn, so an icon can be styled the way bootstrap-icons glyphs are (text-*, hover, active):

  • Line art — no fill, or every fill black — is emitted as a CSS mask painted with currentColor, so color reaches it.
  • Artwork — any other fill (the illustrations and the -color variants) is emitted as a background-image, and its own colours win.

typescript

In order to work on the TypeScript code you'll need to install the dependencies locally in your dev environment:

nix develop
pnpm install

You can then generate the TypeScript with:

pnpm watch

The only page that works right now is https://sync.nidus.cloud/template-test

watchexec

For iterating on styles

watchexec -e scss sass scss/custom.scss:static/gen/css/bootstrap.css

documentation site

The customer documentation at /doc/ is generated from Markdown. Sources live in doc/site/ (site.yaml is the navigation manifest); cmd/docgen renders them into static/gen/doc/, which the binary embeds. See doc/design/docs-site.md for the design.

Rebuild after editing a page or the manifest:

nix develop
pnpm run build-doc

pnpm run check-doc validates the manifest, internal links, and headings without writing output. The stylesheet is built separately:

pnpm run build-doc-css

In a DEVELOPMENT environment /doc/ is served from static/gen/doc on disk, so a rebuild plus a browser reload is enough — no backend restart. PRODUCTION serves the copy embedded at build time, so it needs a rebuild.

For continuous rebuilds, the dev shell ships watchexec:

watchexec -w doc/site -- pnpm run build-doc
watchexec -w scss/doc.scss -w ts/style/variables.scss -- pnpm run build-doc-css

In a worktree, the build-doc Paseo script runs the same rebuild.

testing

Run integration tests (with the actual database) with something like:

POSTGRES_DSN='postgresql://?host=/var/run/postgresql&dbname=nidus-sync-test' go test -tags integration ./db/query/comms