{"id":51100954,"url":"https://github.com/biomathcode/sass-waitlist-cloudflare","last_synced_at":"2026-06-24T10:32:09.153Z","repository":{"id":357246813,"uuid":"1168177975","full_name":"biomathcode/sass-waitlist-cloudflare","owner":"biomathcode","description":"Sass Wailtlist template build with hono, astro, and cloudflare","archived":false,"fork":false,"pushed_at":"2026-03-01T18:27:29.000Z","size":724,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T15:07:20.820Z","etag":null,"topics":["astro","cloudflare","hono","template","waitlist"],"latest_commit_sha":null,"homepage":"https://stage.10dollar.in","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/biomathcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-27T05:03:24.000Z","updated_at":"2026-03-01T18:28:55.000Z","dependencies_parsed_at":"2026-05-12T02:04:16.475Z","dependency_job_id":null,"html_url":"https://github.com/biomathcode/sass-waitlist-cloudflare","commit_stats":null,"previous_names":["biomathcode/sass-waitlist-cloudflare"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/biomathcode/sass-waitlist-cloudflare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomathcode%2Fsass-waitlist-cloudflare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomathcode%2Fsass-waitlist-cloudflare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomathcode%2Fsass-waitlist-cloudflare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomathcode%2Fsass-waitlist-cloudflare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biomathcode","download_url":"https://codeload.github.com/biomathcode/sass-waitlist-cloudflare/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomathcode%2Fsass-waitlist-cloudflare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34726698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","cloudflare","hono","template","waitlist"],"created_at":"2026-06-24T10:32:07.748Z","updated_at":"2026-06-24T10:32:09.145Z","avatar_url":"https://github.com/biomathcode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SaaS Waitlist Template\n\n\u003cimg src=\"./src/client//assets/images/ogimage.png\" alt=\"Waitlist Template Preview\" width=\"100%\" style=\"max-width: 900px; height: auto;\" /\u003e\n\nAstro frontend + Hono API on Cloudflare Workers with:\n\n- Waitlist signup form\n- D1 persistence through Drizzle ORM\n- Email verification via Resend\n- Notion sync on successful email confirmation\n- Edge rate limiting\n\n## Architecture\n\n```text\nBrowser\n  -\u003e Astro page (src/client)\n  -\u003e /api/* (Vite proxy in dev, same-origin in production)\n  -\u003e Hono Worker (src/server/index.ts)\n       -\u003e Cloudflare D1 (DB binding)\n       -\u003e Resend API (confirmation emails)\n       -\u003e Notion API (store confirmed users)\n       -\u003e Cloudflare Rate Limiter (MY_RATE_LIMITER)\n```\n\n## Signup + Confirmation Flow\n\n1. `POST /api/signup` validates payload with Zod.\n2. Worker checks duplicate email in D1.\n3. New subscriber is inserted with a `confirmationToken`.\n4. Resend sends email containing `/api/confirm?token=...`.\n5. `GET /api/confirm` marks subscriber as verified and clears token.\n6. Confirmed subscriber is pushed to Notion (`addSubscriberToNotion`).\n\n## Key Files\n\n```text\nsrc/\n  client/\n    components/Waitlist.astro      # UI + browser-side fetch calls\n    pages/index.astro              # Waitlist page composition\n  server/\n    index.ts                       # Hono routes + csrf + rate limiting\n    db/\n      schema.ts                    # Drizzle table definition\n      queries.ts                   # DB operations + Notion side effect\n    lib/\n      email.ts                     # Resend email sender\n      notion.ts                    # Notion API client\n    middleware/auth.ts             # Optional Cloudflare Access JWT middleware\ndrizzle/                           # SQL migrations\nwrangler.example.jsonc             # Safe Wrangler template (no real secrets)\n.env.example                       # Safe local env template (no real secrets)\n```\n\n## API Endpoints\n\n| Method | Path                     | Description                                             |\n| ------ | ------------------------ | ------------------------------------------------------- |\n| `GET`  | `/api/health`            | Worker health check                                     |\n| `GET`  | `/api/subscriber-count`  | Returns total subscriber count                          |\n| `POST` | `/api/signup`            | Creates pending subscriber and sends confirmation email |\n| `GET`  | `/api/confirm?token=...` | Confirms email and pushes user to Notion                |\n\n## Configuration\n\nUse these variables in `wrangler.jsonc`, `.env`, or `.dev.vars` based on environment:\n\n| Variable               | Required | Purpose                                  |\n| ---------------------- | -------- | ---------------------------------------- |\n| `ENVIRONMENT`          | Yes      | `development`, `staging`, `production`   |\n| `RESEND_API_KEY`       | Yes      | Resend API auth key                      |\n| `RESEND_FROM_EMAIL`    | No       | Sender identity for confirmation email   |\n| `NOTION_TOKEN`         | Yes      | Notion integration token                 |\n| `NOTION_DATASOURCE_ID` | Yes      | Notion data source ID                    |\n| `CSRF_ALLOWED_ORIGINS` | No       | Comma-separated allowed origins for CSRF |\n| `CF_ACCESS_DOMAIN`     | Optional | Cloudflare Access team domain            |\n| `POLICY_AUD`           | Optional | Cloudflare Access audience               |\n\nNotes:\n- `CSRF_ALLOWED_ORIGINS` defaults to strict same-origin checks when omitted.\n- `middleware/auth.ts` is available, but not mounted by default in `src/server/index.ts`.\n\n## Local Development\n\n1. Install dependencies:\n\n```bash\nbun install\n```\n\n2. Create local config from templates:\n\n```bash\ncp .env.example .env\ncp .env.example .dev.vars\ncp wrangler.example.jsonc wrangler.jsonc\n```\n\n3. Replace all `REPLACE_WITH_*` placeholders with real values.\n\n4. Apply local D1 migrations:\n\n```bash\nbun run db:migrate:local\n```\n\n5. Start Astro + Worker together:\n\n```bash\nbun run dev\n```\n\n## Deploy\n\nRun build + deploy:\n\n```bash\nbun run deploy:staging\nbun run deploy:prod\n```\n\nDry-run first (recommended):\n\n```bash\nbun run dryrun:staging\nbun run dryrun:prod\n```\n\nIf you prefer not to store secrets in `wrangler.jsonc`, use Wrangler secrets:\n\n```bash\nwrangler secret put RESEND_API_KEY --env staging\nwrangler secret put NOTION_TOKEN --env staging\nwrangler secret put RESEND_API_KEY --env production\nwrangler secret put NOTION_TOKEN --env production\n```\n\n## Database + Tests\n\n- Generate migrations: `bun run db:generate`\n- Run tests: `bun run test`\n\n## Security Checklist\n\n- Keep `.env`, `.dev.vars`, and `wrangler.jsonc` out of git.\n- Commit only `.env.example` and `wrangler.example.jsonc`.\n- Never commit real API tokens.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiomathcode%2Fsass-waitlist-cloudflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiomathcode%2Fsass-waitlist-cloudflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiomathcode%2Fsass-waitlist-cloudflare/lists"}