-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: simplify to minimal Next.js starter (remove auth/db, retain UI stack) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…middleware, and remove AuthUI provider. Clean custom styles of better-auth-ui import Co-authored-by: Capy <capy@capy.ai>
… client) Co-authored-by: Capy <capy@capy.ai>
…h; update header to simple nav Co-authored-by: Capy <capy@capy.ai>
…s to generic starter branding, and rename logo component to a generic name Co-authored-by: Capy <capy@capy.ai>
…ckage), update .env.example, rewrite README, and tidy cspell config Co-authored-by: Capy <capy@capy.ai>
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAuth and database layers were removed, along with related middleware, routes, schemas, migrations, and tooling. The project was rebranded and simplified: new public pages (Home, About, Components), a health API route, streamlined env handling, and updated docs and constants. UI/header updated; progress provider simplified. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Browser
participant App as Next.js App
participant UI as Providers/Components
User->>Browser: Navigate to "/"
Browser->>App: Request Home page
App-->>UI: Render public content (no auth checks)
UI-->>Browser: HTML/CSS (hero, cards, links)
Browser-->>User: Page displayed
sequenceDiagram
autonumber
actor Client
participant API as /api/health
participant Runtime as NextResponse
Client->>API: GET /api/health
API->>Runtime: NextResponse.json({ status: "ok" })
Runtime-->>Client: 200 OK with JSON
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/env.ts (1)
11-19
: Set a better client fallback chain for BASE_URL (preview-safe).Prefer
VERCEL_URL
(preview domain) beforeVERCEL_PROJECT_PRODUCTION_URL
so metadata/canonicals are correct on previews.experimental__runtimeEnv: { NEXT_PUBLIC_BASE_URL: - process.env.NEXT_PUBLIC_BASE_URL ?? - (process.env.VERCEL_PROJECT_PRODUCTION_URL - ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}` - : undefined), + process.env.NEXT_PUBLIC_BASE_URL ?? + (process.env.VERCEL_URL + ? `https://${process.env.VERCEL_URL}` + : process.env.VERCEL_PROJECT_PRODUCTION_URL + ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}` + : undefined), },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (30)
.cspell.json
(1 hunks).env.example
(1 hunks)README.md
(1 hunks)drizzle.config.ts
(0 hunks)drizzle/0000_powerful_ulik.sql
(0 hunks)drizzle/meta/0000_snapshot.json
(0 hunks)drizzle/meta/_journal.json
(0 hunks)package.json
(2 hunks)src/app/about/page.tsx
(1 hunks)src/app/account/[path]/page.tsx
(0 hunks)src/app/api/auth/[...all]/route.ts
(0 hunks)src/app/api/auth/guest/route.ts
(0 hunks)src/app/api/health/route.ts
(1 hunks)src/app/auth/[path]/page.tsx
(0 hunks)src/app/components/page.tsx
(1 hunks)src/app/page.tsx
(1 hunks)src/app/providers.tsx
(1 hunks)src/components/header.tsx
(1 hunks)src/components/logos/mark.tsx
(1 hunks)src/env.ts
(1 hunks)src/lib/auth-client.ts
(0 hunks)src/lib/constants.tsx
(1 hunks)src/lib/metadata.ts
(2 hunks)src/middleware.ts
(0 hunks)src/routes.ts
(0 hunks)src/server/auth/index.ts
(0 hunks)src/server/db/index.ts
(0 hunks)src/server/db/schema/auth.ts
(0 hunks)src/server/db/schema/index.ts
(0 hunks)src/styles/custom.css
(1 hunks)
💤 Files with no reviewable changes (15)
- drizzle/meta/_journal.json
- drizzle/meta/0000_snapshot.json
- src/app/account/[path]/page.tsx
- src/server/db/index.ts
- src/server/auth/index.ts
- src/middleware.ts
- src/lib/auth-client.ts
- src/server/db/schema/auth.ts
- src/app/api/auth/[...all]/route.ts
- src/server/db/schema/index.ts
- src/routes.ts
- drizzle.config.ts
- drizzle/0000_powerful_ulik.sql
- src/app/auth/[path]/page.tsx
- src/app/api/auth/guest/route.ts
🧰 Additional context used
🧬 Code graph analysis (5)
src/app/components/page.tsx (3)
src/components/ui/card.tsx (5)
Card
(85-85)CardHeader
(86-86)CardTitle
(88-88)CardDescription
(90-90)CardContent
(91-91)src/components/ui/button.tsx (1)
Button
(59-59)src/components/ui/input.tsx (1)
Input
(21-21)
src/components/header.tsx (2)
src/lib/constants.tsx (2)
logo
(20-20)APP_NAME
(16-16)src/components/ui/button.tsx (1)
Button
(59-59)
src/app/page.tsx (2)
src/components/ui/button.tsx (1)
Button
(59-59)src/components/ui/card.tsx (4)
Card
(85-85)CardHeader
(86-86)CardTitle
(88-88)CardContent
(91-91)
src/lib/metadata.ts (1)
src/env.ts (1)
env
(5-20)
src/app/providers.tsx (1)
src/components/tailwind-indicator.tsx (1)
TailwindIndicator
(1-14)
🪛 markdownlint-cli2 (0.17.2)
README.md
6-6: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
15-15: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
24-24: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
24-24: Bare URL used
(MD034, no-bare-urls)
25-25: Bare URL used
(MD034, no-bare-urls)
26-26: Bare URL used
(MD034, no-bare-urls)
29-29: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
🔇 Additional comments (7)
src/styles/custom.css (1)
29-34
: iOS Dynamic Type block looks good.No issues with the @supports rule; safe to keep.
.cspell.json (1)
12-12
: Spellchecker ignorePaths update is appropriate.Removing drizzle/** from ignores aligns with its removal from the repo.
src/app/components/page.tsx (1)
5-38
: LGTM for the static showcase.Clean, minimal examples using shadcn/ui.
src/app/about/page.tsx (1)
3-20
: About page reads well and matches the starter scope.No issues.
src/app/providers.tsx (1)
17-27
: ProgressProvider props verified — types OK; confirm delay/stopDelay & startOnLoad are intentional
- height: string (default "2px") — height="2px" is correct.
- color: string (default "#0A2FFF"); options: BProgressOptions — options={{ showSpinner: false }} is valid.
- delay / stopDelay: number (default 0) — code uses 1000 (ms) which adds a 1s delay/stopDelay; confirm this UX choice.
- startOnLoad / shallowRouting: boolean (default false) — presence in JSX enables true; confirm desired behavior.
package.json (1)
1-86
: Verify dependency versions and sitemap config.
- dotenv@17.2.2 is published (confirmed).
- next-sitemap.config.ts sets siteUrl to env.NEXT_PUBLIC_BASE_URL || 'https://example.com' (imports env from ./src/env.ts).
- ripgrep search returned "No files were searched" — cannot confirm removal of auth/DB refs. Re-run repo-wide search and paste results:
rg -nPI --hidden --no-ignore-vcs '(better[-_ ]?auth|drizzle|neon|BETTER_AUTH|DATABASE_URL|CORS_ORIGIN)' -g '!node_modules/**'src/lib/constants.tsx (1)
1-12
: LGTM — branding/constants update looks consistent.Names, description, and logo swap align with the new starter.
# Environment variables are optional for this starter. | ||
# You can copy this file to `.env` and uncomment values if needed. | ||
|
||
# This file will be committed to version control, so make sure not to have any secrets in it. | ||
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets. | ||
# Public base URL of your site (optional) | ||
# NEXT_PUBLIC_BASE_URL=http://localhost:3000 | ||
|
||
# When adding additional environment variables, the schema in "/src/env.ts" | ||
# should be updated accordingly. | ||
|
||
# Database URL | ||
# The database URL is used to connect to your database. It's used for commenting, and authentication. | ||
DATABASE_URL="postgresql://postgres:<YOUR_PASSWORD>@localhost:5432/starter" | ||
|
||
# Authentication | ||
# You can generate the secret via 'openssl rand -base64 32' on Unix | ||
# @see https://www.better-auth.com/docs/installation | ||
BETTER_AUTH_SECRET="" | ||
|
||
# CORS allowed origins for auth endpoints | ||
# Accepts a comma-separated list OR a JSON array of URLs | ||
CORS_ORIGIN="http://localhost:3000" | ||
|
||
# Production URL | ||
# Used for authentication and metadata generation | ||
NEXT_PUBLIC_BASE_URL=http://localhost:3000 | ||
# Build-time / tooling (optional) | ||
# ANALYZE=false | ||
# SOURCE_MAPS=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Prefer .env.local and verify unused vars.
Next.js commonly uses .env.local for local overrides. Also, confirm ANALYZE
/SOURCE_MAPS
are actually consumed.
-# You can copy this file to `.env` and uncomment values if needed.
+# You can copy this file to `.env.local` and uncomment values if needed.
# Public base URL of your site (optional)
# NEXT_PUBLIC_BASE_URL=http://localhost:3000
# Build-time / tooling (optional)
# ANALYZE=false
# SOURCE_MAPS=false
+# NEXT_TELEMETRY_DISABLED=1
Run to verify usage:
🏁 Script executed:
#!/bin/bash
rg -nC2 -F "process.env.ANALYZE" || true
rg -nC2 -F "process.env.SOURCE_MAPS" || true
Length of output: 431
Prefer .env.local; ANALYZE and SOURCE_MAPS are used.
next.config.ts reads process.env.ANALYZE (line 45) and process.env.SOURCE_MAPS (line 13) — change the .env.example instruction to copy to .env.local
and keep the ANALYZE/SOURCE_MAPS entries. Optionally add NEXT_TELEMETRY_DISABLED=1.
-# You can copy this file to `.env` and uncomment values if needed.
+# You can copy this file to `.env.local` and uncomment values if needed.
# Public base URL of your site (optional)
# NEXT_PUBLIC_BASE_URL=http://localhost:3000
# Build-time / tooling (optional)
# ANALYZE=false
# SOURCE_MAPS=false
+# NEXT_TELEMETRY_DISABLED=1
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
# Environment variables are optional for this starter. | |
# You can copy this file to `.env` and uncomment values if needed. | |
# This file will be committed to version control, so make sure not to have any secrets in it. | |
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets. | |
# Public base URL of your site (optional) | |
# NEXT_PUBLIC_BASE_URL=http://localhost:3000 | |
# When adding additional environment variables, the schema in "/src/env.ts" | |
# should be updated accordingly. | |
# Database URL | |
# The database URL is used to connect to your database. It's used for commenting, and authentication. | |
DATABASE_URL="postgresql://postgres:<YOUR_PASSWORD>@localhost:5432/starter" | |
# Authentication | |
# You can generate the secret via 'openssl rand -base64 32' on Unix | |
# @see https://www.better-auth.com/docs/installation | |
BETTER_AUTH_SECRET="" | |
# CORS allowed origins for auth endpoints | |
# Accepts a comma-separated list OR a JSON array of URLs | |
CORS_ORIGIN="http://localhost:3000" | |
# Production URL | |
# Used for authentication and metadata generation | |
NEXT_PUBLIC_BASE_URL=http://localhost:3000 | |
# Build-time / tooling (optional) | |
# ANALYZE=false | |
# SOURCE_MAPS=false | |
# Environment variables are optional for this starter. | |
# You can copy this file to `.env.local` and uncomment values if needed. | |
# Public base URL of your site (optional) | |
# NEXT_PUBLIC_BASE_URL=http://localhost:3000 | |
# Build-time / tooling (optional) | |
# ANALYZE=false | |
# SOURCE_MAPS=false | |
# NEXT_TELEMETRY_DISABLED=1 |
🤖 Prompt for AI Agents
In .env.example around lines 1 to 9, update the usage instructions to recommend
copying to `.env.local` (not `.env`), reintroduce commented ANALYZE and
SOURCE_MAPS entries so they match next.config.ts expectations, and optionally
add a commented NEXT_TELEMETRY_DISABLED=1 line; ensure the example shows the
three variables commented out with brief labels so developers can enable ANALYZE
and SOURCE_MAPS and disable telemetry if desired.
Features | ||
- Next.js (App Router) + TypeScript (strict) | ||
- Tailwind CSS v4 with modern design tokens | ||
- shadcn/ui components (Button, Card, Input, and more) | ||
- Dark mode via next-themes | ||
- Toasts with sonner | ||
- Navigation progress bar with bprogress | ||
- SEO metadata helpers and sensible security headers | ||
|
||
## Quickstart | ||
Pages included | ||
- `/` — Welcome page with quick links and stack overview | ||
- `/about` — Example static page showing metadata usage | ||
- `/components` — Simple gallery using shadcn/ui components | ||
- `/api/health` — Minimal API responding with `{ status: "ok" }` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix markdownlint issues (blank lines + bare URLs).
Add blank lines around lists and format URLs as Markdown links.
-Features
+- Features
+
- Next.js (App Router) + TypeScript (strict)
@@
-Pages included
+- Pages included
+
- `/` — Welcome page with quick links and stack overview
@@
-Getting started
+- Getting started
+
This starter has zero required environment variables. Clone the repo and start building.
@@
-How to add Auth and DB later
+- How to add Auth and DB later
+
-- Auth: better-auth — https://better-auth.com/docs
-- UI: better-auth-ui — https://better-auth-ui.com
-- ORM/DB: Drizzle ORM — https://orm.drizzle.team/docs
+- Auth: better-auth — <https://better-auth.com/docs>
+- UI: better-auth-ui — <https://better-auth-ui.com>
+- ORM/DB: Drizzle ORM — <https://orm.drizzle.team/docs>
@@
-Notes
+- Notes
+
- The project intentionally excludes auth and database code to give you a clean base. Add your preferred solutions when you need them.
Also applies to: 20-27, 28-35
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
6-6: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
15-15: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
🤖 Prompt for AI Agents
In README.md around lines 5 to 18 (and also apply to 20-27 and 28-35), the
markdown lists lack surrounding blank lines and there are bare URLs; to fix, add
a blank line before each list and after each list block, and replace any bare
URLs with proper Markdown link syntax ([text](url)) or inline link text,
ensuring list items remain unchanged; run markdownlint to verify no more
blank-line or bare-URL warnings.
import { NextResponse } from "next/server" | ||
|
||
export async function GET() { | ||
return NextResponse.json({ status: "ok" }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Make health endpoint non-caching and add HEAD handler.
Avoid accidental caching and support HEAD. Also GET
needn’t be async.
-import { NextResponse } from "next/server"
+import { NextResponse } from "next/server"
-export async function GET() {
- return NextResponse.json({ status: "ok" })
-}
+export const revalidate = 0
+
+export function GET() {
+ return NextResponse.json({ status: "ok" })
+}
+
+export function HEAD() {
+ return new Response(null, { status: 200 })
+}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { NextResponse } from "next/server" | |
export async function GET() { | |
return NextResponse.json({ status: "ok" }) | |
} | |
import { NextResponse } from "next/server" | |
export const revalidate = 0 | |
export function GET() { | |
return NextResponse.json({ status: "ok" }) | |
} | |
export function HEAD() { | |
return new Response(null, { status: 200 }) | |
} |
🤖 Prompt for AI Agents
In src/app/api/health/route.ts lines 1-5, change GET to a synchronous function
that returns a non-cacheable NextResponse.json (set Cache-Control: 'no-store,
max-age=0' or use { cache: 'no-store' }), and add a HEAD handler that returns
the same status headers with no body (e.g., new NextResponse(null, { status:
200, headers })) so clients can perform HEAD requests and responses are not
cached.
<Button variant="ghost" asChild> | ||
<Link href="https://nextjs.org/docs" target="_blank" className="inline-flex items-center gap-2">Next.js Docs <ArrowRight className="size-4" /></Link> | ||
</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add rel="noopener noreferrer" for external link opened in a new tab.
Prevents window.opener
leaks.
- <Button variant="ghost" asChild>
- <Link href="https://nextjs.org/docs" target="_blank" className="inline-flex items-center gap-2">Next.js Docs <ArrowRight className="size-4" /></Link>
- </Button>
+ <Button variant="ghost" asChild>
+ <a href="https://nextjs.org/docs" target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-2">
+ Next.js Docs <ArrowRight className="size-4" />
+ </a>
+ </Button>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<Button variant="ghost" asChild> | |
<Link href="https://nextjs.org/docs" target="_blank" className="inline-flex items-center gap-2">Next.js Docs <ArrowRight className="size-4" /></Link> | |
</Button> | |
<Button variant="ghost" asChild> | |
<a href="https://nextjs.org/docs" target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-2"> | |
Next.js Docs <ArrowRight className="size-4" /> | |
</a> | |
</Button> |
🤖 Prompt for AI Agents
In src/app/page.tsx around lines 21 to 23, the external Link opens in a new tab
with target="_blank" but lacks rel="noopener noreferrer"; update the Link
element to include rel="noopener noreferrer" (e.g., add rel="noopener
noreferrer" to the Link props) so the external link does not expose
window.opener and avoids potential security/privacy issues.
<Button variant="outline" size="icon" className="size-8 rounded-full" asChild> | ||
<Link href="https://github.com/techwithanirudh/better-auth-nextjs-starter" target="_blank" aria-label="GitHub repository"> | ||
<Github className="size-4" /> | ||
</Link> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix external link security: add rel and use instead of next/link.
External targets should use rel="noopener noreferrer"
and a plain <a>
.
- <Button variant="outline" size="icon" className="size-8 rounded-full" asChild>
- <Link href="https://github.com/techwithanirudh/better-auth-nextjs-starter" target="_blank" aria-label="GitHub repository">
- <Github className="size-4" />
- </Link>
- </Button>
+ <Button variant="outline" size="icon" className="size-8 rounded-full" asChild>
+ <a
+ href="https://github.com/techwithanirudh/better-auth-nextjs-starter"
+ target="_blank"
+ rel="noopener noreferrer"
+ aria-label="GitHub repository"
+ >
+ <Github className="size-4" aria-hidden="true" />
+ </a>
+ </Button>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<Button variant="outline" size="icon" className="size-8 rounded-full" asChild> | |
<Link href="https://github.com/techwithanirudh/better-auth-nextjs-starter" target="_blank" aria-label="GitHub repository"> | |
<Github className="size-4" /> | |
</Link> | |
<Button variant="outline" size="icon" className="size-8 rounded-full" asChild> | |
<a | |
href="https://github.com/techwithanirudh/better-auth-nextjs-starter" | |
target="_blank" | |
rel="noopener noreferrer" | |
aria-label="GitHub repository" | |
> | |
<Github className="size-4" aria-hidden="true" /> | |
</a> | |
</Button> |
🤖 Prompt for AI Agents
In src/components/header.tsx around lines 22 to 25, the external GitHub link
uses next/link and misses secure rel attributes; replace the Link with a plain
<a> element (still wrapped by Button via asChild) and add target="_blank"
rel="noopener noreferrer" plus the existing aria-label so the external link
opens in a new tab securely; ensure the <a> preserves the href and any
className/children (the Github icon) and remove the next/link import if no
longer used.
const BetterAuth = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 500 500" | ||
width="1em" | ||
height="1em" | ||
{...props} | ||
> | ||
<path | ||
fill={props.fill} | ||
d="M69 121h86.988v259H69zM337.575 121H430v259h-92.425z" | ||
/> | ||
<path | ||
fill={props.fill} | ||
d="M427.282 121v83.456h-174.52V121zM430 296.544V380H252.762v-83.456z" | ||
/> | ||
<path fill={props.fill} d="M252.762 204.455v92.089h-96.774v-92.089z" /> | ||
</svg> | ||
) | ||
|
||
export default BetterAuth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Icon can render invisible without a fill; rename to match new branding.
fill={props.fill}
removes the path fill when fill
isn’t passed, inheriting svg’s fill="none"
→ invisible icon. Use currentColor
. Also consider renaming from BetterAuth to LogoMark.
-import type { SVGProps } from 'react'
+import type { SVGProps } from 'react'
-const BetterAuth = (props: SVGProps<SVGSVGElement>) => (
+const LogoMark = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 500 500"
width="1em"
height="1em"
{...props}
>
<path
- fill={props.fill}
+ fill="currentColor"
d="M69 121h86.988v259H69zM337.575 121H430v259h-92.425z"
/>
<path
- fill={props.fill}
+ fill="currentColor"
d="M427.282 121v83.456h-174.52V121zM430 296.544V380H252.762v-83.456z"
/>
- <path fill={props.fill} d="M252.762 204.455v92.089h-96.774v-92.089z" />
+ <path fill="currentColor" d="M252.762 204.455v92.089h-96.774v-92.089z" />
</svg>
)
-export default BetterAuth
+export default LogoMark
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const BetterAuth = (props: SVGProps<SVGSVGElement>) => ( | |
<svg | |
xmlns="http://www.w3.org/2000/svg" | |
fill="none" | |
viewBox="0 0 500 500" | |
width="1em" | |
height="1em" | |
{...props} | |
> | |
<path | |
fill={props.fill} | |
d="M69 121h86.988v259H69zM337.575 121H430v259h-92.425z" | |
/> | |
<path | |
fill={props.fill} | |
d="M427.282 121v83.456h-174.52V121zM430 296.544V380H252.762v-83.456z" | |
/> | |
<path fill={props.fill} d="M252.762 204.455v92.089h-96.774v-92.089z" /> | |
</svg> | |
) | |
export default BetterAuth | |
import type { SVGProps } from 'react' | |
const LogoMark = (props: SVGProps<SVGSVGElement>) => ( | |
<svg | |
xmlns="http://www.w3.org/2000/svg" | |
fill="none" | |
viewBox="0 0 500 500" | |
width="1em" | |
height="1em" | |
{...props} | |
> | |
<path | |
fill="currentColor" | |
d="M69 121h86.988v259H69zM337.575 121H430v259h-92.425z" | |
/> | |
<path | |
fill="currentColor" | |
d="M427.282 121v83.456h-174.52V121zM430 296.544V380H252.762v-83.456z" | |
/> | |
<path fill="currentColor" d="M252.762 204.455v92.089h-96.774v-92.089z" /> | |
</svg> | |
) | |
export default LogoMark |
🤖 Prompt for AI Agents
In src/components/logos/mark.tsx around lines 3 to 24, the SVG paths use
fill={props.fill} which inherits the svg's fill="none" and can render invisible
when no fill prop is passed; also the component name BetterAuth should be
renamed to match branding (LogoMark). Replace path fill usage so it defaults to
"currentColor" (e.g., use fill="currentColor" on paths or set svg
fill="currentColor" and remove props.fill), keep props spread for other
SVGProps, and rename the component and default export from BetterAuth to
LogoMark (update any internal references and export accordingly).
images: "/banner.png", | ||
siteName: APP_DEFAULT_TITLE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use absolute OG/Twitter image URLs to avoid broken previews.
Build the image URLs from baseUrl
so social scrapers don’t resolve /banner.png
against arbitrary origins.
- images: "/banner.png",
+ images: new URL("/banner.png", baseUrl).toString(),
@@
- images: "/banner.png",
+ images: new URL("/banner.png", baseUrl).toString(),
Also applies to: 17-21
🤖 Prompt for AI Agents
In src/lib/metadata.ts around lines 12-13 (and similarly 17-21), the image
fields use a relative path ("/banner.png") which can break social previews;
replace those with absolute URLs constructed from the module's baseUrl (e.g.,
use new URL("/banner.png", baseUrl).toString() or a safe join that handles
trailing slashes) and update both the images and any openGraph/twitter image
entries to use the resulting absolute URL.
src/lib/metadata.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
🛠️ Refactor suggestion
Preview deployments: prefer VERCEL_URL for accurate baseUrl.
Right now previews may point to the production domain if NEXT_PUBLIC_BASE_URL
isn’t set. Use VERCEL_URL
as the first fallback (handled in src/env.ts
) and keep this file simple.
Follow-up in src/env.ts
(see my comment there) to supply NEXT_PUBLIC_BASE_URL
from VERCEL_URL
on previews; this module can then remain unchanged.
🤖 Prompt for AI Agents
In src/lib/metadata.ts around lines 26 to 29, preview deployments may resolve to
the production domain when NEXT_PUBLIC_BASE_URL isn’t set; instead of changing
this file, update src/env.ts to populate NEXT_PUBLIC_BASE_URL from VERCEL_URL
for preview builds (e.g., set NEXT_PUBLIC_BASE_URL =
process.env.NEXT_PUBLIC_BASE_URL || (process.env.VERCEL_URL ?
`https://${process.env.VERCEL_URL}` : undefined)), ensure the env export types
reflect that value, and then leave src/lib/metadata.ts as-is so it uses the
env-provided NEXT_PUBLIC_BASE_URL.
Summary
Transform the repository into a minimal, clean Next.js starter with no authentication and no database, while preserving the existing UI stack (Tailwind CSS v4, shadcn/ui, dark mode, toasts, progress bar) and App Router structure. This lowers the barrier to entry, removes required env vars, and provides a clear foundation for teams to build on and add auth/DB later.
Changes since
main
Authentication removed entirely
src/server/auth/**
,src/lib/auth-client.ts
,src/app/api/auth/**
,src/app/auth/**
,src/app/account/**
,src/routes.ts
, andsrc/middleware.ts
AuthUIProvider
; keptThemeProvider
,sonner
Toaster, and@bprogress/next
progress barbetter-auth-ui
CSS importDatabase removed entirely
src/server/db/**
,drizzle.config.ts
, anddrizzle/**
Starter pages and API
/about
and/components
pages (components page showcases shadcn/ui examples: Button, Card, Input)/api/health
endpoint that returns{ status: "ok" }
Env and configuration cleanup
src/env.ts
: removedDATABASE_URL
,BETTER_AUTH_SECRET
,CORS_ORIGIN
; only optionalNEXT_PUBLIC_BASE_URL
remains; zero required env varsnext.config.ts
: retains safe env load and generic security headersBranding/metadata
src/lib/constants.tsx
andsrc/lib/metadata.ts
: generic starter copysrc/components/logos/mark.tsx
Docs and package cleanup
package.json
: removed auth/DB deps and scripts; renamed package tonextjs-starter
.env.example
: minimal, no required variablesREADME.md
: updated to describe the minimal Next.js starter and how to add auth/DB laterImpact
/auth/*
,/api/auth/*
, account pages, middleware gate). This is intentional for a clean base starter.NEXT_PUBLIC_BASE_URL
is supported for metadata/sitemap.Acceptance criteria mapping
better-auth
,better-auth-ui
,@better-auth/cli
,drizzle-orm
,drizzle-kit
,@neondatabase/serverless
remainDATABASE_URL
,BETTER_AUTH_SECRET
,CORS_ORIGIN
in code or.env.example
/
,/about
,/components
; API:/api/health
returns{ status: 'ok' }
.env
(after installing dependencies)Follow-ups (optional)
/components
to include more shadcn/ui examples (Tooltip, DropdownMenu, Select, Avatar)₍ᐢ•(ܫ)•ᐢ₎ Generated by Capy (view task)
Summary by CodeRabbit
New Features
Documentation
Chores