Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/site/.env.example
Original file line number Diff line number Diff line change
@@ -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=
1 change: 1 addition & 0 deletions apps/site/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.example

# vercel
.vercel
Expand Down
10 changes: 10 additions & 0 deletions apps/site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions apps/site/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -161,17 +162,17 @@ export const HeroHeader = ({ previewMode, onPreviewModeChange }: HeroHeaderProps
size="sm"
variant="outline"
>
<Link href="#">
<Link href={appLinks.login}>
<span>{t.nav.login}</span>
</Link>
</Button>
<Button asChild className={cn(isScrolled && "lg:hidden")} size="sm">
<Link href="#">
<Link href={appLinks.signup}>
<span>{t.nav.signup}</span>
</Link>
</Button>
<Button asChild className={cn(isScrolled ? "lg:inline-flex" : "hidden")} size="sm">
<Link href="#">
<Link href={appLinks.signup}>
<span>{t.nav.getStarted}</span>
</Link>
</Button>
Expand Down
7 changes: 4 additions & 3 deletions apps/site/components/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -103,17 +104,17 @@ export const SiteHeader = () => {
size="sm"
variant="outline"
>
<Link href="#">
<Link href={appLinks.login}>
<span>{t.nav.login}</span>
</Link>
</Button>
<Button asChild className={cn(isScrolled && "lg:hidden")} size="sm">
<Link href="#">
<Link href={appLinks.signup}>
<span>{t.nav.signup}</span>
</Link>
</Button>
<Button asChild className={cn(isScrolled ? "lg:inline-flex" : "hidden")} size="sm">
<Link href="#">
<Link href={appLinks.signup}>
<span>{t.nav.getStarted}</span>
</Link>
</Button>
Expand Down
12 changes: 12 additions & 0 deletions apps/site/lib/app-links.ts
Original file line number Diff line number Diff line change
@@ -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`,
}
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint": "biome 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": {
Expand Down
16 changes: 15 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down