secret-handshake app-key or capability; should likely not be changed as this makes you part of a different network (default "1KHLiKZvAvjbY1ziZEHMXawbCEIM6qwjCDm3VYRan/s=")
[`counterfeiter`](https://github.com/maxbrunsfeld/counterfeiter) enables generating mocks for defined interfaces. To update the mocks, run `go generate` in package roomdb.
### Database schema
This project uses [sql-migrate](https://github.com/rubenv/sql-migrate) to upgrade the sqlite database when necessary.
**Note**: similar to the web assets, you need to use `go test -tags dev` to test them. Afterwards run, `go generate` to embed the assets in the code and thus the resulting server binary.
### No ORM
We use [sqlboiler](github.com/volatiletech/sqlboiler) to generate type-safe Go code directly from SQL statements and table definitions. This approach suits the programming language much more then classical ORM approaches, which usually rely havily on reflection for (un)packing structs.
To generate them run the following commands. This will populate `admindb/sqlite/models`:
* (TODO: automate this with `go generate`)
```bash
# also included as generate_models.sh
cd admindb/sqlite
go test
sqlboiler sqlite3 --wipe
```
The generated package `admindb/sqlite/models` is then used to implemente the custom logic of the different services in `admindb/sqlite`.
Aside: I would have used `sqlc` since it's a bit more minimal and uses hand written SQL queries instead of generic query builders but it [currently doesn't support sqlite](https://github.com/kyleconroy/sqlc/issues/161).
### Development user creation
`cmd/insert-user` contains code to create a fallback user. Build it and point it to your database with a username:
```bash
cd cmd/insert-user
go build
# optional step: run a script to generate a valid ssb id @<pubkey>.ed25519, useful for trying things out quickly
Because of [issue #79](https://github.com/ssbc/go-ssb-room/issues/79) we can't simply create binaries for all platforms independantly. Therefore binaries for re-distributions need to be created on the relevant distributions themselvs. We currently do this for debian. The process is as follows: