···11+# atvouch
22+33+*atvouch is a proof of concept atproto app to let developers vouch for each others' skill.*
44+55+https://atvouch.dev
66+77+## how
88+99+1. two separate [tap](https://github.com/bluesky-social/indigo/tree/main/cmd/tap) instances:
1010+ atvouch needs a separate tap to be aware of all the prs being made in the world.
1111+ can't use a singular tap because its just for atvouch records (so if someone never interacted
1212+ with atvouch their pulls wont be tracked).
1313+2. [elixir](https://elixir-lang.org/) and [go](https://go.dev/) for the appview/backend
1414+3. [bun](https://bun.com/) for the frontend
1515+1616+### setup frontend
1717+1818+```
1919+# prefer local-frontend if you want to do changes there
2020+make local-frontend
2121+2222+# prod build (may need to edit OAUTH_BASE_URL for your usecase)
2323+make frontend
2424+2525+# atvouch.dev (prod) is on wisp.place, deploy like this:
2626+cd frontend/
2727+wispctl deploy -p dist/ -s atvouch.dev
2828+```
2929+3030+### setup appview
3131+3232+first tap for atvouch records:
3333+```
3434+mkdir tap_atvouch
3535+export TAP_DATABASE_URL=sqlite:///data/tap.db
3636+export TAP_BIND=127.0.0.1:2480
3737+export TAP_LOG_LEVEL=info
3838+export TAP_FULL_NETWORK=false
3939+export TAP_SIGNAL_COLLECTION=dev.atvouch.graph.vouch
4040+export TAP_COLLECTION_FILTERS=dev.atvouch.graph.vouch,dev.atvouch.bot.membership
4141+export TAP_FIREHOSE_PARALLELISM=4
4242+export TAP_RESYNC_PARALLELISM=5
4343+export TAP_DISABLE_ACKS=false
4444+tap
4545+```
4646+4747+then a second tap for tangled pull records:
4848+```
4949+mkdir tap_tangled
5050+export TAP_DATABASE_URL=sqlite:///data/tap.db
5151+export TAP_BIND=127.0.0.1:2481
5252+export TAP_LOG_LEVEL=info
5353+export TAP_FULL_NETWORK=false
5454+export TAP_SIGNAL_COLLECTION=sh.tangled.repo.pull
5555+export TAP_COLLECTION_FILTERS=sh.tangled.repo.pull
5656+export TAP_FIREHOSE_PARALLELISM=4
5757+export TAP_RESYNC_PARALLELISM=5
5858+export TAP_DISABLE_ACKS=false
5959+tap
6060+```
6161+6262+build and run appview's auth component:
6363+```
6464+cd appview/auth
6565+go build -o atvouch-auth
6666+6767+# on a server
6868+export ATVOUCH_ENDPOINT=https://api.atvouch.dev
6969+./atvouch-auth
7070+```
7171+7272+then build and run appview itself:
7373+```
7474+export PORT=6154
7575+export MIX_ENV=prod
7676+export ATVOUCH_DID=did:web:api.atvouch.dev
7777+export ATVOUCH_ENDPOINT=https://api.atvouch.dev
7878+export ATVOUCH_METRICS_TOKEN=abcdef # sync this with a prometheus to do bearer auth
7979+export ATVOUCH_DB_PATH="data/atvouch_prod.db"
8080+export TAP_URI="ws://localhost:2480/channel"
8181+export TAP_PASSWORD="123"
8282+export TAP_TANGLED_URI="ws://localhost:2481/channel"
8383+export TAP_TANGLED_PASSWORD="123"
8484+export TANGLED_BOT_HANDLE="atvouch.dev"
8585+export TANGLED_BOT_PASSWORD="...."
8686+cd appview
8787+8888+# download deps
8989+mix deps.get
9090+9191+# migrate db
9292+mix ecto.create
9393+mix ecto.migrate
9494+9595+# run server
9696+iex -S mix run
9797+```
9898+9999+configuring nginx and tls is left as an exercise to the operator