From f11f0700f11975c2dcc6223d6ded75cdd1617883 Mon Sep 17 00:00:00 2001 From: GeekCraft Date: Tue, 3 Mar 2026 11:39:09 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E4=B8=BA=20build=20=E5=92=8C=20db:?= =?UTF-8?q?push=20=E8=84=9A=E6=9C=AC=E6=B7=BB=E5=8A=A0=20.env.local=20?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E5=8A=A0=E8=BD=BD=E5=92=8C?= =?UTF-8?q?=20ensure-extensions=20=E8=84=9A=E6=9C=AC=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index b939742..c50d20c 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -4,13 +4,13 @@ "private": true, "scripts": { "dev": "next dev", - "build": "tsx scripts/ensure-extensions.ts && drizzle-kit push --force && next build", + "build": "dotenv -e .env.local -- tsx scripts/ensure-extensions.ts && drizzle-kit push --force && next build", "build-without-db": "next build", "start": "next start", "lint": "next lint", "db:generate": "drizzle-kit generate", "db:migrate": "drizzle-kit migrate", - "db:push": "drizzle-kit push", + "db:push": "dotenv -e .env.local -- tsx scripts/ensure-extensions.ts && drizzle-kit push", "db:studio": "drizzle-kit studio" }, "dependencies": { From de9c36c8bddf420e20da9c0d3482943f1e09e961 Mon Sep 17 00:00:00 2001 From: GeekCraft Date: Tue, 3 Mar 2026 14:21:50 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/package.json b/apps/web/package.json index c50d20c..359b190 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev", - "build": "dotenv -e .env.local -- tsx scripts/ensure-extensions.ts && drizzle-kit push --force && next build", + "build": "tsx scripts/ensure-extensions.ts && drizzle-kit push --force && next build", "build-without-db": "next build", "start": "next start", "lint": "next lint", From fbdf719c8614e8947b205241e7a3d231b310b369 Mon Sep 17 00:00:00 2001 From: GeekCraft Date: Tue, 3 Mar 2026 15:29:02 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- turbo.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 47ad2ad..c5f383e 100644 --- a/turbo.json +++ b/turbo.json @@ -5,7 +5,21 @@ "build": { "inputs": ["$TURBO_DEFAULT$", ".env*"], "outputs": ["dist/**", ".next/**", "!.next/cache/**"], - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "env": [ + "DATABASE_URL", + "BETTER_AUTH_SECRET", + "BETTER_AUTH_URL", + "NEXT_PUBLIC_APP_URL", + "BLOB_READ_WRITE_TOKEN", + "KV_REST_API_READ_ONLY_TOKEN", + "KV_REST_API_TOKEN", + "KV_REST_API_URL", + "KV_URL", + "REDIS_URL", + "CHROMIUM_EXECUTABLE_PATH", + "VERCEL_ENV" + ] }, "dev": { "cache": false, From 0fc76527239455fb1fe38de8ae33e624db500566 Mon Sep 17 00:00:00 2001 From: GeekCraft Date: Sun, 8 Mar 2026 20:49:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=98=E7=BD=91?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=B3=A8=E5=86=8C=E6=8C=89=E9=92=AE=E6=AD=BB?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 marketing site 增加统一的应用登录注册链接生成工具\n- 将两个头部组件中的登录、注册、立即开始按钮改为跳转到真实认证页面\n- 补充 site 应用的 NEXT_PUBLIC_APP_URL 示例配置和说明文档 --- apps/site/.env.example | 4 ++++ apps/site/.gitignore | 1 + apps/site/README.md | 10 ++++++++++ apps/site/components/header.tsx | 7 ++++--- apps/site/components/site-header.tsx | 7 ++++--- apps/site/lib/app-links.ts | 12 ++++++++++++ 6 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 apps/site/.env.example create mode 100644 apps/site/lib/app-links.ts diff --git a/apps/site/.env.example b/apps/site/.env.example new file mode 100644 index 0000000..0f53686 --- /dev/null +++ b/apps/site/.env.example @@ -0,0 +1,4 @@ +# Public URL of the deployed web app, used by marketing-site auth CTAs. +# Local example: http://127.0.0.1:3000 +# Production example: https://app.example.com +NEXT_PUBLIC_APP_URL= diff --git a/apps/site/.gitignore b/apps/site/.gitignore index 5ef6a52..7b8da95 100644 --- a/apps/site/.gitignore +++ b/apps/site/.gitignore @@ -32,6 +32,7 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example # vercel .vercel diff --git a/apps/site/README.md b/apps/site/README.md index e215bc4..7596a02 100644 --- a/apps/site/README.md +++ b/apps/site/README.md @@ -18,6 +18,16 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +## Environment Variables + +Create `apps/site/.env.local` and set: + +```bash +NEXT_PUBLIC_APP_URL=http://127.0.0.1:3000 +``` + +Use your deployed `apps/web` URL in production so the marketing site login and signup buttons resolve correctly. + This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/apps/site/components/header.tsx b/apps/site/components/header.tsx index bdfe15d..6824eea 100644 --- a/apps/site/components/header.tsx +++ b/apps/site/components/header.tsx @@ -4,6 +4,7 @@ import Link from "next/link" import React from "react" import { Logo } from "@/components/logo" import { Button } from "@/components/ui/button" +import { appLinks } from "@/lib/app-links" import { useSiteI18n } from "@/lib/site-i18n" import { cn } from "@/lib/utils" @@ -161,17 +162,17 @@ export const HeroHeader = ({ previewMode, onPreviewModeChange }: HeroHeaderProps size="sm" variant="outline" > - + {t.nav.login} diff --git a/apps/site/components/site-header.tsx b/apps/site/components/site-header.tsx index b6036a3..5242b09 100644 --- a/apps/site/components/site-header.tsx +++ b/apps/site/components/site-header.tsx @@ -4,6 +4,7 @@ import Link from "next/link" import React from "react" import { Logo } from "@/components/logo" import { Button } from "@/components/ui/button" +import { appLinks } from "@/lib/app-links" import { useSiteI18n } from "@/lib/site-i18n" import { cn } from "@/lib/utils" @@ -103,17 +104,17 @@ export const SiteHeader = () => { size="sm" variant="outline" > - + {t.nav.login} diff --git a/apps/site/lib/app-links.ts b/apps/site/lib/app-links.ts new file mode 100644 index 0000000..5ca5d4d --- /dev/null +++ b/apps/site/lib/app-links.ts @@ -0,0 +1,12 @@ +const DEFAULT_APP_URL = "http://127.0.0.1:3000" + +function normalizeBaseUrl(url: string) { + return url.endsWith("/") ? url.slice(0, -1) : url +} + +const appBaseUrl = normalizeBaseUrl(process.env.NEXT_PUBLIC_APP_URL || DEFAULT_APP_URL) + +export const appLinks = { + login: `${appBaseUrl}/login`, + signup: `${appBaseUrl}/signup`, +}