The cloud portion of Nidus
Find a file
Eli Ribble a2e67e3d60
Add oauth token failure model and notification
This will allow me to mark when an oauth token fails and surface it to
the user so that they can re-up on their auth token.
2025-11-11 20:10:56 +00:00
arcgis-go@c2a9e9811f Add initial synchronization of Fieldseeker data by oauth 2025-11-07 08:34:32 +00:00
dberrors Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
dbinfo Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
enums Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
factory Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
migrations Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
models Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
sql Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
static Add a basic main page with login 2025-11-03 22:13:19 +00:00
templates More compact interface for phone call mock 2025-11-11 02:12:42 +00:00
.air.toml Shorten the time waiting for air to kill my webserver 2025-11-07 08:46:26 +00:00
.gitattributes Add a basic main page with login 2025-11-03 22:13:19 +00:00
.gitignore Ignore air's temp building directory 2025-11-05 17:17:21 +00:00
.gitmodules Start using the ArcGIS client to get user data with the token 2025-11-06 22:28:56 +00:00
arcgis.go Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
auth.go Format all source files. 2025-11-06 22:31:51 +00:00
bobgen.yaml Add generated Bob database integration 2025-11-04 23:11:32 +00:00
database.go Create clean shutdown logic for http worker 2025-11-07 02:29:34 +00:00
default.nix Make buildable release for prod 2025-11-11 16:09:18 +00:00
endpoint.go Add phone call page 2025-11-10 22:43:31 +00:00
errors.go Save information about the organization and user from ArcGIS 2025-11-07 02:07:33 +00:00
fileserver.go Format all source files. 2025-11-06 22:31:51 +00:00
flake.lock Add a basic 'hello-world' buildable with Nix 2025-11-03 12:22:06 +00:00
flake.nix Add user sessions and login 2025-11-05 17:15:33 +00:00
go.mod Make buildable release for prod 2025-11-11 16:09:18 +00:00
go.sum Make buildable release for prod 2025-11-11 16:09:18 +00:00
html.go Add oauth token failure model and notification 2025-11-11 20:10:56 +00:00
lefthook.yml Add lefthook configuration for formatting 2025-11-06 22:31:29 +00:00
LICENSE Initial commit 2025-11-03 05:12:02 -07:00
main.go Add phone call page 2025-11-10 22:43:31 +00:00
README.md Save information about the organization and user from ArcGIS 2025-11-07 02:07:33 +00:00
response.go Format all source files. 2025-11-06 22:31:51 +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 .

Running

> 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

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