create-raredays-app 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +89 -0
  2. package/bin/index.js +1024 -0
  3. package/package.json +43 -0
  4. package/scaffold-fragments/billing/files/app/api/billing/webhook/route.ts +5 -0
  5. package/scaffold-fragments/billing/module.json +31 -0
  6. package/scaffold-fragments/billing/runtime/config.ts +8 -0
  7. package/scaffold-fragments/billing/runtime/exports.ts +6 -0
  8. package/scaffold-fragments/billing/runtime/imports.ts +6 -0
  9. package/scaffold-fragments/billing/runtime/ports.ts +3 -0
  10. package/scaffold-fragments/cms/module.json +29 -0
  11. package/scaffold-fragments/cms/runtime/config.ts +4 -0
  12. package/scaffold-fragments/cms/runtime/exports.ts +1 -0
  13. package/scaffold-fragments/cms/runtime/imports.ts +1 -0
  14. package/scaffold-fragments/email/module.json +30 -0
  15. package/scaffold-fragments/email/runtime/config.ts +1 -0
  16. package/scaffold-fragments/email/runtime/imports.ts +1 -0
  17. package/scaffold-fragments/email/runtime/ports.ts +1 -0
  18. package/scaffold-fragments/feature-flags/files/app/lib/flags.ts +48 -0
  19. package/scaffold-fragments/feature-flags/module.json +66 -0
  20. package/scaffold-fragments/i18n/files/messages/en-US.json +15 -0
  21. package/scaffold-fragments/i18n/module.json +9 -0
  22. package/scaffold-fragments/i18n/runtime/config.ts +7 -0
  23. package/scaffold-fragments/i18n/runtime/exports.ts +1 -0
  24. package/scaffold-fragments/i18n/runtime/imports.ts +2 -0
  25. package/scaffold-fragments/i18n/runtime/ports.ts +1 -0
  26. package/scaffold-fragments/identity/module.json +30 -0
  27. package/scaffold-fragments/identity/vendors/better-auth/files/app/api/auth/[...all]/route.ts +15 -0
  28. package/scaffold-fragments/identity/vendors/better-auth/files/app/lib/auth.ts +20 -0
  29. package/scaffold-fragments/jobs/module.json +12 -0
  30. package/scaffold-fragments/jobs/runtime/config.ts +4 -0
  31. package/scaffold-fragments/jobs/runtime/imports.ts +1 -0
  32. package/scaffold-fragments/jobs/runtime/ports.ts +1 -0
  33. package/scaffold-fragments/notifications/module.json +12 -0
  34. package/scaffold-fragments/notifications/runtime/config.ts +8 -0
  35. package/scaffold-fragments/notifications/runtime/imports.ts +5 -0
  36. package/scaffold-fragments/notifications/runtime/ports.ts +1 -0
  37. package/scaffold-fragments/organizations/module.json +12 -0
  38. package/scaffold-fragments/telemetry/module.json +43 -0
  39. package/scaffold-fragments/telemetry/runtime/config.ts +7 -0
  40. package/scaffold-fragments/telemetry/runtime/imports.ts +7 -0
  41. package/scaffold-fragments/telemetry/runtime/ports.ts +1 -0
  42. package/skillex/private/contribute.md +193 -0
  43. package/skillex/public/consumer.md +157 -0
  44. package/templates/client/.storybook/main.ts +77 -0
  45. package/templates/client/.storybook/preview.ts +12 -0
  46. package/templates/client/CLAUDE.md +50 -0
  47. package/templates/client/_claude/settings.json +107 -0
  48. package/templates/client/_github/PULL_REQUEST_TEMPLATE.md +19 -0
  49. package/templates/client/_github/dependabot.yml +48 -0
  50. package/templates/client/_github/workflows/ci.yml +104 -0
  51. package/templates/client/_gitignore +15 -0
  52. package/templates/client/_npmrc +1 -0
  53. package/templates/client/app/(app)/layout.tsx +49 -0
  54. package/templates/client/app/(marketing)/layout.tsx +21 -0
  55. package/templates/client/app/(marketing)/page.tsx +34 -0
  56. package/templates/client/app/api/backend/[...path]/route.ts +37 -0
  57. package/templates/client/app/api/dev/login/route.ts +14 -0
  58. package/templates/client/app/api/dev/logout/route.ts +18 -0
  59. package/templates/client/app/globals.css +22 -0
  60. package/templates/client/app/home-auth-controls.tsx +28 -0
  61. package/templates/client/app/layout.tsx +38 -0
  62. package/templates/client/app/lib/backend-client.ts +55 -0
  63. package/templates/client/app/lib/runtime.test.ts +38 -0
  64. package/templates/client/app/lib/runtime.ts +54 -0
  65. package/templates/client/app/protected/page.tsx +31 -0
  66. package/templates/client/app/theme.override.css +9 -0
  67. package/templates/client/instrumentation.ts +10 -0
  68. package/templates/client/mocks/browser.tsx +28 -0
  69. package/templates/client/mocks/handlers.ts +20 -0
  70. package/templates/client/mocks/node.ts +7 -0
  71. package/templates/client/next.config.ts +8 -0
  72. package/templates/client/oxfmt.config.ts +8 -0
  73. package/templates/client/oxlint.config.ts +8 -0
  74. package/templates/client/package.json +61 -0
  75. package/templates/client/postcss.config.mjs +1 -0
  76. package/templates/client/public/mockServiceWorker.js +349 -0
  77. package/templates/client/scripts/build-theme.mjs +18 -0
  78. package/templates/client/site.spec.ts +58 -0
  79. package/templates/client/skillex.json +12 -0
  80. package/templates/client/skills/repo.md +56 -0
  81. package/templates/client/stylelint.config.mjs +4 -0
  82. package/templates/client/tsconfig.json +11 -0
  83. package/templates/client/vitest.config.ts +27 -0
  84. package/templates/client/vitest.setup.ts +18 -0
  85. package/templates/full-stack/.storybook/main.ts +77 -0
  86. package/templates/full-stack/.storybook/preview.ts +12 -0
  87. package/templates/full-stack/CLAUDE.md +50 -0
  88. package/templates/full-stack/_claude/settings.json +107 -0
  89. package/templates/full-stack/_github/PULL_REQUEST_TEMPLATE.md +19 -0
  90. package/templates/full-stack/_github/dependabot.yml +57 -0
  91. package/templates/full-stack/_github/workflows/ci.yml +109 -0
  92. package/templates/full-stack/_github/workflows/db-check.yml +36 -0
  93. package/templates/full-stack/_github/workflows/db-migrate.yml +39 -0
  94. package/templates/full-stack/_gitignore +15 -0
  95. package/templates/full-stack/_npmrc +1 -0
  96. package/templates/full-stack/app/(app)/layout.tsx +53 -0
  97. package/templates/full-stack/app/(marketing)/layout.tsx +21 -0
  98. package/templates/full-stack/app/(marketing)/page.tsx +38 -0
  99. package/templates/full-stack/app/api/dev/login/route.ts +14 -0
  100. package/templates/full-stack/app/api/dev/logout/route.ts +18 -0
  101. package/templates/full-stack/app/api/widgets/route.ts +10 -0
  102. package/templates/full-stack/app/demo/widgets/page.tsx +86 -0
  103. package/templates/full-stack/app/globals.css +22 -0
  104. package/templates/full-stack/app/home-auth-controls.tsx +28 -0
  105. package/templates/full-stack/app/layout.tsx +38 -0
  106. package/templates/full-stack/app/lib/runtime.test.ts +38 -0
  107. package/templates/full-stack/app/lib/runtime.ts +54 -0
  108. package/templates/full-stack/app/protected/page.tsx +31 -0
  109. package/templates/full-stack/app/theme.override.css +9 -0
  110. package/templates/full-stack/db/check.ts +46 -0
  111. package/templates/full-stack/db/index.ts +109 -0
  112. package/templates/full-stack/db/migrate.ts +66 -0
  113. package/templates/full-stack/db/migrations/.gitkeep +0 -0
  114. package/templates/full-stack/db/schema.ts +20 -0
  115. package/templates/full-stack/drizzle.config.ts +16 -0
  116. package/templates/full-stack/instrumentation.ts +10 -0
  117. package/templates/full-stack/mocks/browser.tsx +28 -0
  118. package/templates/full-stack/mocks/handlers.ts +34 -0
  119. package/templates/full-stack/mocks/node.ts +7 -0
  120. package/templates/full-stack/next.config.ts +8 -0
  121. package/templates/full-stack/oxfmt.config.ts +8 -0
  122. package/templates/full-stack/oxlint.config.ts +8 -0
  123. package/templates/full-stack/package.json +72 -0
  124. package/templates/full-stack/postcss.config.mjs +1 -0
  125. package/templates/full-stack/public/mockServiceWorker.js +349 -0
  126. package/templates/full-stack/scripts/build-theme.mjs +18 -0
  127. package/templates/full-stack/site.spec.ts +58 -0
  128. package/templates/full-stack/skillex.json +12 -0
  129. package/templates/full-stack/skills/repo.md +56 -0
  130. package/templates/full-stack/stylelint.config.mjs +4 -0
  131. package/templates/full-stack/tsconfig.json +11 -0
  132. package/templates/full-stack/vitest.config.ts +42 -0
  133. package/templates/full-stack/vitest.setup.ts +18 -0
  134. package/templates/static/.storybook/main.ts +77 -0
  135. package/templates/static/.storybook/preview.ts +12 -0
  136. package/templates/static/CLAUDE.md +50 -0
  137. package/templates/static/_claude/settings.json +107 -0
  138. package/templates/static/_github/PULL_REQUEST_TEMPLATE.md +18 -0
  139. package/templates/static/_github/dependabot.yml +43 -0
  140. package/templates/static/_github/workflows/ci.yml +91 -0
  141. package/templates/static/_gitignore +15 -0
  142. package/templates/static/_npmrc +1 -0
  143. package/templates/static/app/(marketing)/layout.tsx +21 -0
  144. package/templates/static/app/(marketing)/page.tsx +17 -0
  145. package/templates/static/app/globals.css +22 -0
  146. package/templates/static/app/layout.tsx +24 -0
  147. package/templates/static/app/theme.override.css +9 -0
  148. package/templates/static/next.config.ts +19 -0
  149. package/templates/static/oxfmt.config.ts +8 -0
  150. package/templates/static/oxlint.config.ts +8 -0
  151. package/templates/static/package.json +53 -0
  152. package/templates/static/postcss.config.mjs +1 -0
  153. package/templates/static/scripts/build-theme.mjs +18 -0
  154. package/templates/static/site.spec.ts +58 -0
  155. package/templates/static/skillex.json +12 -0
  156. package/templates/static/skills/repo.md +56 -0
  157. package/templates/static/stylelint.config.mjs +4 -0
  158. package/templates/static/tsconfig.json +11 -0
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "create-raredays-app",
3
+ "version": "0.1.0",
4
+ "description": "Scaffold a new RareDays Next.js app.",
5
+ "license": "UNLICENSED",
6
+ "author": "Jeremy Harper <jeremy@raredays.com>",
7
+ "bin": {
8
+ "create-raredays-app": "./bin/index.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "templates",
13
+ "scaffold-fragments",
14
+ "skillex"
15
+ ],
16
+ "type": "module",
17
+ "dependencies": {
18
+ "@clack/prompts": "1.4.0"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "5.9.3",
22
+ "vitest": "4.1.5",
23
+ "@raredays/lint": "0.0.1"
24
+ },
25
+ "engines": {
26
+ "node": ">=20"
27
+ },
28
+ "skillex": true,
29
+ "scripts": {
30
+ "lint": "raredays lint",
31
+ "lint:fix": "raredays lint:fix",
32
+ "format": "raredays format",
33
+ "format:check": "raredays format:check",
34
+ "style": "raredays style",
35
+ "style:fix": "raredays style:fix",
36
+ "fix": "raredays fix",
37
+ "check": "raredays check",
38
+ "test": "vitest run",
39
+ "test:watch": "vitest",
40
+ "dev": "mkdir -p .sandbox && cd .sandbox && node ../bin/index.js",
41
+ "clean": "rm -rf .sandbox"
42
+ }
43
+ }
@@ -0,0 +1,5 @@
1
+ import { webhookHandler } from "@/lib/runtime";
2
+
3
+ export async function POST(req: Request): Promise<Response> {
4
+ return webhookHandler.handle(req);
5
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "key": "billing",
3
+ "label": "Billing (subscriptions + webhooks)",
4
+ "description": "Plan registry, subscription state, webhook handler with idempotency + event-bus fan-out.",
5
+ "deps": {
6
+ "@raredays/billing": "0.0.1"
7
+ },
8
+ "vendors": [
9
+ {
10
+ "key": "stripe",
11
+ "label": "Stripe",
12
+ "deps": {
13
+ "@raredays/billing-stripe": "0.0.1"
14
+ },
15
+ "env": [
16
+ "STRIPE_SECRET_KEY",
17
+ "STRIPE_WEBHOOK_SECRET"
18
+ ],
19
+ "mocks": {
20
+ "package": "@raredays/billing-stripe/mocks",
21
+ "named": "stripeMocks",
22
+ "peerDeps": {
23
+ "@faker-js/faker": "10.4.0"
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ "templates": [
29
+ "full-stack"
30
+ ]
31
+ }
@@ -0,0 +1,8 @@
1
+ export const plans = createPlanRegistry([
2
+ { key: "free", displayName: "Free", rank: 0, features: ["content.read"] },
3
+ { key: "pro", displayName: "Pro", rank: 10, features: ["content.read", "content.download"] },
4
+ ]);
5
+
6
+ const billingProvider = createInMemoryBillingProvider();
7
+ const webhookDeliveryStore = createInMemoryWebhookDeliveryStore();
8
+ const eventBus = createInMemoryEventBus();
@@ -0,0 +1,6 @@
1
+ export const webhookHandler = createWebhookHandler({
2
+ provider: app.require("billingProvider"),
3
+ deliveryStore: app.require("webhookDeliveryStore"),
4
+ eventBus: app.require("eventBus"),
5
+ signatureHeader: "stripe-signature",
6
+ });
@@ -0,0 +1,6 @@
1
+ import { createInMemoryEventBus } from "@raredays/core";
2
+ import { createPlanRegistry, createWebhookHandler } from "@raredays/billing";
3
+ import {
4
+ createInMemoryBillingProvider,
5
+ createInMemoryWebhookDeliveryStore,
6
+ } from "@raredays/billing/testing";
@@ -0,0 +1,3 @@
1
+ billingProvider,
2
+ webhookDeliveryStore,
3
+ eventBus,
@@ -0,0 +1,29 @@
1
+ {
2
+ "key": "cms",
3
+ "label": "CMS (headless content + rich text)",
4
+ "description": "Vendor-neutral CMS port. In-memory dev driver for development; swap to Hygraph (or another adapter) for production.",
5
+ "deps": {
6
+ "@raredays/cms": "0.0.1"
7
+ },
8
+ "vendors": [
9
+ {
10
+ "key": "hygraph",
11
+ "label": "Hygraph",
12
+ "deps": {
13
+ "@raredays/cms-hygraph": "0.0.1"
14
+ },
15
+ "env": [
16
+ "HYGRAPH_ENDPOINT",
17
+ "HYGRAPH_TOKEN"
18
+ ],
19
+ "mocks": {
20
+ "package": "@raredays/cms-hygraph/mocks",
21
+ "named": "hygraphMocks"
22
+ }
23
+ }
24
+ ],
25
+ "templates": [
26
+ "full-stack",
27
+ "client"
28
+ ]
29
+ }
@@ -0,0 +1,4 @@
1
+ // In-memory CMS provider for development. For production, swap to a vendor
2
+ // adapter (e.g. createHygraphCmsProvider from @raredays/cms-hygraph) reading
3
+ // HYGRAPH_ENDPOINT + HYGRAPH_TOKEN from env.
4
+ const cmsProvider = createInMemoryCmsProvider();
@@ -0,0 +1 @@
1
+ export { cmsProvider };
@@ -0,0 +1 @@
1
+ import { createInMemoryCmsProvider } from "@raredays/cms/testing";
@@ -0,0 +1,30 @@
1
+ {
2
+ "key": "email",
3
+ "label": "Transactional email",
4
+ "description": "Vendor-neutral email port. Console adapter for dev; swap to Resend for production.",
5
+ "deps": {
6
+ "@raredays/email": "0.0.1"
7
+ },
8
+ "vendors": [
9
+ {
10
+ "key": "resend",
11
+ "label": "Resend",
12
+ "deps": {
13
+ "@raredays/email-resend": "0.0.1"
14
+ },
15
+ "env": [
16
+ "RESEND_API_KEY"
17
+ ],
18
+ "mocks": {
19
+ "package": "@raredays/email-resend/mocks",
20
+ "named": "resendMocks",
21
+ "peerDeps": {
22
+ "@faker-js/faker": "10.4.0"
23
+ }
24
+ }
25
+ }
26
+ ],
27
+ "templates": [
28
+ "full-stack"
29
+ ]
30
+ }
@@ -0,0 +1 @@
1
+ const emailProvider = createConsoleEmailProvider();
@@ -0,0 +1 @@
1
+ import { createConsoleEmailProvider } from "@raredays/email/testing";
@@ -0,0 +1 @@
1
+ emailProvider,
@@ -0,0 +1,48 @@
1
+ // Feature flag definitions. The framework uses Vercel's `flags` SDK
2
+ // (https://flags-sdk.dev) — declarative `flag({ key, decide })` contracts
3
+ // that work with any provider, or none at all.
4
+ //
5
+ // If you selected a vendor during scaffolding, its adapter package is
6
+ // already in your deps. Uncomment + wire the matching block below:
7
+ //
8
+ // LaunchDarkly:
9
+ // import { ldAdapter } from "@flags-sdk/launchdarkly";
10
+ // export const showNewCheckout = flag<boolean>({
11
+ // key: "show-new-checkout",
12
+ // adapter: ldAdapter.variation(),
13
+ // defaultValue: false,
14
+ // });
15
+ //
16
+ // Statsig:
17
+ // import { statsigAdapter } from "@flags-sdk/statsig";
18
+ // export const showNewCheckout = flag<boolean>({
19
+ // key: "show_new_checkout",
20
+ // adapter: statsigAdapter.featureGate((gate) => gate.value),
21
+ // defaultValue: false,
22
+ // });
23
+ //
24
+ // GrowthBook:
25
+ // import { growthbookAdapter } from "@flags-sdk/growthbook";
26
+ // export const showNewCheckout = flag<boolean>({
27
+ // key: "show-new-checkout",
28
+ // adapter: growthbookAdapter.feature(),
29
+ // defaultValue: false,
30
+ // });
31
+ //
32
+ // Hypertune / PostHog: see https://flags-sdk.dev/docs/providers/
33
+ //
34
+ // Until a vendor is wired, in-process `decide()` functions are fine — the
35
+ // SDK deduplicates evaluations per-request automatically.
36
+
37
+ import { flag } from "flags/next";
38
+
39
+ /**
40
+ * Example flag. Replace with your real ones; delete if you don't want a
41
+ * sample. Use in server components / route handlers as:
42
+ * const enabled = await exampleFlag();
43
+ */
44
+ export const exampleFlag = flag<boolean>({
45
+ key: "example",
46
+ defaultValue: false,
47
+ decide: () => false,
48
+ });
@@ -0,0 +1,66 @@
1
+ {
2
+ "key": "feature-flags",
3
+ "label": "Feature flags (Vercel Flags SDK)",
4
+ "description": "Declarative flag definitions via the `flags` SDK. Provider-agnostic with official adapters for LaunchDarkly, GrowthBook, Statsig, Hypertune, PostHog, Edge Config, Flagsmith, OpenFeature.",
5
+ "deps": {
6
+ "flags": "4.0.6"
7
+ },
8
+ "vendors": [
9
+ {
10
+ "key": "launchdarkly",
11
+ "label": "LaunchDarkly",
12
+ "deps": {
13
+ "@flags-sdk/launchdarkly": "0.3.4"
14
+ },
15
+ "env": [
16
+ "LAUNCHDARKLY_CLIENT_SIDE_ID",
17
+ "LAUNCHDARKLY_PROJECT_SLUG",
18
+ "EDGE_CONFIG"
19
+ ]
20
+ },
21
+ {
22
+ "key": "statsig",
23
+ "label": "Statsig",
24
+ "deps": {
25
+ "@flags-sdk/statsig": "0.2.5"
26
+ },
27
+ "env": [
28
+ "STATSIG_SERVER_API_KEY"
29
+ ]
30
+ },
31
+ {
32
+ "key": "growthbook",
33
+ "label": "GrowthBook",
34
+ "deps": {
35
+ "@flags-sdk/growthbook": "0.2.0"
36
+ },
37
+ "env": [
38
+ "GROWTHBOOK_CLIENT_KEY"
39
+ ]
40
+ },
41
+ {
42
+ "key": "hypertune",
43
+ "label": "Hypertune",
44
+ "deps": {
45
+ "@flags-sdk/hypertune": "0.3.2"
46
+ },
47
+ "env": [
48
+ "NEXT_PUBLIC_HYPERTUNE_TOKEN",
49
+ "HYPERTUNE_FRAMEWORK",
50
+ "HYPERTUNE_OUTPUT_DIRECTORY_PATH"
51
+ ]
52
+ },
53
+ {
54
+ "key": "posthog",
55
+ "label": "PostHog",
56
+ "deps": {
57
+ "@flags-sdk/posthog": "0.2.2"
58
+ },
59
+ "env": [
60
+ "NEXT_PUBLIC_POSTHOG_KEY",
61
+ "NEXT_PUBLIC_POSTHOG_HOST"
62
+ ]
63
+ }
64
+ ],
65
+ "templates": ["full-stack", "client"]
66
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "greeting": "Welcome to {name}",
3
+ "nav": {
4
+ "home": "Home",
5
+ "features": "Features",
6
+ "pricing": "Pricing"
7
+ },
8
+ "cta": {
9
+ "getStarted": "Get started",
10
+ "learnMore": "Learn more"
11
+ },
12
+ "footer": {
13
+ "copyright": "© {year} {name}. All rights reserved."
14
+ }
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "key": "i18n",
3
+ "label": "Internationalisation (i18n)",
4
+ "description": "Locale resolution, ICU message formatting, date/number/currency formatters, and React hooks.",
5
+ "deps": {
6
+ "@raredays/i18n": "0.0.1"
7
+ },
8
+ "templates": ["full-stack", "client", "static"]
9
+ }
@@ -0,0 +1,7 @@
1
+ const i18nConfig = defineI18nConfig({
2
+ defaultLocale: siteSpec.identity.locales[0]!,
3
+ locales: siteSpec.identity.locales.map((code) => ({ code, label: code })),
4
+ messages: { "en-US": enMessages },
5
+ });
6
+
7
+ const i18nIntl = createIntlInstance({ config: i18nConfig, locale: i18nConfig.defaultLocale });
@@ -0,0 +1 @@
1
+ export { i18nConfig, i18nIntl };
@@ -0,0 +1,2 @@
1
+ import { defineI18nConfig, createIntlInstance, resolveLocaleFromRequest } from "@raredays/i18n";
2
+ import enMessages from "@/messages/en-US.json";
@@ -0,0 +1 @@
1
+ intl: i18nIntl,
@@ -0,0 +1,30 @@
1
+ {
2
+ "key": "identity",
3
+ "label": "Identity (auth, sessions, organizations, roles)",
4
+ "description": "Identity port is always wired with an in-memory dev provider. Select a vendor to add the production adapter, env vars, mock handlers, and Next.js auth route stub.",
5
+ "deps": {
6
+ "@raredays/identity": "0.0.1"
7
+ },
8
+ "vendors": [
9
+ {
10
+ "key": "better-auth",
11
+ "label": "Better Auth (self-hosted)",
12
+ "deps": {
13
+ "@raredays/identity-better-auth": "0.0.1",
14
+ "better-auth": "^1.2.0"
15
+ },
16
+ "env": [
17
+ "BETTER_AUTH_SECRET",
18
+ "BETTER_AUTH_URL"
19
+ ],
20
+ "mocks": {
21
+ "package": "@raredays/identity-better-auth/mocks",
22
+ "named": "betterAuthMocks"
23
+ }
24
+ }
25
+ ],
26
+ "templates": [
27
+ "full-stack",
28
+ "client"
29
+ ]
30
+ }
@@ -0,0 +1,15 @@
1
+ // Better Auth handler mount. Configure your Better Auth instance in
2
+ // `app/lib/auth.ts` (create the file alongside this one), then `toNextJsHandler`
3
+ // adapts it into Next.js App Router GET/POST handlers.
4
+ //
5
+ // Steps to finish wiring (see @raredays/identity-better-auth README):
6
+ // 1. Create `app/lib/auth.ts` — instantiate `betterAuth({ database, ... })`
7
+ // against your Drizzle client.
8
+ // 2. Replace the in-memory provider in `app/lib/runtime.ts` with
9
+ // `createBetterAuthProvider({ auth })` from `@raredays/identity-better-auth`.
10
+ // 3. Fill `BETTER_AUTH_SECRET` + `BETTER_AUTH_URL` in `.env.local`.
11
+
12
+ import { toNextJsHandler } from "@raredays/identity-better-auth";
13
+ import { auth } from "@/lib/auth";
14
+
15
+ export const { GET, POST } = toNextJsHandler(auth);
@@ -0,0 +1,20 @@
1
+ // Better Auth instance used by `app/api/auth/[...all]/route.ts` and by
2
+ // `app/lib/runtime.ts` (via `createBetterAuthProvider({ auth })` from
3
+ // `@raredays/identity-better-auth`).
4
+ //
5
+ // SCAFFOLD STUB — this configuration compiles and lets the app boot, but
6
+ // the in-memory adapter resets on every restart. To finish wiring for
7
+ // production:
8
+ //
9
+ // 1. Install a Better Auth database adapter (e.g. Drizzle):
10
+ // pnpm add better-auth/adapters/drizzle
11
+ // 2. Pass `database: { adapter: ..., schema: ... }` to `betterAuth({...})`.
12
+ // 3. Set BETTER_AUTH_SECRET + BETTER_AUTH_URL in `.env.local`.
13
+ //
14
+ // See @raredays/identity-better-auth README for the full pattern.
15
+
16
+ import { betterAuth } from "better-auth";
17
+
18
+ export const auth = betterAuth({
19
+ emailAndPassword: { enabled: true },
20
+ });
@@ -0,0 +1,12 @@
1
+ {
2
+ "key": "jobs",
3
+ "label": "Background jobs (in-process runner)",
4
+ "description": "Type-safe job definitions, retries, idempotency. In-process runner by default; swap to Inngest/Trigger.dev for durable execution.",
5
+ "deps": {
6
+ "@raredays/jobs": "0.0.1"
7
+ },
8
+ "vendors": [],
9
+ "templates": [
10
+ "full-stack"
11
+ ]
12
+ }
@@ -0,0 +1,4 @@
1
+ // Define your jobs here, then pass them into createInProcJobs:
2
+ // import { defineJob } from "@raredays/jobs";
3
+ // const myJob = defineJob({ name: "demo", handler: async () => { ... } });
4
+ const jobs = createInProcJobs({ jobs: [], mode: "async" });
@@ -0,0 +1 @@
1
+ import { createInProcJobs } from "@raredays/jobs/testing";
@@ -0,0 +1 @@
1
+ jobs,
@@ -0,0 +1,12 @@
1
+ {
2
+ "key": "notifications",
3
+ "label": "Notifications (multi-channel send)",
4
+ "description": "Notification definitions, channels (email + in-app), user preferences, dedupe, delivery logging.",
5
+ "deps": {
6
+ "@raredays/notifications": "0.0.1"
7
+ },
8
+ "vendors": [],
9
+ "templates": [
10
+ "full-stack"
11
+ ]
12
+ }
@@ -0,0 +1,8 @@
1
+ // Define notification types via defineNotification and pass them into the registry:
2
+ // import { defineNotification } from "@raredays/notifications";
3
+ // const welcomeNotification = defineNotification({ type: "account.welcome", ... });
4
+ const notifications = createNotifications({
5
+ registry: createNotificationRegistry([]),
6
+ channels: [createInMemoryChannel("email"), createInMemoryChannel("in-app")],
7
+ deliveryLogger: createInMemoryDeliveryLogger(),
8
+ });
@@ -0,0 +1,5 @@
1
+ import { createNotificationRegistry, createNotifications } from "@raredays/notifications";
2
+ import {
3
+ createInMemoryChannel,
4
+ createInMemoryDeliveryLogger,
5
+ } from "@raredays/notifications/testing";
@@ -0,0 +1 @@
1
+ notifications,
@@ -0,0 +1,12 @@
1
+ {
2
+ "key": "organizations",
3
+ "label": "Organizations (multi-tenancy)",
4
+ "description": "Domain types + role-based permissions for organizations, memberships, and invitations. Pairs with a postgres provider for storage.",
5
+ "deps": {
6
+ "@raredays/organizations": "0.0.1"
7
+ },
8
+ "vendors": [],
9
+ "templates": [
10
+ "full-stack"
11
+ ]
12
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "key": "telemetry",
3
+ "label": "Telemetry (logging, errors, metrics, events)",
4
+ "description": "Vendor-neutral observability port. Console adapters for dev; swap to Sentry + Axiom for production.",
5
+ "deps": {
6
+ "@raredays/telemetry": "0.0.1"
7
+ },
8
+ "vendors": [
9
+ {
10
+ "key": "sentry",
11
+ "label": "Sentry (error reporting)",
12
+ "deps": {
13
+ "@raredays/telemetry-sentry": "0.0.1"
14
+ },
15
+ "env": [
16
+ "SENTRY_DSN"
17
+ ],
18
+ "mocks": {
19
+ "package": "@raredays/telemetry-sentry/mocks",
20
+ "named": "sentryMocks"
21
+ }
22
+ },
23
+ {
24
+ "key": "axiom",
25
+ "label": "Axiom (logging)",
26
+ "deps": {
27
+ "@raredays/telemetry-axiom": "0.0.1"
28
+ },
29
+ "env": [
30
+ "AXIOM_TOKEN",
31
+ "AXIOM_DATASET"
32
+ ],
33
+ "mocks": {
34
+ "package": "@raredays/telemetry-axiom/mocks",
35
+ "named": "axiomMocks"
36
+ }
37
+ }
38
+ ],
39
+ "templates": [
40
+ "full-stack",
41
+ "client"
42
+ ]
43
+ }
@@ -0,0 +1,7 @@
1
+ const logger = createConsoleLogger();
2
+ const telemetry = createTelemetry({
3
+ logger,
4
+ errorReporter: createConsoleErrorReporter(logger),
5
+ metrics: createNoopMetrics(),
6
+ events: createConsoleEvents(logger),
7
+ });
@@ -0,0 +1,7 @@
1
+ import {
2
+ createConsoleErrorReporter,
3
+ createConsoleEvents,
4
+ createConsoleLogger,
5
+ createNoopMetrics,
6
+ createTelemetry,
7
+ } from "@raredays/telemetry";
@@ -0,0 +1 @@
1
+ telemetry,