Skip to content
Open
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
10 changes: 10 additions & 0 deletions apps/web/src/app/coming-soon/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import ComingSoon from "@/components/comingSoon";

export default function ComingSoonPage() {
return (
<ComingSoon
title="Coming Soon"
description="We’re still building this page. Check back soon."
/>
);
}
Comment on lines +1 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix Prettier formatting issues.

The pipeline reports code style issues. Based on the summary, this file is missing a trailing newline.

🔧 Proposed fix
 export default function ComingSoonPage() {
 	return (
 		<ComingSoon
 			title="Coming Soon"
 			description="We're still building this page. Check back soon."
 		/>
 	);
 }
+
📝 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.

Suggested change
import ComingSoon from "@/components/comingSoon";
export default function ComingSoonPage() {
return (
<ComingSoon
title="Coming Soon"
description="Were still building this page. Check back soon."
/>
);
}
import ComingSoon from "@/components/comingSoon";
export default function ComingSoonPage() {
return (
<ComingSoon
title="Coming Soon"
description="We're still building this page. Check back soon."
/>
);
}
🧰 Tools
🪛 GitHub Actions: Prettier Check

[warning] 1-1: Prettier formatting warning: code style issues found in this file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/app/coming-soon/page.tsx` around lines 1 - 10, The file defining
the ComingSoonPage component (export default function ComingSoonPage) is missing
a trailing newline which causes Prettier/style pipeline failures; fix by adding
a single newline at the end of the file (ensure the file ends with a newline
character after the closing brace/JSX) so the ComingSoonPage export and its JSX
are followed by a trailing newline.

64 changes: 64 additions & 0 deletions apps/web/src/components/comingSoon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import Image from "next/image";
import Link from "next/link";

type ComingSoonProps = {
title?: string;
description?: string;
};

export default function ComingSoon({
title = "Coming Soon",
description = "We’re still building this page. Check back soon.",
}: ComingSoonProps) {
return (
<main className="relative flex min-h-screen items-center justify-center overflow-hidden bg-black px-6 text-white">
<div className="absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(59,130,246,0.16),transparent_32%),linear-gradient(to_bottom,#04070d,#02040a)]" />
<div className="absolute inset-0 bg-[linear-gradient(to_right,rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(to_bottom,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:72px_72px] opacity-20" />
<div className="absolute left-1/2 top-[45%] h-[30rem] w-[30rem] -translate-x-1/2 -translate-y-1/2 rounded-full bg-blue-500/20 blur-[120px]" />

<section className="relative z-10 w-full max-w-4xl">
<div className="grid overflow-hidden rounded-3xl border border-white/10 bg-white/5 shadow-[0_20px_80px_rgba(0,0,0,0.45)] backdrop-blur-xl md:grid-cols-[1.05fr_0.95fr]">
<div className="relative flex min-h-[420px] flex-col justify-center p-8 md:p-10">
<div className="absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(255,255,255,0.08),transparent_30%)]" />

<div className="relative z-10">
<h1 className="max-w-xl text-6xl font-semibold tracking-tight">
{title}
</h1>

<p className="mt-5 max-w-lg text-base leading-7 text-white/65 sm:text-lg">
{description}
</p>

<div className="mt-8">
<Link
href="/"
className="group inline-flex items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-6 py-3 text-sm font-medium text-white backdrop-blur transition-all hover:border-white/25 hover:bg-white/10"
>
Back to Home
</Link>
</div>
Comment on lines +34 to +40
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix inconsistent indentation.

Lines 35-39 use spaces while the rest of the file uses tabs. This is likely causing the Prettier formatting warning.

🔧 Proposed fix for indentation
 							<div className="mt-8">
 								<Link
-                                    href="/"
-                                    className="group inline-flex items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-6 py-3 text-sm font-medium text-white backdrop-blur transition-all hover:border-white/25 hover:bg-white/10"
-                                >
-                                    Back to Home
-                                </Link>
+									href="/"
+									className="group inline-flex items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-6 py-3 text-sm font-medium text-white backdrop-blur transition-all hover:border-white/25 hover:bg-white/10"
+								>
+									Back to Home
+								</Link>
 							</div>
📝 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.

Suggested change
<Link
href="/"
className="group inline-flex items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-6 py-3 text-sm font-medium text-white backdrop-blur transition-all hover:border-white/25 hover:bg-white/10"
>
Back to Home
</Link>
</div>
<div className="mt-8">
<Link
href="/"
className="group inline-flex items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-6 py-3 text-sm font-medium text-white backdrop-blur transition-all hover:border-white/25 hover:bg-white/10"
>
Back to Home
</Link>
</div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/components/comingSoon.tsx` around lines 34 - 40, The Link JSX
block in the ComingSoon component uses spaces for indentation while the rest of
the file uses tabs, causing Prettier warnings; update the indentation for the
Link element and its nested content (the Back to Home text and surrounding tags)
to use tabs consistent with the file's existing formatting (locate the Link
component in apps/web/src/components/comingSoon.tsx and adjust the indentation
around the Link, its props, and closing tag to tabs).

