{"id":49885290,"url":"https://github.com/meyer1994/flower","last_synced_at":"2026-05-15T18:03:54.460Z","repository":{"id":321980879,"uuid":"1087777883","full_name":"meyer1994/flower","owner":"meyer1994","description":"Nuxt V4 + Nuxt UI + Drizze ORM + Nuxt TRPC + Cloudflare","archived":false,"fork":false,"pushed_at":"2026-01-28T04:44:56.000Z","size":1691,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T12:59:13.113Z","etag":null,"topics":["cloudflare-workers","drizzle-orm","nuxt","trpc","vue"],"latest_commit_sha":null,"homepage":"https://flower.meyer1994.workers.dev/","language":"Vue","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/meyer1994.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":"2025-11-01T16:16:31.000Z","updated_at":"2026-01-28T04:45:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meyer1994/flower","commit_stats":null,"previous_names":["meyer1994/nuxt-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/meyer1994/flower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meyer1994%2Fflower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meyer1994%2Fflower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meyer1994%2Fflower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meyer1994%2Fflower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meyer1994","download_url":"https://codeload.github.com/meyer1994/flower/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meyer1994%2Fflower/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["cloudflare-workers","drizzle-orm","nuxt","trpc","vue"],"created_at":"2026-05-15T18:03:53.186Z","updated_at":"2026-05-15T18:03:54.448Z","avatar_url":"https://github.com/meyer1994.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flower\n\nA modern Nuxt template\n\n## Getting started\n\n```bash\npnpm install\ncp .env.example .env\npnpm run cf:migrate  # apply migrations to local D1 database\ndocker compose up minio  # mocks R2/S3\npnpm run dev\n# open http://localhost:3000\n```\n\nFor Cloudflare services, check the [deployment](#deployment) section.\n\n## Features\n\nOut of the box:\n\n- **Frontend**:\n  - [Vue 3](https://vuejs.org/)\n  - [Nuxt 4](https://nuxt.com/)\n  - [Nuxt UI 4](https://ui.nuxt.com/)\n  - [VueUse](https://vueuse.org/)\n  - [Tailwind CSS](https://tailwindcss.com/)\n- **Backend**:\n  - [tRPC](https://trpc.io/)\n  - [Drizzle ORM](https://orm.drizzle.team/)\n  - [Better Auth](https://better-auth.com/)\n- **Infrastructure**:\n  - [Cloudflare Workers](https://developers.cloudflare.com/workers/)\n  - [Cloudflare Queues](https://developers.cloudflare.com/queues/)\n  - [Cloudflare R2 / S3](https://developers.cloudflare.com/r2/)\n  - [Cloudflare Vectorize](https://developers.cloudflare.com/vectorize/)\n- **Development**:\n  - [ESLint](https://eslint.org/)\n  - [TypeScript](https://www.typescriptlang.org/)\n  - [pnpm](https://pnpm.io/)\n\n## Development\n\nSimply run `pnpm run dev` to start the development server.\n\n### Auth\n\nWe use [Better Auth](https://better-auth.com/) for authentication. Check their\ndocs for more information.\n\nThis app contains the minimal setup for authentication using D1 as the database.\n\nThere is a middleware implemented in `app/middleware/auth.global.ts` to protect\nroutes that are marked with the `auth` meta.\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\ndefinePageMeta({ auth: true }); // protects the route\n\u003c/script\u003e\n```\n\nIf the user is not logged in, they will be redirected to a 404 page. As it is\ncurrently configured, we refresh the session on every route navigation.\n\n#### Organizations\n\nThis app includes the Better Auth [organization plugin](https://www.better-auth.com/docs/plugins/organization)\nfor multi-tenant support. Organizations allow users to collaborate in shared\nworkspaces with role-based access control (owner, admin, member).\n\n##### Organization Invitation Flow\n\nThe following diagram illustrates how organization invitations work:\n\n```mermaid\nsequenceDiagram\n    participant Admin\n    participant Server\n    participant User\n\n    Admin-\u003e\u003eServer: inviteMember(email, role)\n    Server-\u003e\u003eServer: Store invitation (status: pending)\n    Server-\u003e\u003eUser: sendInvitationEmail()\u003cbr/\u003eLink: /invitation?id=xxx\n\n    User-\u003e\u003eServer: Click invitation link\n    Server-\u003e\u003eServer: Auth middleware checks login\n\n    alt Not logged in\n        Server--\u003e\u003eUser: Redirect to login\n        User-\u003e\u003eServer: Login\n    end\n\n    User-\u003e\u003eServer: acceptInvitation(id)\n    Server-\u003e\u003eServer: Validate invitation\u003cbr/\u003e(expiration, status, email)\n    Server-\u003e\u003eServer: Add user as member\n    Server--\u003e\u003eUser: Success response\n    Note over User: User is now a member\u003cbr/\u003eof the organization\n```\n\n**Key files:**\n\n- `server/lib/auth.ts` - Server-side auth configuration with `sendInvitationEmail`\n- `app/pages/invitation.vue` - Invitation acceptance page\n- `app/pages/dash/orgs.vue` - Organization management UI\n\n### API Keys\n\nUsers can create and manage API keys for programmatic access via the `/keys`\npage. Keys are managed through Better Auth's `apiKey` plugin.\n\nTo verify an API key in a server route:\n\n```typescript\nconst auth = serverAuth(event);\nconst apiKey = getHeader(event, \"x-api-key\");\nconst result = await auth.api.verifyApiKey({ body: { key: apiKey } });\nif (!result.valid) {\n  throw createError({ code: 401, message: \"Unauthorized\" });\n}\n```\n\nSee `server/api/protected/test.ts` for a full example.\n\n### Database\n\nThe database is managed by Drizzle ORM. Migrations are managed via `drizzle-kit`\nand applied to Cloudflare D1.\n\nThe following command generate types for Better Auth, based on the configs in\n`auth.config.ts`, and outputs the schema for the auth related tabels in\n`server/db/auth.ts`. The schema is imported into the `server/db/schema.ts` file,\nwhich is useed by the app, giving us automatic type safety for all database\noperations. It also generate the SQL migrations in `server/db/migrations`.\n\n```bash\npnpm run db:generate\n```\n\nThe following command will apply the migrations to the Cloudflare D1 database.\n\n```bash\npnpm run db:migrate\npnpm run db:migrate --remote  # updates remote database\n```\n\n### Storage\n\nThere are two storage providers: S3 and R2. S3 can be used with any S3\ncompatible storage provider. R2 is a Cloudflare specific storage provider.\n\nWe use `minio` to mock the S3 storage provider.\n\n```bash\ndocker compose up minio\n# console on http://localhost:9001\n```\n\nUnfortunately, R2 bindings do not give us a way to presign URLs for objects. So\nwe need to use the `@aws-sdk/s3-request-presigner` and configure S3 compatible\nvars from R2 to be able to presign URLs for objects.\n\n## Deployment\n\nThis project was primarily made to work with Cloudflare workers. But it can be\neasily modified to run anywhere Nuxt can run.\n\nFor Cloudflare services, you might need to update your `wrangler.jsonc` to use\nthe correct bindings. You can create bindings by using:\n\n```bash\npnpm wrangler d1 create '\u003cNAME\u003e'\npnpm wrangler vectorize create '\u003cNAME\u003e'\npnpm wrangler r2 bucket create '\u003cNAME\u003e'\npnpm wrangler kv namespace create '\u003cNAME\u003e'\npnpm wrangler queues create '\u003cNAME\u003e'\n```\n\nThe following command will generate all types for Cloudflare and Better Auth,\nbefore running the build and deploying to Cloudflare.\n\n```bash\npnpm run cf:deploy\n```\n\n### Secrets\n\nYou can quickly update production secrets by running:\n\n```bash\npnpm run cf:secrets\n# or\nwrangler secret bulk .env\n```\n\nThis will prompt you for the secrets and update the `.env` file.\n\n### `global_fetch_strictly_public`\n\nYou MUST set the 'global_fetch_strictly_public' compatibility flag to true in\nyour `wrangler.jsonc` file.\n\nWhy? Because internal requests have an issue where they don't go through the\nwhole request pipeline of a normal request coming from the internet. For\nexample, any requests being made during the hydration process, like trpc calls\nand auth calls, will fail. I don't know the specifics, but for me, it would not\ngo trought request context creation and such, resulting in the `Env` object from\nCloudflare bindings not being available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeyer1994%2Fflower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeyer1994%2Fflower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeyer1994%2Fflower/lists"}