First cut of the Excalidraw architecture: Chrome extension → Next.js API → Supabase → web feed.
npm install
cp .env.example .env.localCreate the database table with supabase/schema.sql, then fill .env.local:
FONTSTEAL_API_TOKEN=change-me
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...Run it:
npm run devOpen http://localhost:3000.
- Open
chrome://extensions. - Enable Developer mode.
- Load unpacked → select
extension/. - Select text on any
http(s)page. - Open Fontsteal, set API URL
http://localhost:3000and your token, then save.
Local dev accepts dev-token only when FONTSTEAL_API_TOKEN is unset and NODE_ENV !== production.
curl -X POST http://localhost:3000/api/clips \
-H 'authorization: Bearer dev-token' \
-H 'content-type: application/json' \
-d '{"source_url":"https://example.com","font_family":"Georgia","selected_text":"Hello serif","tags":["demo"]}'GET /api/clipsreturns public clips.GET /api/clips?mine=1requires the bearer token and returns clips owned by that token.GET /api/clips/:idreturns a public clip.
npm run check
npm run build