generatesaas 3.2.0 → 3.3.1
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.
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Guidelines for AI coding agents (Claude Code, Codex, Cursor, …) in this project.
|
|
2
|
+
Add a rule here only when it prevents a recurring mistake - and never modify this
|
|
3
|
+
file without the user's explicit consent.
|
|
4
|
+
|
|
5
|
+
## Before you build anything
|
|
6
|
+
|
|
7
|
+
This boilerplate ships ~30 config-gated features wired end to end. Before writing a
|
|
8
|
+
new file, route, table, or component, assume it ALREADY EXISTS and go find it:
|
|
9
|
+
|
|
10
|
+
1. `docs/(platform)/index.mdx` - the catalog of every shipped feature and its config flag.
|
|
11
|
+
2. `packages/config/src/index.ts` - the flag that turns it on/off.
|
|
12
|
+
3. Search `packages/` and `{{webAppDir}}/` for the name before creating anything.
|
|
13
|
+
|
|
14
|
+
Already built - extend, never re-implement: auth (email / OAuth / 2FA / passkeys),
|
|
15
|
+
billing & subscriptions, credits, organizations & teams, notifications, email, SMS,
|
|
16
|
+
storage & uploads, admin panel, user settings, audit logs, API keys, onboarding,
|
|
17
|
+
waitlist, blog, banners, i18n, theming, dashboard shell, marketing site, background
|
|
18
|
+
jobs. Duplicating an existing feature, flag, route, or translation is the most
|
|
19
|
+
costly mistake made in this repo.
|
|
20
|
+
|
|
21
|
+
## Stack
|
|
22
|
+
|
|
23
|
+
- **Frontend:** {{webAppName}} {{archSuffix}}
|
|
24
|
+
- **API:** Hono, RPC-typed. {{apiLocation}}
|
|
25
|
+
- **Database:** Drizzle ORM + {{databaseName}}
|
|
26
|
+
- **Cache + jobs:** {{cacheName}} + Inngest
|
|
27
|
+
- **Auth:** Better Auth{{paymentLine}}
|
|
28
|
+
- **Email:** {{emailName}}
|
|
29
|
+
- **Deploy:** {{deployName}}
|
|
30
|
+
|
|
31
|
+
## Where things live
|
|
32
|
+
|
|
33
|
+
- `packages/config/src` - feature flags, routes, site/pricing config.
|
|
34
|
+
- `packages/api/src` - Hono routes (`routes/`), business logic (`services/`), background jobs (`functions/`, Inngest).
|
|
35
|
+
- `packages/database/src` - Drizzle schema + queries.
|
|
36
|
+
- `packages/auth/src/config.ts` - Better Auth config.
|
|
37
|
+
- `packages/runtime/src/env.ts` - validated (Zod) env schema. New env var → add here **and** to `.env.example`; local value in `.env`.
|
|
38
|
+
- `packages/{payments,mail,sms,storage,notifications}` - config-gated integrations. Every provider's files stay even when its feature is off; flipping a flag enables it.
|
|
39
|
+
- `packages/ui/src` - shared components (`@repo/ui`): shadcn/ui primitives on Base UI.
|
|
40
|
+
- `packages/app-core/src` - shared client logic (`@repo/app-core`): hooks, headless controllers, stores. DOM-free; `@repo/ui` may import it, never the reverse.
|
|
41
|
+
- `{{webAppDir}}` - the {{webAppName}} app ({{webAppLayout}}).{{runnerBullet}}
|
|
42
|
+
- `docs/` - feature + architecture docs. Consult before searching from scratch; it cites real config keys and file paths. The CLI docs live under `docs/cli/`{{desktopDocsRef}}.
|
|
43
|
+
|
|
44
|
+
## House rules
|
|
45
|
+
|
|
46
|
+
- TypeScript strict - no `any`, no `as any` / `as unknown as`.
|
|
47
|
+
- JSDoc on exported functions/utilities; no inline comments unless asked.
|
|
48
|
+
- Prefer the shipped libs (Better Auth, Drizzle, Hono) over hand-rolling.
|
|
49
|
+
|
|
50
|
+
## Don't modify
|
|
51
|
+
|
|
52
|
+
- `pnpm-lock.yaml` / `package.json` deps by hand - use `pnpm add` / `pnpm remove`.
|
|
53
|
+
- `packages/database/src/db/auth.ts` - regenerated by `pnpm auth:generate`. Add user fields via `additionalFields` in `packages/auth/src/config.ts`.
|
|
54
|
+
|
|
55
|
+
## Gotchas (where agents trip)
|
|
56
|
+
|
|
57
|
+
- **Hono routes:** keep the method chain (`.get().post()`) - RPC type inference depends on it. Validate with `sValidator` from `@hono/standard-validator`.
|
|
58
|
+
- **Feature flags:** check `config.*` before rendering or executing a toggleable feature; hide it when off.
|
|
59
|
+
- **Navigation:** import `Link` / `redirect` / `useRouter` from `@/lib/navigation` - the locale-aware wrappers - never from `next/link` or `next/navigation` directly, or locale prefixes silently break.
|
|
60
|
+
- **i18n:** strings live in `packages/i18n/translations/{locale}/{scope}.json`; edit `en/` only, keep keys generic. {{i18nRule}} A pre-commit hook syncs other locales (needs `OPENROUTER_API_KEY`; skips without it).
|
|
61
|
+
- **Routes:** use `config.routes.*`, never hardcoded path strings.
|
|
62
|
+
- **Secrets:** never send to an external service; generate tokens/QR codes client-side.
|
|
63
|
+
- **Backend `@repo/*` packages** run on multiple runtimes: prefer web-standard APIs - `crypto.randomUUID()`, the `node:` import prefix, `Uint8Array` over `Buffer`, global `performance.now()`.
|
|
64
|
+
|
|
65
|
+
## This project
|
|
66
|
+
|
|
67
|
+
Scaffolded from the GenerateSaaS boilerplate. To pull upstream updates, ask your
|
|
68
|
+
agent to **"update my GenerateSaaS project"**. To remove the license heartbeat +
|
|
69
|
+
manifest: `pnpm dlx generatesaas eject`.
|