nidus-sync/README.md

42 lines
1.2 KiB
Markdown
Raw Normal View History

2025-11-03 12:13:48 +00:00
# Nidus Sync
This is the software that powers [Nidus Cloud Sync](https://sync.nidus.cloud).
2025-11-03 12:22:59 +00:00
## Building from source
First, you'll need [Nix](https://nix.dev).
Then:
```sh
nix develop
go build .
```
## Running
```sh
> 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
```
2025-11-04 23:11:32 +00:00
## Hacking
2025-11-05 17:17:03 +00:00
### air
This project uses [air](https://github.com/air-verse/air) for fast compile-and-test loops. You can run it with:
```sh
> 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
```
2025-11-04 23:11:32 +00:00
### 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.