A daily.dev hackathon project. Put your daily.dev habits on the line, one spin at a time. It's built as a hub of "roulette" modes β the first (and currently only) mode is Bookmarks Roulette, with room to add more.
Your bookmarks pile up and rot β this forces a reckoning. One spin serves one bookmark: read it (spared) or pull the trigger (deleted forever). Funny, but it actually drains your backlog.
- Demo mode β runs entirely in the browser on a fake bookmark pile. No account, no token required. This is the headline experience and always works.
- Real mode β Sign in with daily.dev (OAuth, authorization code + PKCE; no Plus subscription needed). Tokens are stored in httpOnly cookies and access tokens are refreshed server-side; every API call is proxied through Astro server routes, so no token ever touches client JS and there are no CORS issues. Bookmarks load 50 at a time (one API request), moving on to older ones as you clear each batch, to go easy on daily.dev's monthly API quota. Deletes hit the real
DELETE /bookmarks/{id}endpoint.
The deployed app never asks for a personal API token. Under pnpm dev only, a "paste an API token" form is available, since daily.dev's OAuth can't redirect to localhost.
pnpm install
pnpm dev # http://localhost:4321Targets Vercel out of the box (@astrojs/vercel, output: "server"). Push and import, or vercel. No env vars required (demo mode is fully client-side).
src/layouts/Layout.astroβ shared shell: global styles + header (avatar/name + sign out)src/pages/index.astroβ the hub: sign-in + the list of roulette modessrc/pages/roulette.astroβ Bookmarks Roulette game (demo via?demo=1, else requires login)src/pages/api/auth/index.tsβ sign in with a token (validate β set cookie) / sign outsrc/pages/api/auth/login.ts,callback.tsβ "Sign in with daily.dev" OAuth flow (src/lib/oauth.ts)src/middleware.tsβ refreshes expiring OAuth access tokens before each requestsrc/pages/api/bookmarks/*β server-side proxy: list (paginated) + deletesrc/lib/daily.tsβ daily.dev Public API client (server only): bookmarks + profilesrc/lib/auth.tsβ resolves the current user from the session cookiesrc/lib/session.tsβ httpOnly cookie sessionsrc/lib/mock.tsβ demo-mode fake bookmarks
daily.dev's Public API is REST + Bearer tokens (personal tokens or OAuth app tokens), available to any daily.dev account. Set DAILY_OAUTH_CLIENT_ID / DAILY_OAUTH_CLIENT_SECRET (see .env.example) to enable sign-in; without them a deployment only offers the demo. Endpoints used: GET /bookmarks/ (cursor-paginated), DELETE /bookmarks/{id}, GET /profile/. Other resources exist (feeds, follows, tech stack) β candidates for future roulette modes. See spike/spike.mjs for a standalone API probe.

