Skip to content

Commit 8ed0a1d

Browse files
fix(web): allow auth and payments when database is none
1 parent b6da27e commit 8ed0a1d

File tree

6 files changed

+12
-109
lines changed

6 files changed

+12
-109
lines changed

apps/cli/src/prompts/auth.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { exitCancelled } from "../utils/errors";
55

66
export async function getAuthChoice(
77
auth: Auth | undefined,
8-
hasDatabase: boolean,
98
backend?: Backend,
109
frontend?: string[],
1110
) {
@@ -61,8 +60,6 @@ export async function getAuthChoice(
6160
return response as Auth;
6261
}
6362

64-
if (!hasDatabase) return "none";
65-
6663
const response = await select({
6764
message: "Select authentication provider",
6865
options: [

apps/cli/src/prompts/config-prompts.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,7 @@ export async function gatherConfig(
8484
results.backend,
8585
) as Promise<API>,
8686
auth: ({ results }) =>
87-
getAuthChoice(
88-
flags.auth,
89-
results.database !== "none",
90-
results.backend,
91-
results.frontend,
92-
),
87+
getAuthChoice(flags.auth, results.backend, results.frontend),
9388
payments: ({ results }) =>
9489
getPaymentsChoice(
9590
flags.payments,

apps/cli/src/utils/compatibility-rules.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,6 @@ export function validateWorkersCompatibility(
147147
"MongoDB database is not compatible with Cloudflare Workers runtime. MongoDB requires Prisma or Mongoose ORM, but Workers runtime only supports Drizzle or Prisma ORM. Please use a different database or runtime.",
148148
);
149149
}
150-
151-
if (
152-
providedFlags.has("dbSetup") &&
153-
options.dbSetup === "docker" &&
154-
config.runtime === "workers"
155-
) {
156-
exitWithError(
157-
"Docker setup (--db-setup docker) is not compatible with Cloudflare Workers runtime. Workers runtime uses serverless databases (D1) and doesn't support local Docker containers. Please use '--db-setup d1' for SQLite or choose a different runtime.",
158-
);
159-
}
160150
}
161151

162152
export function validateApiFrontendCompatibility(

apps/cli/src/utils/config-validation.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,6 @@ export function validateDatabaseOrmAuth(
6464
"ORM selection requires a database. Please choose a database or set '--orm none'.",
6565
);
6666
}
67-
68-
if (
69-
has("auth") &&
70-
has("database") &&
71-
cfg.auth !== "none" &&
72-
db === "none" &&
73-
cfg.backend !== "convex"
74-
) {
75-
exitWithError(
76-
"Authentication requires a database. Please choose a database or set '--auth none'.",
77-
);
78-
}
79-
80-
if (cfg.auth !== "none" && db === "none" && cfg.backend !== "convex") {
81-
exitWithError(
82-
"Authentication requires a database. Please choose a database or set '--auth none'.",
83-
);
84-
}
85-
86-
if (orm && orm !== "none" && db === "none") {
87-
exitWithError(
88-
"ORM selection requires a database. Please choose a database or set '--orm none'.",
89-
);
90-
}
9167
}
9268

9369
export function validateDatabaseSetup(

apps/web/content/docs/cli/compatibility.mdx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,21 @@ create-better-t-stack --frontend next native-nativewind
166166
### Better-Auth Requirements
167167
Better-Auth authentication requires:
168168
- A backend framework (cannot be `none`)
169-
- A database (cannot be `none`)
170-
- An ORM (cannot be `none`)
169+
- With database: Requires an ORM
170+
- Without database: Works with Convex backend or custom configuration
171171

172172
### Clerk Requirements
173173
Clerk authentication requires:
174174
- Convex backend (`--backend convex`)
175175
- Compatible frontends (React frameworks, Next.js, TanStack Start, native frameworks)
176176
- Not compatible with Nuxt, Svelte, or Solid
177177

178+
### Payments Requirements
179+
Polar payments require:
180+
- Better-Auth authentication
181+
178182
```bash
179-
# ❌ Invalid - Better-Auth without database
183+
# ✅ Valid - Better-Auth without database
180184
create-better-t-stack --auth better-auth --database none
181185

182186
# ✅ Valid - Better-Auth with full stack
@@ -219,12 +223,12 @@ create-better-t-stack --runtime workers --backend hono
219223
create-better-t-stack --frontend tanstack-router
220224
```
221225

222-
### "Authentication requires a database"
226+
### "Polar payments requires Better Auth"
223227
```bash
224-
# Fix by adding database for Better-Auth
225-
create-better-t-stack --auth better-auth --database postgres --orm drizzle
228+
# Fix by using Better-Auth
229+
create-better-t-stack --payments polar --auth better-auth
226230

227-
# Or use Clerk with Convex (no database required)
231+
# Or use Clerk with Convex (no payments support)
228232
create-better-t-stack --auth clerk --backend convex
229233
```
230234

apps/web/src/app/(home)/new/_components/utils.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -357,23 +357,6 @@ export const analyzeStackCompatibility = (
357357
"ORM set to 'None' (ORM requires a database but 'None' was selected)",
358358
});
359359
}
360-
if (nextStack.auth !== "none" && nextStack.backend !== "convex") {
361-
notes.database.notes.push(
362-
"Database 'None' selected: Auth will be disabled.",
363-
);
364-
notes.auth.notes.push(
365-
"Authentication requires a database. It will be set to 'None'.",
366-
);
367-
notes.database.hasIssue = true;
368-
notes.auth.hasIssue = true;
369-
nextStack.auth = "none";
370-
changed = true;
371-
changes.push({
372-
category: "database",
373-
message:
374-
"Authentication set to 'None' (auth requires a database but 'None' was selected)",
375-
});
376-
}
377360
if (nextStack.dbSetup !== "none") {
378361
notes.database.notes.push(
379362
"Database 'None' selected: DB Setup will be set to 'Basic'.",
@@ -1053,42 +1036,6 @@ export const analyzeStackCompatibility = (
10531036
if (nextStack.addons.length !== originalAddonsLength) changed = true;
10541037
}
10551038

1056-
if (
1057-
nextStack.addons.includes("husky") &&
1058-
!nextStack.addons.includes("biome") &&
1059-
!nextStack.addons.includes("oxlint")
1060-
) {
1061-
notes.addons.notes.push(
1062-
"Husky addon is selected without a linter. Consider adding Biome or Oxlint for lint-staged integration.",
1063-
);
1064-
}
1065-
1066-
if (nextStack.addons.includes("ultracite")) {
1067-
if (nextStack.addons.includes("biome")) {
1068-
notes.addons.notes.push(
1069-
"Ultracite includes Biome setup. Biome addon will be removed.",
1070-
);
1071-
nextStack.addons = nextStack.addons.filter(
1072-
(addon) => addon !== "biome",
1073-
);
1074-
changed = true;
1075-
changes.push({
1076-
category: "addons",
1077-
message:
1078-
"Biome addon removed (Ultracite already includes Biome configuration)",
1079-
});
1080-
}
1081-
}
1082-
1083-
if (
1084-
nextStack.addons.includes("oxlint") &&
1085-
nextStack.addons.includes("biome")
1086-
) {
1087-
notes.addons.notes.push(
1088-
"Both Oxlint and Biome are selected. Consider using only one linter.",
1089-
);
1090-
}
1091-
10921039
const incompatibleExamples: string[] = [];
10931040

10941041
if (
@@ -1809,12 +1756,6 @@ export const getDisabledReason = (
18091756
}
18101757
}
18111758

1812-
if (category === "addons" && optionId === "ultracite") {
1813-
if (finalStack.addons.includes("biome")) {
1814-
return "Ultracite already includes Biome configuration. Remove Biome addon first.";
1815-
}
1816-
}
1817-
18181759
if (category === "examples" && optionId === "todo") {
18191760
if (finalStack.database === "none") {
18201761
return "Todo example requires a database. Select a database first.";

0 commit comments

Comments
 (0)