Skip to content
Merged
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 frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ NEXTAUTH_URL=http://localhost:3000
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# PostHog
NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com

423 changes: 418 additions & 5 deletions frontend/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"next-auth": "^4.24.13",
"pino": "^9.11.0",
"pino-pretty": "^13.1.1",
"posthog-js": "^1.374.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down
142 changes: 142 additions & 0 deletions frontend/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,148 @@ body {
top: 72px;
}

/* ==========================================================================
Signed-out product gates
========================================================================== */

.auth-required-panel {
min-height: min(520px, calc(100svh - 160px));
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
background:
radial-gradient(
circle at 1px 1px,
rgba(255, 255, 255, 0.08) 1px,
transparent 0
)
0 0 / 24px 24px,
linear-gradient(135deg, rgba(46, 46, 46, 0.96), rgba(31, 31, 31, 0.98));
display: grid;
grid-template-columns: minmax(0, 1.08fr) minmax(230px, 0.92fr);
gap: 24px;
align-items: center;
padding: clamp(24px, 5vw, 52px);
overflow: hidden;
}
.auth-required-copy {
max-width: 620px;
}
.auth-required-kicker {
display: inline-flex;
align-items: center;
gap: 8px;
color: var(--accent);
font-size: 12px;
font-weight: 900;
line-height: 1;
text-transform: uppercase;
}
.auth-required-lock {
width: 28px;
height: 28px;
border: 1px solid rgba(255, 226, 47, 0.32);
border-radius: 8px;
background: rgba(255, 226, 47, 0.1);
display: inline-flex;
align-items: center;
justify-content: center;
}
.auth-required-panel h1 {
max-width: 680px;
margin: 18px 0 0;
color: white;
font-size: clamp(30px, 4.5vw, 50px);
font-weight: 900;
line-height: 0.98;
}
.auth-required-copy > p {
max-width: 590px;
margin: 18px 0 0;
color: var(--muted-1);
font-size: 15px;
font-weight: 600;
line-height: 1.55;
}
.auth-required-actions {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 26px;
}
.auth-required-primary,
.auth-required-secondary {
min-height: 40px;
border-radius: 8px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 0 15px;
font-size: 13px;
font-weight: 900;
line-height: 1;
transition:
transform 0.12s ease,
filter 0.12s ease,
border-color 0.12s ease;
}
.auth-required-primary {
background: var(--accent);
color: #1f1f1f;
}
.auth-required-secondary {
border: 1px solid rgba(255, 255, 255, 0.14);
background: rgba(255, 255, 255, 0.04);
color: rgba(255, 255, 255, 0.78);
}
.auth-required-primary:hover,
.auth-required-secondary:hover {
transform: translateY(-1px);
filter: brightness(1.04);
}
.auth-required-secondary:hover {
border-color: rgba(255, 255, 255, 0.24);
}
.auth-required-feature-grid {
display: grid;
gap: 10px;
}
.auth-required-feature {
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
background: rgba(255, 255, 255, 0.045);
display: grid;
grid-template-columns: 34px minmax(0, 1fr);
gap: 11px;
align-items: start;
padding: 14px;
backdrop-filter: blur(14px);
}
.auth-required-feature > span {
width: 34px;
height: 34px;
border-radius: 8px;
background: rgba(255, 226, 47, 0.1);
color: var(--accent);
display: inline-flex;
align-items: center;
justify-content: center;
}
.auth-required-feature h2 {
margin: 0;
color: white;
font-size: 13px;
font-weight: 900;
line-height: 1.15;
}
.auth-required-feature p {
margin: 5px 0 0;
color: var(--muted-2);
font-size: 12px;
font-weight: 600;
line-height: 1.4;
}

/* ==========================================================================
Statistics
========================================================================== */
Expand Down
45 changes: 25 additions & 20 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { Notifications } from "@mantine/notifications";

import FirstVisitNotification from "@/components/ui/first-visit-notification";
import AuthSessionProvider from "@/components/auth/session-provider";
import { PHProvider } from "@/components/analytics/posthog-provider";
import { PostHogPageView } from "@/components/analytics/posthog-pageview";

