mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Docker Compose Database Setup (#379)
Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
This commit is contained in:
4
apps/web/.gitignore
vendored
4
apps/web/.gitignore
vendored
@@ -19,10 +19,12 @@
|
||||
/.pnp
|
||||
.pnp.js
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# others
|
||||
.env*.local
|
||||
.vercel
|
||||
next-env.d.ts
|
||||
|
||||
analytics-data.json
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "bun run generate-analytics && bun run generate-schema && next build",
|
||||
"build": "next build",
|
||||
"dev": "next dev --turbopack",
|
||||
"start": "next start",
|
||||
"check": "biome check --write .",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
3
apps/web/public/icon/docker.svg
Normal file
3
apps/web/public/icon/docker.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#008fe2">
|
||||
<path d="M13.98 11.08h2.12a.19.19 0 0 0 .19-.19V9.01a.19.19 0 0 0-.19-.19h-2.12a.18.18 0 0 0-.18.18v1.9c0 .1.08.18.18.18m-2.95-5.43h2.12a.19.19 0 0 0 .18-.19V3.57a.19.19 0 0 0-.18-.18h-2.12a.18.18 0 0 0-.19.18v1.9c0 .1.09.18.19.18m0 2.71h2.12a.19.19 0 0 0 .18-.18V6.29a.19.19 0 0 0-.18-.18h-2.12a.18.18 0 0 0-.19.18v1.89c0 .1.09.18.19.18m-2.93 0h2.12a.19.19 0 0 0 .18-.18V6.29a.18.18 0 0 0-.18-.18H8.1a.18.18 0 0 0-.18.18v1.89c0 .1.08.18.18.18m-2.96 0h2.11a.19.19 0 0 0 .19-.18V6.29a.18.18 0 0 0-.19-.18H5.14a.19.19 0 0 0-.19.18v1.89c0 .1.08.18.19.18m5.89 2.72h2.12a.19.19 0 0 0 .18-.19V9.01a.19.19 0 0 0-.18-.19h-2.12a.18.18 0 0 0-.19.18v1.9c0 .1.09.18.19.18m-2.93 0h2.12a.18.18 0 0 0 .18-.19V9.01a.18.18 0 0 0-.18-.19H8.1a.18.18 0 0 0-.18.18v1.9c0 .1.08.18.18.18m-2.96 0h2.11a.18.18 0 0 0 .19-.19V9.01a.18.18 0 0 0-.18-.19H5.14a.19.19 0 0 0-.19.19v1.88c0 .1.08.19.19.19m-2.92 0h2.12a.18.18 0 0 0 .18-.19V9.01a.18.18 0 0 0-.18-.19H2.22a.18.18 0 0 0-.19.18v1.9c0 .1.08.18.19.18m21.54-1.19c-.06-.05-.67-.51-1.95-.51-.34 0-.68.03-1.01.09a3.77 3.77 0 0 0-1.72-2.57l-.34-.2-.23.33a4.6 4.6 0 0 0-.6 1.43c-.24.97-.1 1.88.4 2.66a4.7 4.7 0 0 1-1.75.42H.76a.75.75 0 0 0-.76.75 11.38 11.38 0 0 0 .7 4.06 6.03 6.03 0 0 0 2.4 3.12c1.18.73 3.1 1.14 5.28 1.14.98 0 1.96-.08 2.93-.26a12.25 12.25 0 0 0 3.82-1.4 10.5 10.5 0 0 0 2.61-2.13c1.25-1.42 2-3 2.55-4.4h.23c1.37 0 2.21-.55 2.68-1 .3-.3.55-.66.7-1.06l.1-.28Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -108,6 +108,7 @@
|
||||
"mongodb-atlas",
|
||||
"supabase",
|
||||
"d1",
|
||||
"docker",
|
||||
"none"
|
||||
],
|
||||
"description": "Database hosting setup"
|
||||
|
||||
@@ -600,6 +600,39 @@ const analyzeStackCompatibility = (stack: StackState): CompatibilityResult => {
|
||||
message: "Backend set to 'Hono' (required by Cloudflare D1)",
|
||||
});
|
||||
}
|
||||
} else if (nextStack.dbSetup === "docker") {
|
||||
if (nextStack.database === "sqlite") {
|
||||
notes.dbSetup.notes.push(
|
||||
"Docker setup is not needed for SQLite. It will be set to 'Basic Setup'.",
|
||||
);
|
||||
notes.dbSetup.hasIssue = true;
|
||||
notes.database.hasIssue = true;
|
||||
nextStack.dbSetup = "none";
|
||||
changed = true;
|
||||
changes.push({
|
||||
category: "dbSetup",
|
||||
message:
|
||||
"DB Setup set to 'Basic Setup' (SQLite doesn't need Docker)",
|
||||
});
|
||||
}
|
||||
|
||||
if (nextStack.runtime === "workers") {
|
||||
notes.dbSetup.notes.push(
|
||||
"Docker setup is not compatible with Cloudflare Workers runtime. Bun runtime will be selected.",
|
||||
);
|
||||
notes.runtime.notes.push(
|
||||
"Cloudflare Workers runtime does not support Docker setup. Bun runtime will be selected.",
|
||||
);
|
||||
notes.dbSetup.hasIssue = true;
|
||||
notes.runtime.hasIssue = true;
|
||||
nextStack.runtime = "bun";
|
||||
changed = true;
|
||||
changes.push({
|
||||
category: "dbSetup",
|
||||
message:
|
||||
"Runtime set to 'Bun' (Workers not compatible with Docker)",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (nextStack.runtime === "workers") {
|
||||
@@ -654,6 +687,24 @@ const analyzeStackCompatibility = (stack: StackState): CompatibilityResult => {
|
||||
"Database set to 'SQLite' (MongoDB not compatible with Workers)",
|
||||
});
|
||||
}
|
||||
|
||||
if (nextStack.dbSetup === "docker") {
|
||||
notes.runtime.notes.push(
|
||||
"Cloudflare Workers runtime does not support Docker setup. D1 will be selected.",
|
||||
);
|
||||
notes.dbSetup.notes.push(
|
||||
"Docker setup is not compatible with Cloudflare Workers runtime. D1 will be selected.",
|
||||
);
|
||||
notes.runtime.hasIssue = true;
|
||||
notes.dbSetup.hasIssue = true;
|
||||
nextStack.dbSetup = "d1";
|
||||
changed = true;
|
||||
changes.push({
|
||||
category: "runtime",
|
||||
message:
|
||||
"DB Setup set to 'D1' (Docker not compatible with Workers)",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const isNuxt = nextStack.webFrontend.includes("nuxt");
|
||||
@@ -887,6 +938,7 @@ const generateCommand = (stackState: StackState): string => {
|
||||
"supabase",
|
||||
"prisma-postgres",
|
||||
"mongodb-atlas",
|
||||
"docker",
|
||||
].includes(stackState.dbSetup);
|
||||
|
||||
if (
|
||||
|
||||
@@ -195,15 +195,20 @@
|
||||
--spacing: 0.25rem;
|
||||
--shadow-2xs: 0px 4px 6px 0px hsl(240 30% 25% / 0.06);
|
||||
--shadow-xs: 0px 4px 6px 0px hsl(240 30% 25% / 0.06);
|
||||
--shadow-sm: 0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 1px 2px -1px
|
||||
--shadow-sm:
|
||||
0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 1px 2px -1px
|
||||
hsl(240 30% 25% / 0.12);
|
||||
--shadow: 0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 1px 2px -1px
|
||||
--shadow:
|
||||
0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 1px 2px -1px
|
||||
hsl(240 30% 25% / 0.12);
|
||||
--shadow-md: 0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 2px 4px -1px
|
||||
--shadow-md:
|
||||
0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 2px 4px -1px
|
||||
hsl(240 30% 25% / 0.12);
|
||||
--shadow-lg: 0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 4px 6px -1px
|
||||
--shadow-lg:
|
||||
0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 4px 6px -1px
|
||||
hsl(240 30% 25% / 0.12);
|
||||
--shadow-xl: 0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 8px 10px -1px
|
||||
--shadow-xl:
|
||||
0px 4px 6px 0px hsl(240 30% 25% / 0.12), 0px 8px 10px -1px
|
||||
hsl(240 30% 25% / 0.12);
|
||||
--shadow-2xl: 0px 4px 6px 0px hsl(240 30% 25% / 0.3);
|
||||
--tracking-normal: 0em;
|
||||
@@ -258,15 +263,20 @@
|
||||
--spacing: 0.25rem;
|
||||
--shadow-2xs: 0px 2px 4px 0px hsl(240 30% 5% / 0.15);
|
||||
--shadow-xs: 0px 2px 4px 0px hsl(240 30% 5% / 0.15);
|
||||
--shadow-sm: 0px 4px 8px 0px hsl(240 30% 5% / 0.2), 0px 1px 2px -1px
|
||||
--shadow-sm:
|
||||
0px 4px 8px 0px hsl(240 30% 5% / 0.2), 0px 1px 2px -1px
|
||||
hsl(240 30% 5% / 0.15);
|
||||
--shadow: 0px 4px 8px 0px hsl(240 30% 5% / 0.2), 0px 1px 2px -1px
|
||||
--shadow:
|
||||
0px 4px 8px 0px hsl(240 30% 5% / 0.2), 0px 1px 2px -1px
|
||||
hsl(240 30% 5% / 0.15);
|
||||
--shadow-md: 0px 6px 12px 0px hsl(240 30% 5% / 0.25), 0px 2px 4px -1px
|
||||
--shadow-md:
|
||||
0px 6px 12px 0px hsl(240 30% 5% / 0.25), 0px 2px 4px -1px
|
||||
hsl(240 30% 5% / 0.2);
|
||||
--shadow-lg: 0px 8px 16px 0px hsl(240 30% 5% / 0.3), 0px 4px 6px -1px
|
||||
--shadow-lg:
|
||||
0px 8px 16px 0px hsl(240 30% 5% / 0.3), 0px 4px 6px -1px
|
||||
hsl(240 30% 5% / 0.25);
|
||||
--shadow-xl: 0px 12px 24px 0px hsl(240 30% 5% / 0.35), 0px 8px 10px -1px
|
||||
--shadow-xl:
|
||||
0px 12px 24px 0px hsl(240 30% 5% / 0.35), 0px 8px 10px -1px
|
||||
hsl(240 30% 5% / 0.3);
|
||||
--shadow-2xl: 0px 16px 32px 0px hsl(240 30% 5% / 0.4);
|
||||
}
|
||||
|
||||
@@ -311,6 +311,13 @@ export const TECH_OPTIONS = {
|
||||
icon: "/icon/supabase.svg",
|
||||
color: "from-emerald-400 to-emerald-600",
|
||||
},
|
||||
{
|
||||
id: "docker",
|
||||
name: "Docker",
|
||||
description: "Local database with Docker Compose",
|
||||
icon: "/icon/docker.svg",
|
||||
color: "from-blue-500 to-blue-700",
|
||||
},
|
||||
{
|
||||
id: "none",
|
||||
name: "Basic Setup",
|
||||
|
||||
Reference in New Issue
Block a user