The cloud portion of Nidus
Find a file
2026-02-18 08:28:19 +00:00
api Move data out of import.district and in to organization 2026-02-17 05:33:12 +00:00
arcgis Show actual information on oauth integration setting page 2026-02-13 21:14:46 +00:00
arcgis-go@80a5855ee8 Bump to arcgis-go v0.0.8 2026-02-17 19:55:06 +00:00
auth Add user account roles 2026-02-18 07:03:32 +00:00
background Don't panic if we don't have a FieldseekerURL 2026-02-17 07:05:10 +00:00
cmd Remove geocode test 2026-02-09 22:44:42 +00:00
comms Move emails to platform, make sure to create phone and email in DB 2026-02-10 04:07:59 +00:00
config Add initial integration with stadia maps for bulk geocoding 2026-02-14 15:41:38 +00:00
db Add user account roles 2026-02-18 07:03: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 Add simple example handler for admin functions 2026-02-18 08:02:32 +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 Move data out of import.district and in to organization 2026-02-17 05:33:12 +00:00
rmo Don't extract location if there is none 2026-02-17 20:17:32 +00:00
scss Add link to sudo powers 2026-02-18 07:36:54 +00:00
stadia Actually set geom and h3cell for uploaded pools 2026-02-14 16:49:54 +00:00
sync Actually send SMS on the test page 2026-02-18 08:28:19 +00:00
tomtom Show routing demonstration on radar page. 2026-02-18 04:57:12 +00:00
tools Move data out of import.district and in to organization 2026-02-17 05:33:12 +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 Rename htmlpage to html 2026-01-30 19:32:01 +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 Update deps for deployment 2026-02-17 20:04:16 +00:00
flake.lock Move to nixos pkg 25.11 base 2026-01-06 14:27:19 +00:00
flake.nix Add prettier for formatting html files automatically 2026-02-06 16:10:09 +00:00
go.mod Add simple example handler for admin functions 2026-02-18 08:02:32 +00:00
go.sum Add simple example handler for admin functions 2026-02-18 08:02:32 +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 caching headers for production, fix css for RMO 2026-02-17 22:27:51 +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

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