The cloud portion of Nidus
Find a file
2026-03-07 01:37:48 +00:00
api Add type to communications response 2026-03-07 01:37:48 +00:00
arcgis Fix oauthforuser after rework of oauth token table 2026-02-28 23:24:00 +00:00
arcgis-go@624afd71d1 Update go.mod to try harder to build on nix 2026-03-04 02:53:18 +00:00
auth Add organization to all authorized endpoints 2026-03-06 22:08:08 +00:00
background Stop connecting to email websocket 2026-03-06 22:45:28 +00:00
cmd/passwordgen Remove unused query-test 2026-03-04 03:47:40 +00:00
comms Handle disabled IP address from Voip.ms 2026-02-18 22:11:30 +00:00
config Wire up sudo email form to send emails 2026-02-18 08:50:49 +00:00
db Add tile cache and relationship to organization map layer 2026-03-06 21:13:32 +00:00
debug Begin work on debugging user behavior in early setup 2026-01-06 14:46:31 +00:00
go-geojson2h3@c2ff1a96ab Add mocks for data entry 2025-12-10 17:06:27 +00:00
h3utils Finish green pool report submission 2026-01-09 19:43:19 +00:00
html Invert colors on selection for address and created info 2026-03-07 01:26:25 +00:00
http Move handler objects to common location to share with RMO 2026-03-03 17:08:58 +00:00
label-studio WIP migration of API from fieldseeker-sync 2025-12-16 16:37:53 +00:00
llm Update prompt document for mosquito LLM 2026-02-10 15:22:42 +00:00
minio WIP migration of API from fieldseeker-sync 2025-12-16 16:37:53 +00:00
notification Gracefully handle creating duplicate notifications 2026-02-12 21:06:08 +00:00
platform Add tile cache and relationship to organization map layer 2026-03-06 21:13:32 +00:00
rmo Remove unused search page from RMO 2026-03-06 14:12:02 +00:00
scss Avoid switching select item style 2026-03-07 01:25:11 +00:00
stadia Push geocoding down a layer 2026-03-04 18:29:52 +00:00
sync Create configuration for setting map service on organization 2026-03-06 22:45:53 +00:00
tomtom Add tomtom routing test 2026-02-25 16:13:28 +00:00
tools Update delete all tool to deal with new foreign keys 2026-03-06 19:01:00 +00:00
userfile Create upload directories on startup 2026-02-09 21:51:57 +00:00
.air.toml Don't stop the server if there is a build error 2026-02-13 19:18:48 +00:00
.gitattributes Add a basic main page with login 2025-11-03 22:13:19 +00:00
.gitignore Ignore build command passwordgen 2026-02-28 23:39:55 +00:00
.gitmodules Build custom SCSS as part of nix package 2026-01-29 02:11:04 +00:00
.prettierrc Format JavaScript files with prettier 2026-02-06 17:07:06 +00:00
default.nix Get proj build to work 2026-03-04 03:41:41 +00:00
flake.lock Update go.mod to try harder to build on nix 2026-03-04 02:53:18 +00:00
flake.nix Get proj build to work 2026-03-04 03:41:41 +00:00
go.mod Update go.mod to try harder to build on nix 2026-03-04 02:53:18 +00:00
go.sum Update go.mod to try harder to build on nix 2026-03-04 02:53:18 +00:00
lefthook.yml Format JavaScript files with prettier 2026-02-06 17:07:06 +00:00
LICENSE Initial commit 2025-11-03 05:12:02 -07:00
main.go Add debugging around staging environment not acting like prod 2026-03-05 19:17:16 +00:00
query.go Add ability to make LLM agent forget the conversation history 2026-01-27 18:44:02 +00:00
README.md Update scss tooling readme 2026-02-16 01:10:13 +00:00
start-air.sh Read secrets when running air 2026-01-06 14:46:54 +00:00
start-flogo.sh Merge aerial flyover and pool CSV row datatypes 2026-03-04 14:52:34 +00:00
start-nidus-sync.sh Add debugging around staging environment not acting like prod 2026-03-05 19:17:16 +00:00

Nidus Sync

This is the software that powers Nidus Cloud Sync.

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;

  • ARCGIS_CLIENT_ID - The client ID for ArcGIS oauth, configured with esri.
  • ARCGIS_CLIENT_SECRET - The client secret for ArcGIS oauth, configured with esri.
  • BASE_URL - The URL the site is hosted at, used for forming callback URLs. Should be complete like 'https://foo.bar'
  • BIND - The address and port to bind to. Use ':9001' for 'any address, port 9001'
  • ENVIRONMENT - either 'PRODUCTION' or 'DEVELOPMENT'. It's used to set things like oauth token length.
  • MAPBOX_TOKEN - The token to use with mapbox which is important for rendering maps.
  • POSTGRES_DSN - The DSN for connecting to the postgres database.
  • FIELDSEEKER_SCHEMA_DIRECTORY - The directory to write fieldseeker schema files for debugging.
  • USER_FILES_DIRECTORY - The directory for writing uploaded user data files (audio, images).
> BASE_URL=https://sync.nidus.cloud ARCGIS_CLIENT_ID=foo ARCGIS_CLIENT_SECRET=bar POSTGRES_DSN='postgresql://?host=/var/run/postgresql&dbname=nidus-sync' ./nidus-sync

Districts

There's a table containing district information in the database, import.district. It was created with:

psql
CREATE SCHEMA import;
shp2pgsql -s 3857 -c -D -I CA_districts.shp import.district | psql -d nidus-sync
psql
ALTER TABLE import.district ADD COLUMN geom_4326 geometry(MultiPolygon,4326) GENERATED ALWAYS AS (ST_Transform(geom, 4326)) STORED;

Hacking

air

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

> BASE_URL=https://sync.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

watchexec

For iterating on styles

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