Built for people who think better out loud.
1# slipnote
2
3Monorepo layout:
4
5- `frontend/`: Astro frontend
6- `backend/`: Rust Axum backend
7
8## Frontend
9
10```sh
11cd frontend
12pnpm install
13pnpm dev
14```
15
16## Backend
17
18```sh
19cd backend
20cargo run
21```
22
23### OAuth env vars
24
25The backend requires these OAuth settings to enable ATProto auth:
26
27- `OAUTH_CLIENT_ID` (e.g. `https://your-app.com/oauth/client-metadata.json`)
28- `OAUTH_REDIRECT_URI` (e.g. `https://your-app.com/oauth/callback`)
29- `OAUTH_SIGNING_KEY` (did:key private key for client assertions)
30
31Generate a signing key with the built-in helper:
32
33```sh
34cd backend
35cargo run --bin oauth_keygen
36```
37
38Set the output as `OAUTH_SIGNING_KEY`.
39
40Optional settings:
41
42- `SLIPNOTE_LOG_SAMPLE_RATE` (defaults to `1.0`)
43- `OAUTH_BASE_URL` (if set, derives `OAUTH_CLIENT_ID`, `OAUTH_REDIRECT_URI`, and `OAUTH_JWKS_URI`)
44- `OAUTH_CLIENT_NAME`
45- `OAUTH_CLIENT_URI`
46- `OAUTH_JWKS_URI`
47- `OAUTH_SCOPES` (defaults to `atproto transition:generic`)
48- `OAUTH_POST_AUTH_REDIRECT` (defaults to `OAUTH_BASE_URL` when set, otherwise `/`)
49- `OAUTH_POST_AUTH_REDIRECT_ROUTE` (if set, combines with `OAUTH_BASE_URL` when available)
50- `OAUTH_COOKIE_NAME` (defaults to `slipnote_session`)
51- `OAUTH_SESSION_TTL_SECONDS` (defaults to 7 days)
52- `PLC_HOSTNAME` (defaults to `plc.directory`)
53
54If you do not have a real URL for OAuth callbacks, expose the backend with ngrok:
55
56```sh
57ngrok http 3001
58```
59
60Then set `OAUTH_BASE_URL` to the ngrok HTTPS URL (for example, `https://abc123.ngrok-free.app`).
61
62## Tilt
63
64```sh
65tilt up
66```
67
68Tilt runs the frontend dev server, Storybook, and the backend as local
69resources. Tilt also launches a Postgres container and wires `DATABASE_URL` for
70the backend. Set `OPENAI_API_KEY` for the backend and optionally override
71`SLIPNOTE_BACKEND_URL`, `DATABASE_URL`, or `PUBLIC_BACKEND_URL`/
72`VITE_BACKEND_URL`.