A dashboard for managing freeCodeCamp publications on Hashnode. View published posts, drafts, submissions, and search content — all from one place.
Built with Astro and deployed to Cloudflare Workers.
pnpm install
cp .dev.vars.example .dev.vars
# Fill in your HASHNODE_TOKEN in .dev.varsTwo modes available:
pnpm develop — Astro dev server at localhost:4321 with Cloudflare platform proxy. Hot reload, but Durable Objects are not available (Miniflare limitation with internal DOs).
pnpm preview — Builds then runs via wrangler dev at localhost:8787. No hot reload, but full D1 + Durable Object support. Use this to test the reindex flow end-to-end.
# Apply migrations to local D1 (one-time or after schema changes)
npx wrangler d1 execute hashdash-posts --local --file=migrations/0001_create_tables.sql
# Start with full bindings
pnpm preview
# Visit /reindex to populate D1 from Hashnode API| Command | Purpose |
|---|---|
pnpm develop |
Start local dev server (localhost:4321), no DO support |
pnpm preview |
Build + local Wrangler (localhost:8787), full D1 + DO |
pnpm build |
Production build to ./dist/ |
pnpm deploy:worker |
Type-check + build + deploy to Cloudflare Workers |
pnpm test |
Run tests (Vitest) |
pnpm check |
Type-check Astro and TypeScript files |
pnpm lint |
Lint with oxlint |
pnpm format |
Format with Prettier |
pnpm format:check |
Check formatting without writing |
pnpm cf-typegen |
Regenerate types from Wrangler bindings |
Production deploys are triggered automatically when pushing to main via Cloudflare Builds. The only production URL is hashdash.freecodecamp.org.
Non-production branch builds and preview URLs are not available (CF limitation: Workers with Durable Objects cannot generate preview URLs). Test locally with pnpm preview before merging.
- Authenticate with Cloudflare:
npx wrangler login - Create the D1 database (if not already created):
npx wrangler d1 create hashdash-posts # Update database_id in wrangler.jsonc with the returned ID - Apply D1 migrations to remote:
npx wrangler d1 execute hashdash-posts --remote --file=migrations/0001_create_tables.sql
- Set secrets:
npx wrangler secret put HASHNODE_TOKEN npx wrangler secret put WEBHOOK_SECRET
- Deploy:
pnpm deploy:worker - Sync index: visit
https://hashdash.freecodecamp.org/reindexand click Sync Now - Configure Hashnode webhook to POST to
https://hashdash.freecodecamp.org/api/webhookwith the sameWEBHOOK_SECRET
| Resource | Created by | Notes |
|---|---|---|
| D1 database | wrangler d1 create |
Must exist before first deploy |
| DO namespace | Automatic on deploy | Via migrations block in wrangler.jsonc |
| Secrets | wrangler secret put |
HASHNODE_TOKEN, WEBHOOK_SECRET |
| Custom domain | Cloudflare dashboard | hashdash.freecodecamp.org |
| CF Access | Cloudflare dashboard | Protects /reindex admin page |