</div>
</div>

<div className="relative flex min-h-[320px] flex-col items-center justify-center p-10 md:min-h-[420px]">
<div className="absolute h-56 w-56 rounded-full bg-blue-500/25 blur-[90px]" />
<div className="relative z-10 flex flex-col items-center text-center">
<Image
src="/img/logo/hackkit.svg"
alt="HackKit Logo"
width={110}
height={110}
className="opacity-95"
/>

<p className="mt-6 max-w-xs text-sm leading-6 text-white/55">
This page is temporarily unavailable while setup is in progress.
</p>
</div>
</div>
</div>
</section>
</main>
);
}
41 changes: 26 additions & 15 deletions apps/web/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

const isComingSoonMode = process.env.COMING_SOON_MODE === "true";

const requiredWhenLive = <T extends z.ZodTypeAny>(schema: T) =>
isComingSoonMode ? schema.optional() : schema;

export const env = createEnv({
server: {
CLERK_SECRET_KEY: z.string(),
INTERNAL_AUTH_KEY: z.string().min(64, {
message: "INTERNAL_AUTH_KEY must be at least 64 characters",
}),
BOT_API_URL: z.string(),
COMING_SOON_MODE: z.enum(["true", "false"]).default("false"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

COMING_SOON_MODE is defined but not wired to feature flags.

This env var is properly validated here but feature_flags.ts hardcodes comingSoonMode: true instead of reading from this value. The validation relaxation for secrets works correctly, but actual route gating ignores this setting.

See the related comment in feature_flags.ts for the fix.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/env.ts` at line 11, The COMING_SOON_MODE env var is validated in
env.ts but feature gating still hardcodes comingSoonMode: true in
feature_flags.ts; change the feature_flags.ts to read the validated value (e.g.,
use the COMING_SOON_MODE export from env.ts and coerce it to a boolean like
env.COMING_SOON_MODE === "true" or a Boolean conversion) and replace the
hardcoded true so routes and flags honor the env setting; keep existing
relaxation for secrets as-is.


CLERK_SECRET_KEY: requiredWhenLive(z.string()),
INTERNAL_AUTH_KEY: requiredWhenLive(
z.string().min(64, {
message: "INTERNAL_AUTH_KEY must be at least 64 characters",
}),
),
BOT_API_URL: requiredWhenLive(z.string()),
NODE_ENV: z
.enum(["development", "test", "production"])
.default("development"),
CLOUDFLARE_ACCOUNT_ID: z.string(),
R2_ACCESS_KEY_ID: z.string(),
R2_SECRET_ACCESS_KEY: z.string(),
TURSO_AUTH_TOKEN: z.string(),
TURSO_DATABASE_URL: z.string(),
UPSTASH_REDIS_REST_TOKEN: z.string(),
UPSTASH_REDIS_REST_URL: z.string(),
CLOUDFLARE_ACCOUNT_ID: requiredWhenLive(z.string()),
R2_ACCESS_KEY_ID: requiredWhenLive(z.string()),
R2_SECRET_ACCESS_KEY: requiredWhenLive(z.string()),
TURSO_AUTH_TOKEN: requiredWhenLive(z.string()),
TURSO_DATABASE_URL: requiredWhenLive(z.string()),
UPSTASH_REDIS_REST_TOKEN: requiredWhenLive(z.string()),
UPSTASH_REDIS_REST_URL: requiredWhenLive(z.string()),
},
client: {
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string(),
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: isComingSoonMode
? z.string().optional()
: z.string(),
},
experimental__runtimeEnv: {
COMING_SOON_MODE: process.env.COMING_SOON_MODE,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
},
// Enable the flag to treat empty strings as undefined
emptyStringAsUndefined: true,
});
});
Comment on lines 41 to +42
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix Prettier formatting.

The pipeline reports code style issues. The file appears to be missing a trailing newline.

🔧 Proposed fix
 	emptyStringAsUndefined: true,
 });
+
📝 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.

Suggested change
emptyStringAsUndefined: true,
});
});
emptyStringAsUndefined: true,
});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/env.ts` around lines 41 - 42, The file ends with the object
property "emptyStringAsUndefined: true," but is missing a trailing newline;
update apps/web/src/env.ts by adding a final newline character at the end of the
file (ensure the file ends with a single trailing newline) and re-run
Prettier/formatting so the file passes the pipeline.

17 changes: 17 additions & 0 deletions apps/web/src/lib/feature_flags.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const featureFlags = {
comingSoonMode: true
};
Comment on lines +1 to +3
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

comingSoonMode is hardcoded and ignores COMING_SOON_MODE env var.

env.ts defines a COMING_SOON_MODE environment variable with validation and conditional logic, but this module hardcodes comingSoonMode: true. The env var has no effect on actual route gating—routes /faq and /register are permanently gated regardless of the environment configuration.

Either wire this to the env var or remove the env var definition to avoid confusion.

🔧 Proposed fix to use the env var
+import { env } from "@/env";
+
 export const featureFlags = {
-	comingSoonMode: true
+	comingSoonMode: env.COMING_SOON_MODE === "true",
 };
📝 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.

Suggested change
export const featureFlags = {
comingSoonMode: true
};
import { env } from "@/env";
export const featureFlags = {
comingSoonMode: env.COMING_SOON_MODE === "true"
};
🧰 Tools
🪛 GitHub Actions: Prettier Check

[warning] 1-1: Prettier formatting warning: code style issues found in this file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/lib/feature_flags.ts` around lines 1 - 3, featureFlags currently
hardcodes comingSoonMode: true which ignores the validated COMING_SOON_MODE from
env.ts; update the featureFlags export to derive comingSoonMode from the
COMING_SOON_MODE env export (or, if you prefer to remove the feature flag,
delete the env var in env.ts to avoid confusion) — specifically, import
COMING_SOON_MODE from env.ts and set featureFlags.comingSoonMode =
COMING_SOON_MODE (or remove the unused COMING_SOON_MODE symbol and its
validation if you choose the removal route) so route gating for /faq and
/register reflects the environment configuration.


export const comingSoonRoutes = [
"/faq",
"/register",
] as const;

export function isComingSoonRoute(pathname: string) {
return (
featureFlags.comingSoonMode &&
comingSoonRoutes.some(
(route) => pathname === route || pathname.startsWith(`${route}/`),
)
);
}
Comment on lines +10 to +17
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Route matching logic and Prettier formatting.

The isComingSoonRoute function correctly handles both exact matches and nested routes. However, the file is missing a trailing newline per the Prettier pipeline failure.

🔧 Proposed fix for trailing newline
 export function isComingSoonRoute(pathname: string) {
 	return (
 		featureFlags.comingSoonMode &&
 		comingSoonRoutes.some(
 			(route) => pathname === route || pathname.startsWith(`${route}/`),
 		)
 	);
 }
+
📝 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.

Suggested change
export function isComingSoonRoute(pathname: string) {
return (
featureFlags.comingSoonMode &&
comingSoonRoutes.some(
(route) => pathname === route || pathname.startsWith(`${route}/`),
)
);
}
export function isComingSoonRoute(pathname: string) {
return (
featureFlags.comingSoonMode &&
comingSoonRoutes.some(
(route) => pathname === route || pathname.startsWith(`${route}/`),
)
);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/lib/feature_flags.ts` around lines 10 - 17, The file ends
without a trailing newline which causes the Prettier pipeline to fail; open the
file containing the isComingSoonRoute function and add a single newline
character at the end of the file (ensure the file ends with a blank line) so the
file terminates with a trailing newline and satisfies formatting checks.

27 changes: 21 additions & 6 deletions apps/web/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,41 @@ import { publicRoutes } from "config";
import { bannedUsers } from "db/schema";
import { db } from "db";
import { eq } from "db/drizzle";
import { isComingSoonRoute } from "@/lib/feature_flags";

const isPublicRoute = createRouteMatcher(publicRoutes);

export default clerkMiddleware(async (auth, req) => {
if (req.nextUrl.pathname.startsWith("/@")) {
const pathname = req.nextUrl.pathname;

if (pathname.startsWith("/@")) {
return NextResponse.rewrite(
new URL(`/user/${req.nextUrl.pathname.replace("/@", "")}`, req.url),
new URL(`/user/${pathname.replace("/@", "")}`, req.url),
);
}
if (req.nextUrl.pathname.startsWith("/~")) {

if (pathname.startsWith("/~")) {
return NextResponse.rewrite(
new URL(`/team/${req.nextUrl.pathname.replace("/~", "")}`, req.url),
new URL(`/team/${pathname.replace("/~", "")}`, req.url),
);
}

if (pathname === "/coming-soon") {
return NextResponse.next();
}

// rewrite selected routes to the coming soon page before auth runs
if (isComingSoonRoute(pathname)) {
return NextResponse.rewrite(new URL("/coming-soon", req.url));
}

if (!isPublicRoute(req)) {
await auth.protect();

const authData = await auth();

const isBanned = !!(await db.query.bannedUsers.findFirst({
where: eq(bannedUsers.userID, (await auth()).userId!),
where: eq(bannedUsers.userID, authData.userId!),
}));
Comment on lines +38 to 42
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Non-null assertion on userId may be unsafe.

After auth.protect(), the user is authenticated, but userId could still theoretically be null in edge cases. Consider adding a guard or using optional chaining with a fallback.

🛡️ Proposed defensive fix
 		const authData = await auth();
+		if (!authData.userId) {
+			return NextResponse.next();
+		}
 
 		const isBanned = !!(await db.query.bannedUsers.findFirst({
-			where: eq(bannedUsers.userID, authData.userId!),
+			where: eq(bannedUsers.userID, authData.userId),
 		}));
📝 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.

Suggested change
const authData = await auth();
const isBanned = !!(await db.query.bannedUsers.findFirst({
where: eq(bannedUsers.userID, (await auth()).userId!),
where: eq(bannedUsers.userID, authData.userId!),
}));
const authData = await auth();
if (!authData.userId) {
return NextResponse.next();
}
const isBanned = !!(await db.query.bannedUsers.findFirst({
where: eq(bannedUsers.userID, authData.userId),
}));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/middleware.ts` around lines 38 - 42, authData.userId is being
non-null asserted before querying bannedUsers which can be unsafe; update the
middleware to guard against a null/undefined userId from auth() before calling
db.query.bannedUsers.findFirst (e.g., check if authData.userId is present and
handle the missing-case early or skip the DB lookup), and replace the current
unsafe expression that uses authData.userId! with a safe access (use
authData.userId or optional chaining) so references like authData, auth(),
db.query.bannedUsers.findFirst and bannedUsers.userID no longer rely on a
non-null assertion.


if (isBanned) {
Expand All @@ -36,4 +51,4 @@ export default clerkMiddleware(async (auth, req) => {

export const config = {
matcher: ["/((?!.*\\..*|_next).*)", "/", "/(api)(.*)"],
};
};
Comment on lines 52 to +54
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix Prettier formatting.

The pipeline reports code style issues in this file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/middleware.ts` around lines 52 - 54, The exported config block
(export const config) in middleware.ts fails Prettier checks; reformat the file
to match project Prettier rules (run your repo's Prettier or eslint --fix) so
the matcher array and surrounding whitespace/commas/quotes follow the code
style; save the file after formatting and ensure the export const config block
is the only change.

Loading