export const metadata: Metadata = {
title: {
Expand Down Expand Up @@ -53,26 +55,29 @@ export default function RootLayout({ children }: PropsWithChildren) {
<ColorSchemeScript defaultColorScheme="dark" />
</Head>
<body className={`${poppins.className}`}>
<Suspense>
<AuthSessionProvider>
<MantineProvider theme={theme} defaultColorScheme="dark">
<FilterProvider>
<div className="min-h-screen flex flex-col px-6">
<Notifications className="mploy-notifications" />
<NavBar />
<main className="">
{children}
<FirstVisitNotification />
<FeedbackButton />
<Analytics />
<SpeedInsights />
<GoogleAnalytics gaId="G-1RXLVCFJC0" />
</main>
</div>
</FilterProvider>
</MantineProvider>
</AuthSessionProvider>
</Suspense>
<PHProvider>
<Suspense>
<PostHogPageView />
<AuthSessionProvider>
<MantineProvider theme={theme} defaultColorScheme="dark">
<FilterProvider>
<div className="min-h-screen flex flex-col px-6">
<Notifications className="mploy-notifications" />
<NavBar />
<main className="">
{children}
<FirstVisitNotification />
<FeedbackButton />
<Analytics />
<SpeedInsights />
<GoogleAnalytics gaId="G-1RXLVCFJC0" />
</main>
</div>
</FilterProvider>
</MantineProvider>
</AuthSessionProvider>
</Suspense>
</PHProvider>
</body>
</html>
);
Expand Down
24 changes: 24 additions & 0 deletions frontend/src/components/analytics/posthog-pageview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import { usePathname, useSearchParams } from "next/navigation";
import { useEffect } from "react";
import { usePostHog } from "posthog-js/react";

export function PostHogPageView() {
const pathname = usePathname();
const searchParams = useSearchParams();
const posthog = usePostHog();

useEffect(() => {
if (pathname && posthog) {
let url = window.origin + pathname;
const search = searchParams.toString();
if (search) {
url += `?${search}`;
}
posthog.capture("$pageview", { $current_url: url });
}
}, [pathname, searchParams, posthog]);

return null;
}
24 changes: 24 additions & 0 deletions frontend/src/components/analytics/posthog-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import posthog from "posthog-js";
import { PostHogProvider } from "posthog-js/react";
import { useEffect } from "react";

export function PHProvider({ children }: { children: React.ReactNode }) {
useEffect(() => {
const posthogKey = process.env.NEXT_PUBLIC_POSTHOG_KEY;

if (!posthogKey) {
return;
}

posthog.init(posthogKey, {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
ui_host: "https://us.posthog.com",
capture_pageview: false,
capture_pageleave: true,
});
}, []);

return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
}
19 changes: 2 additions & 17 deletions frontend/src/components/applications/my-applications-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
IconTrash,
} from "@tabler/icons-react";
import { notifications } from "@mantine/notifications";
import Link from "next/link";
import {
ApplicationStatus,
DbApplication,
Expand Down Expand Up @@ -63,6 +62,7 @@ import ApplicationDatePicker, {
formatApplicationDateValue,
} from "@/components/applications/application-date-picker";
import { rolePalette } from "@/lib/role-palette";
import AuthRequiredPanel from "@/components/auth/auth-required-panel";

const SORT_STORAGE_KEY = "mp:apps:kanban-sort:v1";
const DENSITY_STORAGE_KEY = "mp:apps:kanban-density:v1";
Expand Down Expand Up @@ -637,22 +637,7 @@ export default function MyApplicationsClient({
}

if (sessionStatus === "unauthenticated") {
return (
<Box
bg="secondary"
bd="2px solid selected"
className="rounded-xl p-4 text-sm"
>
You&apos;re not signed in.{" "}
<Link
className="underline font-semibold"
href="/sign-in?callbackUrl=%2Fmy-applications"
>
Sign in
</Link>{" "}
to view and manage your applications across devices.
</Box>
);
return <AuthRequiredPanel screen="applications" />;
}

const segmentedStyles = {
Expand Down
Loading
Loading