# slipnote Monorepo layout: - `frontend/`: Astro frontend - `backend/`: Rust Axum backend ## Frontend ```sh cd frontend pnpm install pnpm dev ``` ## Backend ```sh cd backend cargo run ``` ### OAuth env vars The backend requires these OAuth settings to enable ATProto auth: - `OAUTH_CLIENT_ID` (e.g. `https://your-app.com/oauth/client-metadata.json`) - `OAUTH_REDIRECT_URI` (e.g. `https://your-app.com/oauth/callback`) - `OAUTH_SIGNING_KEY` (did:key private key for client assertions) Generate a signing key with the built-in helper: ```sh cd backend cargo run --bin oauth_keygen ``` Set the output as `OAUTH_SIGNING_KEY`. Optional settings: - `SLIPNOTE_LOG_SAMPLE_RATE` (defaults to `1.0`) - `OAUTH_BASE_URL` (if set, derives `OAUTH_CLIENT_ID`, `OAUTH_REDIRECT_URI`, and `OAUTH_JWKS_URI`) - `OAUTH_CLIENT_NAME` - `OAUTH_CLIENT_URI` - `OAUTH_JWKS_URI` - `OAUTH_SCOPES` (defaults to `atproto transition:generic`) - `OAUTH_POST_AUTH_REDIRECT` (defaults to `OAUTH_BASE_URL` when set, otherwise `/`) - `OAUTH_POST_AUTH_REDIRECT_ROUTE` (if set, combines with `OAUTH_BASE_URL` when available) - `OAUTH_COOKIE_NAME` (defaults to `slipnote_session`) - `OAUTH_SESSION_TTL_SECONDS` (defaults to 7 days) - `PLC_HOSTNAME` (defaults to `plc.directory`) If you do not have a real URL for OAuth callbacks, expose the backend with ngrok: ```sh ngrok http 3001 ``` Then set `OAUTH_BASE_URL` to the ngrok HTTPS URL (for example, `https://abc123.ngrok-free.app`). ## Tilt ```sh tilt up ``` Tilt runs the frontend dev server, Storybook, and the backend as local resources. Tilt also launches a Postgres container and wires `DATABASE_URL` for the backend. Set `OPENAI_API_KEY` for the backend and optionally override `SLIPNOTE_BACKEND_URL`, `DATABASE_URL`, or `PUBLIC_BACKEND_URL`/ `VITE_BACKEND_URL`.