this repo has no description
1# sitebase
2
3A minimal web UI for managing standard.site publications and documents in a Bluesky PDS.
4
5## Project Structure
6
7```
8src/
9 server.ts - Main Hono server entry point
10 lib/
11 oauth.ts - ATProto OAuth client setup with SQLite persistence
12 session.ts - Session management
13 routes/
14 auth.ts - Authentication routes (login, callback, logout)
15 publication.ts - Publication CRUD routes
16 documents.ts - Document CRUD routes
17 views/
18 home.ts - Home page view
19 layouts/
20 main.ts - Main layout template
21public/
22 styles.css - Application styles
23data/
24 oauth.db - SQLite database for OAuth state and sessions
25 private-key.json - ES256 private key for confidential client auth
26```
27
28## Running
29
30```bash
31# Development with hot reload
32bun run dev
33
34# Production
35bun run start
36```
37
38## Environment Variables
39
40- `PORT` - Server port (default: 8000)
41- `PUBLIC_URL` - Public URL for OAuth callbacks (MUST be HTTPS without custom port for production)
42- `DATA_DIR` - Directory for persistent data (default: ./data)
43
44## ATProto OAuth Implementation
45
46This app is a **confidential client** using:
47- ES256 key for client authentication (stored in data/private-key.json)
48- SQLite for session and state persistence
49- DPoP bound access tokens
50- PAR (Pushed Authorization Requests)
51
52### OAuth Endpoints
53
54- `GET /client-metadata.json` - OAuth client metadata
55- `GET /jwks.json` - JSON Web Key Set for client authentication
56- `GET /auth/login` - Login form
57- `POST /auth/login` - Initiate OAuth flow
58- `GET /auth/callback` - OAuth callback handler
59- `GET /auth/logout` - Logout and revoke session
60
61## ATProto Collections
62
63- `site.standard.publication` - Blog/publication metadata
64- `site.standard.document` - Individual documents/posts
65
66## Key Dependencies
67
68- `hono` - Web framework
69- `@atproto/oauth-client-node` - ATProto OAuth (production-ready)
70- `@atproto/api` - ATProto API client
71- `@atproto/jwk-jose` - ES256 key generation and management
72- `bun:sqlite` - SQLite for session persistence