ship-create 1.3.1 → 1.4.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.
- package/create.mjs +342 -167
- package/package.json +1 -1
- package/templates/.claude/commands/build.md +89 -0
- package/templates/.cursorrules +41 -24
- package/templates/.windsurfrules +41 -24
- package/templates/AGENTS.md +41 -24
- package/templates/CLAUDE.md +41 -24
- package/templates/docs/tech-stack/STACK_DECISION_MATRIX.md +288 -0
- package/templates/docs/tech-stack/TECH_STACK.md +492 -0
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
# TECH_STACK.md
|
|
2
|
+
|
|
3
|
+
**Phase:** S — Structure
|
|
4
|
+
**Purpose:** The default, recommended technical stack for every product built under The SHIP Method OS. Other files in this repo (architecture briefs, build prompts, the decision matrix) assume this stack unless a project explicitly deviates. You don't need to know how any of these tools work internally — you need to know *what each one is for*, *whether it fits your product*, and *what to paste into ChatGPT/Claude/Gemini/Cursor/Windsurf* to set it up correctly.
|
|
5
|
+
|
|
6
|
+
> This is a **default**, not a law. `STACK_DECISION_MATRIX.md` tells you when to swap a piece out (e.g. a landing page doesn't need Supabase). When in doubt, ship with the default — it is chosen specifically because AI tools have the most training data and the fewest hallucinated APIs for these exact tools.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## How to read this file
|
|
11
|
+
|
|
12
|
+
For each layer: **What it's for** → **Best fit** → **Pros** → **Limitations** → a ready-to-paste **AI Prompt** to scaffold or configure it. Replace every `[bracket]` before pasting.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Frontend — Next.js
|
|
17
|
+
|
|
18
|
+
**What it's for:** The framework that renders your product's pages and UI in the browser — buttons, forms, dashboards, navigation, everything the user sees and clicks.
|
|
19
|
+
|
|
20
|
+
**Best fit for:** SaaS, dashboards, membership sites, marketplaces, booking systems, internal tools, lead-gen sites — effectively everything except a single static page (where plain HTML may be simpler).
|
|
21
|
+
|
|
22
|
+
**Pros:**
|
|
23
|
+
- Most widely used React framework — every AI tool has deep training data on it, fewer hallucinated APIs
|
|
24
|
+
- One codebase serves marketing pages, app pages, and API routes — no separate backend needed for simple products
|
|
25
|
+
- Deploys natively to Vercel with zero config
|
|
26
|
+
- Built-in routing, image optimization, and server-side rendering for SEO
|
|
27
|
+
|
|
28
|
+
**Limitations:**
|
|
29
|
+
- Steeper learning curve than plain HTML if you ever need to read the code yourself
|
|
30
|
+
- Server/client component split (App Router) confuses AI tools occasionally — always specify which you want
|
|
31
|
+
- Overkill for a true one-page static landing page with no logic
|
|
32
|
+
|
|
33
|
+
**AI Prompt — Scaffold a Next.js app:**
|
|
34
|
+
```
|
|
35
|
+
Scaffold a new Next.js application for [product name/description].
|
|
36
|
+
|
|
37
|
+
Requirements:
|
|
38
|
+
- Next.js (latest stable, App Router)
|
|
39
|
+
- TypeScript
|
|
40
|
+
- Tailwind CSS pre-configured
|
|
41
|
+
- Folder structure: /app for routes, /components for shared UI, /lib for utilities, /types for shared types
|
|
42
|
+
- A basic layout with header and footer placeholder
|
|
43
|
+
- Environment variable setup for: [list known env vars, e.g. Supabase URL/key, Stripe key]
|
|
44
|
+
|
|
45
|
+
Output:
|
|
46
|
+
1. Full folder/file structure
|
|
47
|
+
2. Contents of every config file (next.config, tsconfig, tailwind config)
|
|
48
|
+
3. A starter page.tsx that confirms the app runs
|
|
49
|
+
4. The exact terminal commands to install and run it locally
|
|
50
|
+
|
|
51
|
+
Do not add any UI library, state management library, or backend integration I haven't asked for — keep this scaffold minimal and clean.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 2. Styling — Tailwind CSS
|
|
57
|
+
|
|
58
|
+
**What it's for:** Controls the visual design — spacing, color, layout, responsiveness — written directly as classes in your markup instead of separate CSS files.
|
|
59
|
+
|
|
60
|
+
**Best fit for:** Every product type. It is the default styling layer across the entire stack.
|
|
61
|
+
|
|
62
|
+
**Pros:**
|
|
63
|
+
- AI tools are extremely fluent in Tailwind — it's the most common styling approach in their training data
|
|
64
|
+
- No separate CSS files to keep in sync; styling lives next to the markup
|
|
65
|
+
- Built-in responsive design utilities (`sm:`, `md:`, `lg:`)
|
|
66
|
+
- Pairs natively with shadcn/ui
|
|
67
|
+
|
|
68
|
+
**Limitations:**
|
|
69
|
+
- Markup can look cluttered with long class lists — not a problem if you're not reading the code yourself
|
|
70
|
+
- Requires a build step (already handled by Next.js)
|
|
71
|
+
- Custom design systems still need a defined theme (colors, fonts) or output will look generic — see `12-DESIGN-SYSTEM/`
|
|
72
|
+
|
|
73
|
+
**AI Prompt — Configure Tailwind theme:**
|
|
74
|
+
```
|
|
75
|
+
Configure Tailwind CSS for this Next.js project with a custom design theme.
|
|
76
|
+
|
|
77
|
+
Brand inputs:
|
|
78
|
+
- Primary color: [hex code or "pick one that fits a {industry} SaaS product"]
|
|
79
|
+
- Secondary/accent color: [hex code or let AI propose 1]
|
|
80
|
+
- Font for headings: [name, or "recommend one"]
|
|
81
|
+
- Font for body text: [name, or "recommend one"]
|
|
82
|
+
- Border radius style: [sharp / soft-rounded / pill-rounded]
|
|
83
|
+
|
|
84
|
+
Output:
|
|
85
|
+
1. Updated tailwind.config (or CSS-based theme tokens if using Tailwind v4) with the colors above as named tokens (e.g. `primary`, `accent`), not hardcoded hex values used directly in components
|
|
86
|
+
2. Font loading setup (next/font or equivalent) for the chosen fonts
|
|
87
|
+
3. A short style guide comment block listing every token and when to use it
|
|
88
|
+
4. One example component (a button) using only the new tokens, to confirm the theme works
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 3. UI Components — shadcn/ui
|
|
94
|
+
|
|
95
|
+
**What it's for:** Pre-built, accessible UI components (buttons, dialogs, dropdowns, forms, tables) that you own and can edit — not a locked-in component library you import as a black box.
|
|
96
|
+
|
|
97
|
+
**Best fit for:** SaaS, dashboards, internal tools, CRMs, membership sites — any product with forms, tables, and interactive UI beyond a marketing page.
|
|
98
|
+
|
|
99
|
+
**Pros:**
|
|
100
|
+
- Components are copied into your codebase, not installed as a dependency — AI tools can read and edit the actual component code
|
|
101
|
+
- Built on Radix UI primitives — accessibility (keyboard nav, ARIA) handled correctly by default
|
|
102
|
+
- Matches Tailwind natively, no styling conflicts
|
|
103
|
+
- Huge ecosystem of extra blocks/templates that extend it
|
|
104
|
+
|
|
105
|
+
**Limitations:**
|
|
106
|
+
- Not a true "package" — updates to the library don't auto-update your copied components
|
|
107
|
+
- Requires Tailwind + a few setup steps before first use (not zero-config)
|
|
108
|
+
- Overkill for a pure marketing/landing page with no interactive elements
|
|
109
|
+
|
|
110
|
+
**AI Prompt — Add and configure shadcn/ui:**
|
|
111
|
+
```
|
|
112
|
+
Set up shadcn/ui in this existing Next.js + Tailwind project.
|
|
113
|
+
|
|
114
|
+
Steps to perform:
|
|
115
|
+
1. Run the shadcn/ui init process and configure it to match this project's existing folder structure (components in /components/ui)
|
|
116
|
+
2. Install these components: [list, e.g. "button, input, dialog, dropdown-menu, card, table, form, toast"]
|
|
117
|
+
3. Confirm the theme tokens from our Tailwind config (see tailwind config) are wired into shadcn's CSS variables, not left as shadcn's defaults
|
|
118
|
+
|
|
119
|
+
Output:
|
|
120
|
+
1. The exact CLI commands to run
|
|
121
|
+
2. Any config file changes (components.json, globals.css)
|
|
122
|
+
3. A confirmation checklist: which components were added and where they live
|
|
123
|
+
4. One example page combining 3 of the installed components, styled with our brand tokens
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 4. Backend — pick a provider
|
|
129
|
+
|
|
130
|
+
**What it's for:** The database (and, for some providers, auth/storage)
|
|
131
|
+
underneath your product's data layer.
|
|
132
|
+
|
|
133
|
+
**Default recommendation:** Supabase, unless you have a specific reason to
|
|
134
|
+
pick something else (see `DB_PROVIDER_GUIDE.md` for those reasons). This OS
|
|
135
|
+
supports four providers, selected once at project setup via a `DB_PROVIDER`
|
|
136
|
+
env var in `starter-kit/.env` — not something you switch at runtime.
|
|
137
|
+
|
|
138
|
+
| Provider | Bundles auth/storage? | Deploy target | Best fit |
|
|
139
|
+
|---|---|---|---|
|
|
140
|
+
| **Supabase** | Yes (Auth, Storage, RLS) | Anywhere (Vercel default) | Most products — one platform, generous free tier |
|
|
141
|
+
| **Neon** | No — DB only | Anywhere (Vercel default) | Postgres-only projects, branching per PR/preview env |
|
|
142
|
+
| **Cloudflare D1** | No — DB only | Cloudflare Workers/Pages **only** | Projects already committed to the Cloudflare edge stack |
|
|
143
|
+
| **Plain Postgres** | No — DB only | Anywhere | You already have a Postgres host (Railway, self-hosted, etc.) |
|
|
144
|
+
|
|
145
|
+
Every provider gets the same Auth.js-based auth layer in `starter-kit/lib/auth.ts` and the same query layer in `starter-kit/lib/db/` (Drizzle ORM) — the provider only changes which driver gets constructed underneath.
|
|
146
|
+
|
|
147
|
+
**Read `./DB_PROVIDER_GUIDE.md` before choosing** — it covers free-tier ceilings, the concrete signal that means "you've outgrown the free tier," and the Cloudflare deploy-target constraint in detail.
|
|
148
|
+
|
|
149
|
+
**AI Prompt — Set up the chosen provider:**
|
|
150
|
+
```
|
|
151
|
+
Help me configure DB_PROVIDER=[supabase|neon|cloudflare-d1|postgres] for [product name/description], using the existing lib/db/, lib/auth.ts, and lib/storage.ts in starter-kit/.
|
|
152
|
+
|
|
153
|
+
Data this product needs to store: [list entities in plain English]
|
|
154
|
+
Who can see/edit what: [describe access rules in plain English]
|
|
155
|
+
|
|
156
|
+
Output:
|
|
157
|
+
1. The filled-in .env values needed for this provider (names only — I'll supply the actual secrets)
|
|
158
|
+
2. The Drizzle schema additions needed for the entities above, added to the existing lib/db/schema.pg.ts (or schema.sqlite.ts if DB_PROVIDER=cloudflare-d1)
|
|
159
|
+
3. The drizzle-kit commands to generate and apply the migration
|
|
160
|
+
4. If DB_PROVIDER=supabase: the Row Level Security (RLS) policies for every new table, as SQL, with a plain-English explanation of what each one allows/blocks
|
|
161
|
+
5. Flag explicitly if any access rule I described is ambiguous before writing it — do not guess at security rules.
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 5. Database — PostgreSQL
|
|
167
|
+
|
|
168
|
+
**What it's for:** The actual database engine underneath Supabase that stores all your product's data in structured tables.
|
|
169
|
+
|
|
170
|
+
**Best fit for:** Every product type using Supabase (it comes bundled — you rarely choose this separately).
|
|
171
|
+
|
|
172
|
+
**Pros:**
|
|
173
|
+
- Industry-standard relational database — best-documented, most AI-training-data-rich database there is
|
|
174
|
+
- Supports complex queries, relationships, and constraints that keep data consistent
|
|
175
|
+
- Free, open-source, no licensing cost ever
|
|
176
|
+
|
|
177
|
+
**Limitations:**
|
|
178
|
+
- Relational schema design requires some planning up front — bad schema design compounds into pain later (see `AI_STACK_PROMPTS.md` for a schema-generation prompt)
|
|
179
|
+
- Not the right choice for pure document/unstructured data at extreme scale (rare for SHIP Method products)
|
|
180
|
+
|
|
181
|
+
**AI Prompt — Review/normalize a schema:**
|
|
182
|
+
```
|
|
183
|
+
Review this database schema for normalization and integrity issues. Target: PostgreSQL (via Supabase).
|
|
184
|
+
|
|
185
|
+
Schema (as plain English or paste existing SQL): [paste]
|
|
186
|
+
|
|
187
|
+
Check for:
|
|
188
|
+
1. Repeated/duplicated data that should be a separate table
|
|
189
|
+
2. Missing foreign key constraints
|
|
190
|
+
3. Missing indexes on columns that will likely be filtered/sorted/joined on
|
|
191
|
+
4. Nullable columns that should probably be required
|
|
192
|
+
5. Missing created_at/updated_at audit columns
|
|
193
|
+
|
|
194
|
+
Output: a list of issues found (or confirmation none exist), followed by the corrected SQL.
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 6. Authentication — Supabase Auth
|
|
200
|
+
|
|
201
|
+
**What it's for:** Handles user sign-up, login, password reset, social login (Google, etc.), and session management — without you building any of that from scratch.
|
|
202
|
+
|
|
203
|
+
**Best fit for:** Any product with user accounts: SaaS, CRM, membership sites, booking systems, dashboards, internal tools.
|
|
204
|
+
|
|
205
|
+
**Pros:**
|
|
206
|
+
- Built directly into Supabase — no separate service or extra integration to wire up
|
|
207
|
+
- Supports email/password, magic links, and OAuth providers (Google, GitHub, etc.) out of the box
|
|
208
|
+
- Ties directly into Row Level Security — `auth.uid()` is available in every policy
|
|
209
|
+
|
|
210
|
+
**Limitations:**
|
|
211
|
+
- Default email templates are plain — plan to customize them before launch (looks unpolished otherwise)
|
|
212
|
+
- Multi-tenant permission logic (e.g. "admin vs. member vs. viewer" inside one workspace) is on you to design via RLS, not provided automatically
|
|
213
|
+
- Self-hosting email sending for auth at scale eventually needs a custom SMTP provider (or pair with Resend)
|
|
214
|
+
|
|
215
|
+
**AI Prompt — Build an auth flow:**
|
|
216
|
+
```
|
|
217
|
+
Implement authentication for [product name] using Supabase Auth in this Next.js (App Router) project.
|
|
218
|
+
|
|
219
|
+
Requirements:
|
|
220
|
+
- Sign-up and login with: [email/password / Google OAuth / magic link — list which]
|
|
221
|
+
- After login, redirect to: [page/route]
|
|
222
|
+
- Protect these routes so only logged-in users can access them: [list routes]
|
|
223
|
+
- Role/permission levels needed (if any): [e.g. "owner, admin, member" — or "none, single role for now"]
|
|
224
|
+
|
|
225
|
+
Output:
|
|
226
|
+
1. The auth setup code (client + server, matching App Router conventions)
|
|
227
|
+
2. Middleware or route protection logic for the protected routes listed
|
|
228
|
+
3. The RLS policy changes needed in Supabase to match these roles, if any
|
|
229
|
+
4. A plain checklist of manual steps to do in the Supabase dashboard (enabling providers, setting redirect URLs)
|
|
230
|
+
|
|
231
|
+
Flag anywhere you had to assume a behavior I didn't specify (e.g. what happens on failed login) rather than silently picking one.
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 7. File Storage — Supabase Storage
|
|
237
|
+
|
|
238
|
+
**What it's for:** Stores and serves files — profile photos, uploaded documents, product images — with the same permission system as your database.
|
|
239
|
+
|
|
240
|
+
**Best fit for:** Any product with file/image uploads: directories, marketplaces, membership sites, CRMs, internal tools with document upload.
|
|
241
|
+
|
|
242
|
+
**Pros:**
|
|
243
|
+
- Same project, same auth, same RLS-style access rules as your database — one mental model
|
|
244
|
+
- Built-in image transformation (resizing) for common cases
|
|
245
|
+
- Public and private buckets supported natively
|
|
246
|
+
|
|
247
|
+
**Limitations:**
|
|
248
|
+
- Large-scale media-heavy products (e.g. a video platform) may eventually outgrow it and need a dedicated CDN/storage provider
|
|
249
|
+
- Storage policies are separate from table RLS policies — easy to forget to lock down a bucket
|
|
250
|
+
|
|
251
|
+
**AI Prompt — Set up file upload with storage rules:**
|
|
252
|
+
```
|
|
253
|
+
Set up file upload for [feature, e.g. "user profile photos" / "document uploads in a CRM"] using Supabase Storage in this Next.js project.
|
|
254
|
+
|
|
255
|
+
Requirements:
|
|
256
|
+
- File types allowed: [e.g. "jpg, png only" / "pdf, docx, jpg"]
|
|
257
|
+
- Max file size: [e.g. "5MB"]
|
|
258
|
+
- Who can upload: [e.g. "any logged-in user, only to their own folder"]
|
|
259
|
+
- Who can view/download: [e.g. "only the uploader and admins"]
|
|
260
|
+
|
|
261
|
+
Output:
|
|
262
|
+
1. Bucket setup (public or private, and why)
|
|
263
|
+
2. Storage policies (SQL) enforcing the upload/view rules above, in plain English first then as SQL
|
|
264
|
+
3. The upload component/function code (client-side) with file-type and size validation before upload
|
|
265
|
+
4. Error handling for: file too large, wrong file type, upload failure, network failure
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 8. Deployment — Vercel
|
|
271
|
+
|
|
272
|
+
**What it's for:** Hosts your live, deployed product on the internet, builds it automatically from your code, and gives you a URL — including preview URLs for every change before it goes live.
|
|
273
|
+
|
|
274
|
+
**Best fit for:** Every product type built with Next.js. This is the native deployment target.
|
|
275
|
+
|
|
276
|
+
**Pros:**
|
|
277
|
+
- Zero-config deployment for Next.js — built by the same team
|
|
278
|
+
- Automatic preview deployments per branch/commit — test before merging to production
|
|
279
|
+
- Built-in analytics, edge functions, and image optimization
|
|
280
|
+
- Free tier sufficient for most MVPs and early-stage products
|
|
281
|
+
|
|
282
|
+
**Limitations:**
|
|
283
|
+
- Costs scale with traffic/bandwidth — watch usage once you have real users
|
|
284
|
+
- Long-running background jobs (e.g. heavy batch processing) need a separate worker, not Vercel functions
|
|
285
|
+
- Custom domain + DNS setup still requires a few manual steps outside any AI tool
|
|
286
|
+
|
|
287
|
+
**AI Prompt — Plan and prep a deployment:**
|
|
288
|
+
```
|
|
289
|
+
I'm about to deploy [product name] (Next.js + Supabase) to Vercel for the first time. Help me prepare.
|
|
290
|
+
|
|
291
|
+
Output:
|
|
292
|
+
1. A pre-deployment checklist: environment variables needed (list what to find from Supabase, Stripe, etc. and where), build command, any config that differs between local and production
|
|
293
|
+
2. The exact steps to connect this repo to Vercel and deploy
|
|
294
|
+
3. How to set up a custom domain and what DNS records to expect
|
|
295
|
+
4. What to verify immediately after the first deploy (e.g. "test signup flow on the live URL, not just locally")
|
|
296
|
+
5. One rollback instruction in case the deploy breaks something — how to revert to the previous working deployment in Vercel specifically
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 9. Analytics — PostHog or Plausible
|
|
302
|
+
|
|
303
|
+
**What it's for:** Tracks how real users behave in your product — what they click, where they drop off, which features get used — so you can make decisions with data instead of guesses.
|
|
304
|
+
|
|
305
|
+
**Best fit for:**
|
|
306
|
+
- **PostHog** — SaaS, dashboards, products needing event-level funnels, feature flags, session replay
|
|
307
|
+
- **Plausible** — landing pages, lead-gen sites, marketing pages needing simple, privacy-friendly pageview/traffic stats without cookie banners
|
|
308
|
+
|
|
309
|
+
**Pros:**
|
|
310
|
+
- PostHog: free self-serve tier, funnels, feature flags, and session replay in one tool — good for product-led growth decisions
|
|
311
|
+
- Plausible: extremely lightweight script, no cookie consent banner required in most jurisdictions, dead simple dashboard
|
|
312
|
+
|
|
313
|
+
**Limitations:**
|
|
314
|
+
- PostHog: more setup than you need if you only want pageviews — don't reach for it on a pure landing page
|
|
315
|
+
- Plausible: no event-level funnel/behavior tracking — not enough once you need to understand in-app usage, not just traffic
|
|
316
|
+
|
|
317
|
+
**AI Prompt — Add analytics tracking:**
|
|
318
|
+
```
|
|
319
|
+
Add [PostHog / Plausible] analytics to this Next.js project.
|
|
320
|
+
|
|
321
|
+
What I need to track: [list key events, e.g. "signup completed, first project created, upgrade to paid plan" for PostHog — or "just pageviews and top referral sources" for Plausible]
|
|
322
|
+
|
|
323
|
+
Output:
|
|
324
|
+
1. Installation steps (script/SDK setup for Next.js App Router)
|
|
325
|
+
2. Where to place the tracking code so it fires correctly (client vs server, layout vs page)
|
|
326
|
+
3. The exact event-tracking code for each event listed above, with a clear event name and any properties worth attaching
|
|
327
|
+
4. A short note on what NOT to track (avoid logging personal data like raw emails/names as event properties)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## 10. Error Tracking — Sentry
|
|
333
|
+
|
|
334
|
+
**What it's for:** Automatically catches and reports bugs/crashes that happen in production — so you find out about errors from real users before they email you (or before they silently leave).
|
|
335
|
+
|
|
336
|
+
**Best fit for:** SaaS, dashboards, CRMs, booking systems — any product live with real users where silent failures are costly.
|
|
337
|
+
|
|
338
|
+
**Pros:**
|
|
339
|
+
- Captures the full error, stack trace, and the user/session context automatically
|
|
340
|
+
- Free tier covers early-stage volume
|
|
341
|
+
- Integrates directly with Next.js and Vercel with minimal setup
|
|
342
|
+
|
|
343
|
+
**Limitations:**
|
|
344
|
+
- Noise: without filtering, you'll get alerted on minor/expected errors too — needs tuning after first week
|
|
345
|
+
- Not useful pre-launch with no real traffic — add it right before or at launch, not on day one of building
|
|
346
|
+
|
|
347
|
+
**AI Prompt — Set up error tracking:**
|
|
348
|
+
```
|
|
349
|
+
Set up Sentry error tracking for this Next.js project, deployed on Vercel.
|
|
350
|
+
|
|
351
|
+
Output:
|
|
352
|
+
1. Installation and config steps (Sentry's Next.js SDK)
|
|
353
|
+
2. Where error boundaries should be added in this app structure to catch UI errors, not just unhandled exceptions
|
|
354
|
+
3. How to make sure errors include useful context (current user ID if logged in, the route/page it happened on) without logging sensitive personal data
|
|
355
|
+
4. How to set up an alert (email/Slack) so I'm notified when a new error type appears, not on every single occurrence of an existing one
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 11. Payments — Stripe
|
|
361
|
+
|
|
362
|
+
**What it's for:** Handles charging customers — one-time payments, subscriptions, invoices — and manages the billing logic (upgrades, downgrades, cancellations, failed payments).
|
|
363
|
+
|
|
364
|
+
**Best fit for:** SaaS, membership sites, booking systems with paid bookings, any product with a paid tier.
|
|
365
|
+
|
|
366
|
+
**Pros:**
|
|
367
|
+
- Industry standard — best documentation and AI training data of any payment provider
|
|
368
|
+
- Stripe Checkout/Billing handles most subscription logic (proration, dunning, invoices) so you don't build it yourself
|
|
369
|
+
- Webhooks let your app stay in sync with payment events automatically
|
|
370
|
+
|
|
371
|
+
**Limitations:**
|
|
372
|
+
- Webhook handling is the #1 source of subtle bugs (missed events, double-processing) — always ask AI tools to make webhook handlers idempotent
|
|
373
|
+
- Test mode vs. live mode mistakes are common — always explicitly state which mode in prompts
|
|
374
|
+
- Tax/VAT handling needs Stripe Tax or a manual decision — don't assume it's automatic
|
|
375
|
+
|
|
376
|
+
**AI Prompt — Set up Stripe billing:**
|
|
377
|
+
```
|
|
378
|
+
Set up Stripe payments for [product name] using Next.js + Supabase.
|
|
379
|
+
|
|
380
|
+
Pricing model: [e.g. "two subscription tiers, $19/mo and $49/mo, both with a 7-day free trial" / "one-time payment of $X per booking"]
|
|
381
|
+
What happens on successful payment: [e.g. "mark user as 'pro' in the users table"]
|
|
382
|
+
What happens on failed payment / cancellation: [e.g. "downgrade to free tier after grace period"]
|
|
383
|
+
|
|
384
|
+
Output:
|
|
385
|
+
1. Stripe product/price setup steps (dashboard, in plain language)
|
|
386
|
+
2. Checkout session creation code (server-side) for this pricing model
|
|
387
|
+
3. Webhook handler code covering: checkout completed, subscription updated, subscription canceled, payment failed — and how each updates Supabase
|
|
388
|
+
4. Explicitly make the webhook handler idempotent (safe if Stripe sends the same event twice) and explain how
|
|
389
|
+
5. A test-mode checklist: which Stripe test cards to use and what each one simulates (success, decline, requires authentication)
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## 12. Email — Resend
|
|
395
|
+
|
|
396
|
+
**What it's for:** Sends transactional emails — welcome emails, password resets, receipts, notifications — programmatically from your app.
|
|
397
|
+
|
|
398
|
+
**Best fit for:** SaaS, CRM, membership sites, booking systems — any product that needs to email users automatically, not just market to them.
|
|
399
|
+
|
|
400
|
+
**Pros:**
|
|
401
|
+
- Built for developers/AI tools to integrate quickly — simple API, good Next.js support
|
|
402
|
+
- Supports React-based email templates (React Email) so styling matches your app's design system
|
|
403
|
+
- Reasonable free tier and clear deliverability tooling (domain verification, SPF/DKIM)
|
|
404
|
+
|
|
405
|
+
**Limitations:**
|
|
406
|
+
- Marketing/bulk email campaigns are not its focus — pair with a dedicated ESP (e.g. for a newsletter at scale)
|
|
407
|
+
- Requires domain verification (SPF/DKIM records) before production sending — a manual DNS step, not something AI can do for you
|
|
408
|
+
|
|
409
|
+
**AI Prompt — Set up transactional email:**
|
|
410
|
+
```
|
|
411
|
+
Set up transactional email using Resend for [product name] (Next.js + Supabase backend).
|
|
412
|
+
|
|
413
|
+
Emails needed: [list, e.g. "welcome email on signup, password reset, booking confirmation, payment receipt"]
|
|
414
|
+
Brand voice for emails: [e.g. "friendly, short, matches our landing page tone" — or paste a sample]
|
|
415
|
+
|
|
416
|
+
Output:
|
|
417
|
+
1. Resend setup steps including domain verification requirements (what DNS records to add, in plain language)
|
|
418
|
+
2. A React Email template for each email listed, matching our brand colors/fonts from the Tailwind theme
|
|
419
|
+
3. The server-side trigger code for each email (where in the app it should be called from, e.g. "after Supabase Auth signup webhook")
|
|
420
|
+
4. How to avoid sending duplicate emails if a trigger fires twice (idempotency)
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## 13. Automation — n8n or Make
|
|
426
|
+
|
|
427
|
+
**What it's for:** Connects your product/tools together for workflows that don't need custom code — e.g. "when a new lead fills the form, add them to the CRM, send a Slack alert, and email them a welcome sequence."
|
|
428
|
+
|
|
429
|
+
**Best fit for:**
|
|
430
|
+
- **n8n** — teams comfortable self-hosting or wanting full control/lower long-term cost at higher volume; more flexible, more technical
|
|
431
|
+
- **Make** — non-technical teams wanting a faster visual setup with no hosting to manage; better for simpler, lower-volume automations
|
|
432
|
+
|
|
433
|
+
**Pros:**
|
|
434
|
+
- Avoids writing/maintaining custom glue code for cross-tool workflows
|
|
435
|
+
- Visual builder — easy to reason about even without dev background
|
|
436
|
+
- Large library of pre-built integrations (Slack, Gmail, Google Sheets, CRMs, Stripe, etc.)
|
|
437
|
+
|
|
438
|
+
**Limitations:**
|
|
439
|
+
- Make: cost scales with operations/runs — can get expensive at volume
|
|
440
|
+
- n8n: self-hosted version requires basic server management; cloud version has its own cost tier
|
|
441
|
+
- Complex conditional logic across many steps gets hard to debug visually past a certain complexity — consider a real backend function instead
|
|
442
|
+
|
|
443
|
+
**AI Prompt — Design an automation workflow:**
|
|
444
|
+
```
|
|
445
|
+
Design an automation workflow for [n8n / Make] to handle: [describe the trigger and desired outcome in plain English, e.g. "when someone submits our signup form, create a Supabase user record, send them a welcome email via Resend, and post a notification to our team Slack channel"]
|
|
446
|
+
|
|
447
|
+
Output:
|
|
448
|
+
1. The trigger (what starts the workflow) and the exact data it receives
|
|
449
|
+
2. Each step in order, naming the specific node/module type to use (e.g. "HTTP Request node", "Supabase node", "Slack node")
|
|
450
|
+
3. Any data transformation needed between steps (field mapping) written out explicitly
|
|
451
|
+
4. Error handling: what should happen if one step fails (e.g. "if Slack notification fails, don't block the user record creation — log it separately instead")
|
|
452
|
+
5. A test plan: how to verify each step worked before trusting the workflow with real data
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## 14. CMS — Notion / Sanity / Directus
|
|
458
|
+
|
|
459
|
+
**What it's for:** Lets non-developers (often the founder, or a content/marketing person) manage editable content — blog posts, FAQ entries, directory listings, marketing page copy — without touching code.
|
|
460
|
+
|
|
461
|
+
**Best fit for:**
|
|
462
|
+
- **Notion (as CMS via API)** — fastest to set up, ideal for a solo founder managing blog/changelog/FAQ content with no separate admin UI needed
|
|
463
|
+
- **Sanity** — structured content with custom fields, image handling, and a real editing UI — good for directories, marketplaces, content-heavy marketing sites
|
|
464
|
+
- **Directus** — when content needs to live in your own Postgres/Supabase database with a generated admin UI on top, not a separate hosted content store
|
|
465
|
+
|
|
466
|
+
**Pros:**
|
|
467
|
+
- Notion: zero extra infrastructure — content team already knows the tool
|
|
468
|
+
- Sanity: purpose-built content modeling, real-time preview, strong image/media pipeline
|
|
469
|
+
- Directus: content lives in the same database as your product data — no syncing two sources of truth
|
|
470
|
+
|
|
471
|
+
**Limitations:**
|
|
472
|
+
- Notion: API rate limits and slower fetch times at scale; not built for high-traffic content delivery
|
|
473
|
+
- Sanity: another service/cost to manage; some learning curve for schema setup
|
|
474
|
+
- Directus: most setup effort of the three; only worth it if content truly needs to live alongside product data
|
|
475
|
+
|
|
476
|
+
**AI Prompt — Wire up a CMS:**
|
|
477
|
+
```
|
|
478
|
+
Connect [Notion / Sanity / Directus] as a CMS for [content type, e.g. "blog posts" / "directory listings" / "FAQ entries"] in this Next.js project.
|
|
479
|
+
|
|
480
|
+
Content fields needed: [list, e.g. "title, slug, cover image, body content, published date, category"]
|
|
481
|
+
Where this content displays: [route/page, e.g. "/blog/[slug]"]
|
|
482
|
+
|
|
483
|
+
Output:
|
|
484
|
+
1. The content model/schema for the CMS chosen, matching the fields listed
|
|
485
|
+
2. The fetch code to pull this content into the Next.js page (server-side, with appropriate caching/revalidation strategy)
|
|
486
|
+
3. How updates in the CMS should reach the live site (on-demand revalidation vs. scheduled rebuild — recommend one and explain why for this content type)
|
|
487
|
+
4. A fallback/empty-state for when content is missing or the CMS fetch fails
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
**Next step:** Use [`STACK_DECISION_MATRIX.md`](./STACK_DECISION_MATRIX.md) to pick which pieces of this stack apply to your specific product type, then use [`AI_STACK_PROMPTS.md`](./AI_STACK_PROMPTS.md) to generate the architecture, schema, and deployment plan before handing anything to Cursor/Windsurf for implementation.
|