The cloud portion of Nidus
Find a file
Eli Ribble 679d12b48f
lint: fix errcheck for txn calls, query results, and unchecked errors
- Fix Rollback/Commit in compliance.go, csv/csv.go, csv/pool.go
- Capture and check errors from .One() insert queries in send.go, text.go
- Check errors from markFunc, PopulateURL, and hydrate functions
- Use lint.LogOnErrCtx for best-effort notification sends
2026-05-09 02:35:55 +00:00
api lint: fix errcheck for fmt.Fprintf/Fprint across multiple files 2026-05-09 02:21:53 +00:00
arcgis-go@63cc8b5737 arcgis-go bump 2026-04-17 20:55:11 +00:00
auth Initial work marking communications 2026-05-04 19:07:29 +00:00
cmd lint: fix errcheck for txn.Rollback/Commit and r.Close 2026-05-09 02:14:47 +00:00
comms Initial work marking communications 2026-05-04 19:07:29 +00:00
config Return communication database rows from communication API 2026-05-01 21:00:23 +00:00
db lint: fix errcheck for txn.Rollback/Commit and r.Close 2026-05-09 02:14:47 +00:00
debug Begin work on debugging user behavior in early setup 2026-01-06 14:46:31 +00:00
geomutil Remove now-extraneous latitude/longitude generated columns 2026-05-07 16:38:42 +00:00
go-geojson2h3@c2ff1a96ab Add mocks for data entry 2025-12-10 17:06:27 +00:00
h3utils RMO frontend checkpoint 2026-04-09 17:21:35 +00:00
html Initial work marking communications 2026-05-04 19:07:29 +00:00
http Improve signin messaging 2026-04-23 15:24:06 +00:00
label-studio lint: fix errcheck for Close and Write calls across multiple files 2026-05-09 02:29:07 +00:00
lint lint: fix errcheck for fmt.Fprintf/Fprint across multiple files 2026-05-09 02:21:53 +00:00
llm Return communication database rows from communication API 2026-05-01 21:00:23 +00:00
lob Improve error response from Lob integration 2026-04-28 22:14:05 +00:00
middleware lint: fix errcheck for fmt.Fprintf/Fprint across multiple files 2026-05-09 02:21:53 +00:00
minio Initial work marking communications 2026-05-04 19:07:29 +00:00
platform lint: fix errcheck for txn calls, query results, and unchecked errors 2026-05-09 02:35:55 +00:00
postgrid/cmd/send-pdf Save experiment in postgred integration 2026-04-03 15:25:15 +00:00
resource lint: fix errcheck for txn calls, query results, and unchecked errors 2026-05-09 02:35:55 +00:00
rmo lint: fix errcheck for Close and Write calls across multiple files 2026-05-09 02:29:07 +00:00
scss RMO frontend checkpoint 2026-04-09 17:21:35 +00:00
stadia lint: fix errcheck for Close and Write calls across multiple files 2026-05-09 02:29:07 +00:00
static lint: fix errcheck for Close and Write calls across multiple files 2026-05-09 02:29:07 +00:00
svg Add avatar placeholer when avatar is empty 2026-04-01 14:48:31 +00:00
sync lint: fix errcheck for Close and Write calls across multiple files 2026-05-09 02:29:07 +00:00
tools Add commands for creating the tegola user 2026-03-24 09:06:42 -07:00
ts Add centralized error handler for sync Vue app 2026-05-08 23:33:49 +00:00
version Get working sentry for the UI 2026-04-29 23:59:34 +00:00
vite Add centralized error handler for sync Vue app 2026-05-08 23:33:49 +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 Stop ignoring any paths with 'nidus-sync' in them 2026-05-09 01:38:07 +00:00
.gitmodules Build custom SCSS as part of nix package 2026-01-29 02:11:04 +00:00
.prettierrc Update prettier to format the new file types. 2026-03-21 19:39:30 +00:00
CLEANUP.md Remove dead query.go at project root 2026-05-09 01:05:29 +00:00
default.nix Copy vite build output to frontend in nix package 2026-04-30 03:09:06 +00:00
flake.lock Update go.mod to try harder to build on nix 2026-03-04 02:53:18 +00:00
flake.nix Remove dead esbuild build.js and flake.nix dependency 2026-05-09 01:03:51 +00:00
generate-icons.js Move SVGs into the frontend build pipeline 2026-03-21 21:27:50 +00:00
go.mod Switch to using the Gleipnir fork of jet 2026-05-09 01:48:56 +00:00
go.sum Switch to using the Gleipnir fork of jet 2026-05-09 01:48:56 +00:00
HISTORY.md Test of agent capabilities: 2026-05-09 00:54:39 +00:00
lefthook.yml Try a different way to limit linting 2026-05-04 19:43:20 +00:00
LICENSE Initial commit 2025-11-03 05:12:02 -07:00
main.go Fix a bunch of not-checking-error lints 2026-05-04 20:29:02 +00:00
package.json Add sentry integration with Vue frontend 2026-04-21 23:35:59 +00:00
pnpm-lock.yaml Add sentry integration with Vue frontend 2026-04-21 23:35:59 +00:00
pnpm-workspace.yaml Add CSS via SCSS to the frontend build pipeline 2026-03-21 19:14:51 +00:00
README.md Add information on resetting password 2026-04-06 15:58:04 +00:00
start-air.sh Read secrets when running air 2026-01-06 14:46:54 +00:00
start-flogo.sh Add a .env file 2026-03-24 09:06:42 -07:00
start-nidus-sync.sh Add company filter to Lob list addresses 2026-04-20 22:33:20 +00:00
start-nix-built.sh Add script for running output of "nix build" 2026-04-20 22:41:55 +00:00
tsconfig.json TypeScript checking is clean. 2026-03-22 02:55:17 +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;

  • 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 -d nidus-sync
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

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

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