{"id":49579308,"url":"https://github.com/luisfer/cursor-cafe-coupons","last_synced_at":"2026-05-03T18:36:17.751Z","repository":{"id":347357906,"uuid":"1193787776","full_name":"luisfer/cursor-cafe-coupons","owner":"luisfer","description":"Cafe Coupons","archived":false,"fork":false,"pushed_at":"2026-03-27T15:32:29.000Z","size":1480,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T00:49:53.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luisfer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-27T15:25:33.000Z","updated_at":"2026-03-27T15:32:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/luisfer/cursor-cafe-coupons","commit_stats":null,"previous_names":["luisfer/cursor-cafe-coupons"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/luisfer/cursor-cafe-coupons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisfer%2Fcursor-cafe-coupons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisfer%2Fcursor-cafe-coupons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisfer%2Fcursor-cafe-coupons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisfer%2Fcursor-cafe-coupons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luisfer","download_url":"https://codeload.github.com/luisfer/cursor-cafe-coupons/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisfer%2Fcursor-cafe-coupons/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32580212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-05-03T18:36:16.969Z","updated_at":"2026-05-03T18:36:17.745Z","avatar_url":"https://github.com/luisfer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Cursor Cafe Coupons banner](public/readme-banner.png)\n\n# cursor-cafe-coupons\n\nGenerate printable coffee coupons for Cursor community events. Customize the venue, drink menu, and branding — then print or save as HTML/PDF.\n\nBuilt for [Cursor Ambassadors](https://cursor.com/ambassadors) who partner with local cafes for meetups and need physical drink vouchers.\n\n## Prerequisites\n\n- [Node.js](https://nodejs.org/) **v18 or higher**\n\n## Quick Start\n\n```bash\ngit clone https://github.com/luisfer/cursor-cafe-coupons.git\ncd cursor-cafe-coupons\nnpm install\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) to launch the coupon editor.\n\n## How It Works\n\n1. **Pick a preset** — Classic, Minimal, or Full Menu\n2. **Configure** your venue name, logo, event date, and drink menu\n3. **Preview** the coupon in real-time\n4. **Print** directly or **Save HTML** to print later\n\nPrint output is **landscape A4** with a **3-column grid**. Use `\"couponsPerPage\": \"auto\"` to pick **9, 6, or 3** coupons per page from menu size (short menus pack more; long menus get fewer, larger cards). Or set `1`–`9` manually.\n\n## CLI\n\nGenerate coupons from a JSON config without the web UI:\n\n```bash\n# From a config file\nnpm run cli -- configs/example.json coupons.html\n\n# From a built-in preset\nnpm run cli -- --preset classic coupons.html\n\n# Single coupon (default is print mode with multiple per page)\nnpm run cli -- --preset minimal --single coupon.html\n\n# List available presets\nnpm run cli -- --list-presets\n```\n\n## Config Format\n\nCoupon configs are simple JSON. See [`configs/`](./configs) for examples. For agents and LLMs, read [`CUSTOMIZATION.md`](./CUSTOMIZATION.md) and [`configs/schema.json`](./configs/schema.json).\n\n```json\n{\n  \"venue\": {\n    \"name\": \"Cafe Name\",\n    \"logo\": \"\",\n    \"logoHeight\": 42,\n    \"wifi\": \"Free Cafe Wifi\"\n  },\n  \"event\": {\n    \"date\": \"27.03.2026\"\n  },\n  \"menu\": [\n    { \"name\": \"Espresso\", \"temps\": [\"hot\"] },\n    { \"name\": \"Latte\", \"temps\": [\"hot\", \"iced\"] },\n    { \"name\": \"Cold Brew\", \"temps\": [\"iced\"] }\n  ],\n  \"options\": {\n    \"beanChoices\": [\"House Blend\", \"Decaf\"],\n    \"milkChoices\": [\"Regular\", \"Oat\"],\n    \"footerNote\": \"Valid for 1 complimentary drink\",\n    \"motto\": \"Happy building!\",\n    \"showCouponNumber\": true\n  },\n  \"print\": {\n    \"couponsPerPage\": \"auto\"\n  },\n  \"theme\": {\n    \"headerBg\": \"#14120b\",\n    \"headerText\": \"#edecec\"\n  }\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `venue.name` | Cafe or venue name (shown in header if no logo) |\n| `venue.logo` | Logo URL or base64 data URL |\n| `venue.logoHeight` | Logo height in pixels (default 42) |\n| `venue.wifi` | Wi-Fi network name (optional) |\n| `event.date` | Event date in DD.MM.YYYY format |\n| `menu` | Array of drinks. Each has a `name` and `temps` (`\"hot\"`, `\"iced\"`, or both). Use `\"kind\": \"section\"` with `\"temps\": []` for category headings. |\n| `options.beanChoices` | Bean/roast options shown as checkboxes (optional) |\n| `options.milkChoices` | Milk alternatives shown as checkboxes (optional) |\n| `options.footerNote` | Small print above the branded footer |\n| `options.motto` | Tagline on the branded footer bar (Cursor brown). Omit for default `Happy building!`; empty string `\"\"` hides the bar |\n| `options.menuTitle` | Custom heading above the drink list (optional) |\n| `options.showCouponNumber` | Show an empty \"No.\" box for handwritten numbering |\n| `print.couponsPerPage` | `\"auto\"` (recommended) or integer `1`–`9`. Auto picks 9, 6, or 3 per landscape page from estimated content height |\n| `print.orientation` | Deprecated (ignored); print is always landscape |\n| `theme.headerBg` | Header band background color |\n| `theme.headerText` | Header band text color |\n\n## Project Structure\n\n```\napp/\n  layout.tsx          Root layout\n  page.tsx            Main page — config editor + live preview\n  globals.css         Global styles (Cursor theme)\n\ncomponents/\n  config-form.tsx     Configuration form (venue, event, menu, options)\n  coupon-preview.tsx  Live iframe preview\n  menu-editor.tsx     Dynamic drink menu editor\n  export-controls.tsx Print / Save HTML / Save Config buttons\n\nlib/\n  types.ts            CouponConfig type definition\n  generate-html.ts    Core HTML generation engine\n  print-layout.ts     Auto grid (9/6/3) + resolve coupons per page\n  presets.ts          Built-in presets (Classic, Minimal, Full Menu)\n\ncli/\n  generate.ts         CLI entry point\n  generate.js         Node wrapper (uses tsx)\n\nconfigs/\n  example.json        Example config\n  schema.json         JSON Schema for coupon configs\n\nCUSTOMIZATION.md      Quick reference for humans and LLMs\n\npublic/\n  cursor-logo.svg     Cursor wordmark (embedded in generated coupons)\n  fonts/              CursorGothic font files\n```\n\n## Tech Stack\n\n- **Next.js 16** (App Router)\n- **React 19**, **TypeScript**\n- **Tailwind CSS v4**\n- No database — everything runs client-side\n\nBefore shipping: `npm run typecheck` and `npm run build` should pass.\n\n## Deployment\n\nDeploy to [Vercel](https://vercel.com) with zero config, or build and serve anywhere:\n\n```bash\nnpm run build\nnpm run start\n```\n\n## Cursor Ambassador Toolkit\n\nThis repo is part of a growing set of open-source tools for Cursor community organizers:\n\n| Tool | Description |\n|------|-------------|\n| [cursor-ambassador-evergreen](https://github.com/luisfer/cursor-ambassador-evergreen) | Configurable community site template |\n| [cursor-ambassador-qr-printer](https://github.com/luisfer/cursor-ambassador-qr-printer) | QR code card generator for referral links |\n| [cursor-referral-checker](https://github.com/luisfer/cursor-referral-checker) | Batch-check referral code availability |\n| **cursor-cafe-coupons** (this repo) | Printable coffee coupon generator |\n\n## Credits\n\nDesigned and implemented by [Luis Fernando Romero Calero](https://lfrc.me) and [Cursor](https://cursor.com).\n\nPart of the [Cursor Ambassador](https://cursor.com/ambassador) open-source toolkit.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisfer%2Fcursor-cafe-coupons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisfer%2Fcursor-cafe-coupons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisfer%2Fcursor-cafe-coupons/lists"}