Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: layout route for course section

Brad Barbin94439cce66ca
diff --git a/apps/mes/app/routes/x+/company.switch.$companyId.tsx b/apps/mes/app/routes/x+/company.switch.$companyId.tsx
index d9325f92e3..72da1a99b7 100644
--- a/apps/mes/app/routes/x+/company.switch.$companyId.tsx
+++ b/apps/mes/app/routes/x+/company.switch.$companyId.tsx
@@ -11,12 +11,9 @@ import { getLocation, setLocation } from "~/services/location.server";
import { path, requestReferrer } from "~/utils/path";
export async function action({ request, params }: ActionFunctionArgs) {
- console.log("company switch");
const { client, userId } = await requirePermissions(request, {});
const companies = await getCompanies(client, userId);
- console.log("companies", companies);
-
if (companies.error) {
throw redirect(
requestReferrer(request) ?? path.to.authenticatedRoot,
@@ -36,8 +33,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
await destroyAuthSession(request);
}
- console.log("companyId", companyId);
-
const sessionCookie = await updateCompanySession(request, companyId!);
const companyIdCookie = setCompanyId(companyId!);
const storedLocations = await getLocation(request, client, {
@@ -45,8 +40,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
companyId: companyId!,
});
- console.log("storedLocations", storedLocations);
-
if (storedLocations.updated) {
const locationCookie = await setLocation(
companyId!,
diff --git a/apps/starter/app/styles/tailwind.css b/apps/starter/app/styles/tailwind.css
index 2cbbecb4f4..04374ffdb9 100644
--- a/apps/starter/app/styles/tailwind.css
+++ b/apps/starter/app/styles/tailwind.css
@@ -37,30 +37,28 @@
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
+
+ --base-shadow-color: rgb(0 0 0 / 0.05);
+
+ --button-drop-shadow: rgb(0 0 0 / 0);
+ --button-shadow: inset 0px 1px 0px 0px rgb(255 255 255 / 1),
+ 0px 0px 0px 1px rgb(0 0 0 / 0.06), 0px 1px 0px 0px rgb(0 0 0 / 0.08),
+ 0px 2px 2px 0px rgb(0 0 0 / 0.04), 0px 3px 3px 0px rgb(0 0 0 / 0.02),
+ 0px 4px 4px 0px rgb(0 0 0 / 0.01);
+ --popover-shadow: 0px 0px 3.6px rgba(0, 0, 0, 0.04),
+ 0px 0px 10px rgba(0, 0, 0, 0.04), 0px 0px 24.1px rgba(0, 0, 0, 0.05),
+ 0px 0px 80px rgba(0, 0, 0, 0.08);
+ --dropdown-item-shadow: inset 0px 1px 0px rgb(255 255 255 / 0.02),
+ inset 0px 0px 0px 1px rgb(255 255 255 / 0.02),
+ 0px 1px 2px rgb(0 0 0 / 0.12), 0px 2px 4px rgb(0 0 0 / 0.08),
+ 0px 0px 0px 0.5px rgb(0 0 0 / 0.24);
+ --button-base-shadow: 0px 1px 1px -1px rgb(0 0 0 / 0.08),
+ 0px 2px 2px -1px rgb(0 0 0 / 0.08), 0px 0px 0px 1px rgb(0 0 0 / 0.06),
+ inset 0px 1px 0px #fff, inset 0px 1px 2px 1px #fff,
+ inset 0px 1px 2px rgb(0 0 0 / 0.06);
}
.dark {
- --background: 240 10% 3.9%;
- --foreground: 0 0% 98%;
- --card: 240 10% 3.9%;
- --card-foreground: 0 0% 98%;
- --popover: 240 10% 3.9%;
- --popover-foreground: 0 0% 98%;
- --primary: 0 0% 98%;
- --primary-foreground: 240 5.9% 10%;
- --active: 0 0% 98%;
- --active-foreground: 240 5.9% 10%;
- --secondary: 240 3.7% 15.9%;
- --secondary-foreground: 0 0% 98%;
- --muted: 240 3.7% 15.9%;
- --muted-foreground: 240 5% 64.9%;
- --accent: 240 3.7% 15.9%;
- --accent-foreground: 0 0% 98%;
- --destructive: 0 62.8% 30.6%;
- --destructive-foreground: 0 85.7% 97.3%;
- --border: 240 3.7% 15.9%;
- --input: 240 3.7% 15.9%;
- --ring: 240 4.9% 83.9%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
@@ -69,6 +67,31 @@
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
+
+ --button-drop-shadow: rgb(0 0 0 / 0.4);
+ --danger-drop-shadow: rgb(127 29 29 / 0.8);
+ --button-shadow: 0px -1px 0px 0px rgb(255 255 255 / 0.04),
+ 0px 0px 0px 1px rgb(255 255 255 / 0.12), 0px 0px 1px 0px rgb(0 0 0 / 0.04),
+ 0px 2px 2px 0px rgb(0 0 0 / 0.04), 0px 4px 2px 0px rgb(0 0 0 / 0.04),
+ 0px 6px 3px 0px rgb(0 0 0 / 0.04);
+ --popover-shadow: 0px 0px 4px rgba(0, 0, 0, 0.08),
+ 0px 0px 10px rgba(0, 0, 0, 0.12), 0px 0px 24px rgba(0, 0, 0, 0.16),
+ 0px 0px 80px rgba(0, 0, 0, 0.2);
+ --button-base-shadow: 0px 0px 0px 0.5px rgb(0 0 0 / 0.4),
+ 0px 1px 1px -1px rgb(0 0 0 / 0.12), 0px 2px 2px -1px rgb(0 0 0 / 0.12),
+ inset 0px 0.5px 0px rgb(255 255 255 / 0.06),
+ inset 0px 0px 1px 0px rgb(255 255 255 / 0.16),
+ inset 0px -6px 12px -4px rgb(0 0 0 / 0.16);
+ --button-primary-shadow: 0px 1px 1px -1px rgb(0 0 0 / 0.08),
+ 0px 2px 2px -1px rgb(0 0 0 / 0.08), 0px 0px 0px 1px rgb(0 0 0 / 0.06),
+ inset 0px 1px 0px #fff, inset 0px 0px 2px 1px #fff,
+ inset 0px 1px 2px rgb(0 0 0 / 0.06),
+ inset 0px -4px 8px -4px rgb(0 0 0 / 0.06);
}
}
diff --git a/apps/university/app/components/Hero.tsx b/apps/university/app/components/Hero.tsx
new file mode 100644
index 0000000000..f8e4e8113a
--- /dev/null
+++ b/apps/university/app/components/Hero.tsx
@@ -0,0 +1,9 @@
+export function Hero({ children }: { children: React.ReactNode }) {
+ return (
+ <div className="w-full bg-[linear-gradient(to_bottom_right,#f7f5ff_35.67%,#c9fff8_88.95%)] dark:bg-[linear-gradient(to_bottom_right,#0e0338_35.67%,#1b433e_88.95%)]">
+ <div className="flex flex-col gap-6 w-full px-4 max-w-6xl mx-auto my-20 mb-28">
+ {children}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/university/app/config.tsx b/apps/university/app/config.tsx
new file mode 100644
index 0000000000..041a1dab0d
--- /dev/null
+++ b/apps/university/app/config.tsx
@@ -0,0 +1,96 @@
+import { LuBookOpen } from "react-icons/lu";
+
+type Config = Section[];
+
+type Section = {
+ name: string;
+ id: string;
+ background: string;
+ foreground: string;
+ icon: React.ReactNode;
+ courses: Course[];
+};
+
+type Course = {
+ name: string;
+ id: string;
+ description: string;
+ topics: Topic[];
+};
+
+type Topic = {
+ name: string;
+ id: string;
+ description: string;
+ challenge: Question[];
+ videos: Video[];
+};
+
+type Question = any;
+
+type Video = {
+ name: string;
+ id: string;
+ description: string;
+ duration: number;
+};
+
+export const sections: Config = [
+ {
+ name: "Getting Started",
+ background: "#00bba7",
+ foreground: "#fff",
+ id: "getting-started",
+ icon: <LuBookOpen />,
+ courses: [
+ {
+ name: "Carbon Overview",
+ id: "carbon-overview",
+ description:
+ "Welcome to Carbon, a powerful ERP/MES/QMS software that uses web technology and a modular platform to offer a wide variety of configurations based on the customer’s needs. Learn about Carbon's architecture and setup in this first course.",
+ topics: [
+ {
+ name: "Introducing Carbon",
+ id: "introduction",
+ description:
+ "This topic covers the basics of Carbon. Here you will learn what it is, how the platform and modules work, and the architecture.",
+ challenge: [],
+ videos: [
+ {
+ id: "what-is-carbon",
+ name: "What is Carbon?",
+ description: "",
+ duration: 100,
+ },
+ {
+ id: "about-carbon-modules",
+ name: "About Carbon's Modules",
+ description: "",
+ duration: 100,
+ },
+ {
+ id: "carbon-architecture",
+ name: "Carbon's Architecture",
+ description: "",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ // {
+ // name: "Setup",
+ // id: "setup",
+ // description: "Learn about Carbon's architecture and how it works.",
+ // },
+ ],
+ },
+ // {
+ // name: "Selling",
+ // background: "#6041d0",
+ // foreground: "#fff",
+ // id: "selling",
+ // icon: <LuCrown />,
+ // courses: [],
+ // },
+];
diff --git a/apps/university/app/hooks/useUser.tsx b/apps/university/app/hooks/useUser.tsx
index abdb30f14b..e331fa32b1 100644
--- a/apps/university/app/hooks/useUser.tsx
+++ b/apps/university/app/hooks/useUser.tsx
@@ -25,7 +25,7 @@ type User = PersonalData & {
export function useUser(): User {
const data = useRouteData<{
user: unknown;
- }>(path.to.authenticatedRoot);
+ }>(path.to.root);
if (data?.user && isUser(data.user)) {
return data.user;
@@ -50,9 +50,7 @@ function isUser(value: any): value is User {
export function useOptionalUser() {
const data = useRouteData<{
user: unknown;
- }>(path.to.authenticatedRoot);
-
- console.log(data);
+ }>(path.to.root);
if (data?.user && isUser(data.user)) {
return data.user;
diff --git a/apps/university/app/root.tsx b/apps/university/app/root.tsx
index 38c79f59cc..8e0dadf91c 100644
--- a/apps/university/app/root.tsx
+++ b/apps/university/app/root.tsx
@@ -1,16 +1,22 @@
-import { error, getBrowserEnv } from "@carbon/auth";
-import { getSessionFlash } from "@carbon/auth/session.server";
+import { error, getBrowserEnv, getCarbon } from "@carbon/auth";
+import {
+ getOrRefreshAuthSession,
+ getSessionFlash,
+} from "@carbon/auth/session.server";
import { validator } from "@carbon/form";
-import { Button, Heading, toast, Toaster } from "@carbon/react";
+import { Button, Heading, IconButton, toast, Toaster } from "@carbon/react";
import type { Theme } from "@carbon/utils";
import { themes } from "@carbon/utils";
import {
isRouteErrorResponse,
+ Link,
Links,
Meta,
+ NavLink,
Outlet,
Scripts,
ScrollRestoration,
+ useFetcher,
useLoaderData,
useRouteError,
} from "@remix-run/react";
@@ -27,9 +33,13 @@ import Background from "~/styles/background.css?url";
import NProgress from "~/styles/nprogress.css?url";
import Tailwind from "~/styles/tailwind.css?url";
+import { LuFingerprint, LuMoon, LuSun } from "react-icons/lu";
+import AvatarMenu from "./components/AvatarMenu";
import { useMode } from "./hooks/useMode";
+import { useOptionalUser } from "./hooks/useUser";
import { getTheme } from "./services/theme.server";
import { modeValidator } from "./types/validators";
+import { path } from "./utils/path";
export const config = { runtime: "edge", regions: ["iad1"] };
@@ -44,7 +54,7 @@ export function links() {
export const meta: MetaFunction = () => {
return [
{
- title: "Carbon | Starter",
+ title: "Carbon University",
},
];
};
@@ -57,6 +67,24 @@ export async function loader({ request }: LoaderFunctionArgs) {
SUPABASE_ANON_KEY,
} = getBrowserEnv();
+ let session = await getOrRefreshAuthSession(request);
+
+ let user = null;
+
+ if (session) {
+ const client = getCarbon(session.accessToken);
+
+ const authUser = await client
+ .from("user")
+ .select("*")
+ .eq("id", session.userId)
+ .single();
+
+ if (authUser.data) {
+ user = authUser.data;
+ }
+ }
+
const sessionFlash = await getSessionFlash(request);
return json(
@@ -70,6 +98,8 @@ export async function loader({ request }: LoaderFunctionArgs) {
mode: getMode(request),
theme: getTheme(request),
result: sessionFlash?.result,
+ user,
+ session,
},
{
headers: sessionFlash?.headers,
@@ -177,8 +207,65 @@ export default function App() {
/* Dark/Light Mode */
const mode = useMode();
+ const fetcher = useFetcher<typeof action>();
+ const user = useOptionalUser();
+
return (
<Document mode={mode} theme={theme}>
+ <header className="flex select-none items-center py-4 pl-5 pr-2 h-[var(--header-height)]">
+ <div className="max-w-6xl mx-auto px-4 flex items-center justify-between gap-2 z-logo text-foreground w-full">
+ <Link
+ to="/"
+ className="cursor-pointer flex flex-row items-end gap-2 flex-shrink-0 font-display"
+ >
+ <img
+ src="/carbon-word-light.svg"
+ alt="Carbon"
+ className="h-7 w-auto block dark:hidden"
+ />
+ <img
+ src="/carbon-word-dark.svg"
+ alt="Carbon"
+ className="h-7 w-auto hidden dark:block"
+ />
+ </Link>
+ <div className="flex items-center">
+ <Button variant="ghost" asChild>
+ <NavLink to={path.to.about}>About</NavLink>
+ </Button>
+ <div className="items-center gap-1 hidden md:flex">
+ {user ? (
+ <AvatarMenu />
+ ) : (
+ <>
+ <Button
+ variant="ghost"
+ className="cursor-pointer"
+ rightIcon={<LuFingerprint className="size-4" />}
+ asChild
+ >
+ <NavLink to={path.to.login}>Login</NavLink>
+ </Button>
+ <fetcher.Form action={path.to.root} method="post">
+ <input
+ type="hidden"
+ name="mode"
+ value={mode === "light" ? "dark" : "light"}
+ />
+ <IconButton
+ aria-label="Toggle Light Mode and Dark Mode"
+ type="submit"
+ variant="ghost"
+ icon={mode === "light" ? <LuMoon /> : <LuSun />}
+ className="cursor-pointer"
+ />
+ </fetcher.Form>
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+ </header>
<Outlet />
<script
dangerouslySetInnerHTML={{
diff --git a/apps/university/app/routes/_auth+/callback.tsx b/apps/university/app/routes/_auth+/callback.tsx
index f3411f6855..3c78c61b22 100644
--- a/apps/university/app/routes/_auth+/callback.tsx
+++ b/apps/university/app/routes/_auth+/callback.tsx
@@ -78,7 +78,7 @@ export async function action({ request }: ActionFunctionArgs) {
authSession,
});
const companyIdCookie = setCompanyId(authSession.companyId);
- return redirect(path.to.authenticatedRoot, {
+ return redirect(path.to.root, {
headers: [
["Set-Cookie", sessionCookie],
["Set-Cookie", companyIdCookie],
diff --git a/apps/university/app/routes/_index.tsx b/apps/university/app/routes/_index.tsx
index fb45dc88dd..9d0f8b38e1 100644
--- a/apps/university/app/routes/_index.tsx
+++ b/apps/university/app/routes/_index.tsx
@@ -1,10 +1,11 @@
-import { useOptionalUser } from "~/hooks/useUser";
+import { redirect, type LoaderFunctionArgs } from "@vercel/remix";
+import { sections } from "~/config";
+import { path } from "~/utils/path";
+
+export async function loader({ request }: LoaderFunctionArgs) {
+ throw redirect(path.to.course(sections[0].id, sections[0].courses[0].id));
+}
export default function IndexRoute() {
- const user = useOptionalUser();
- return (
- <p>
- Oops. You shouldn't see this page. Eventually it will be a landing page.
- </p>
- );
+ return null;
}
diff --git a/apps/university/app/routes/_layout.tsx b/apps/university/app/routes/_layout.tsx
deleted file mode 100644
index 2ecdd52a5f..0000000000
--- a/apps/university/app/routes/_layout.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { Outlet, useLoaderData, useNavigation } from "@remix-run/react";
-import type { LoaderFunctionArgs } from "@vercel/remix";
-import { json } from "@vercel/remix";
-import NProgress from "nprogress";
-import { useEffect } from "react";
-
-import { CarbonProvider, getCarbon } from "@carbon/auth";
-import { getAuthSession } from "@carbon/auth/session.server";
-
-export async function loader({ request }: LoaderFunctionArgs) {
- const session = await getAuthSession(request);
-
- let user = null;
-
- console.log("session", session);
-
- if (session) {
- const client = getCarbon(session.accessToken);
-
- const authUser = await client
- .from("user")
- .select("*")
- .eq("id", session.userId)
- .single();
-
- console.log("authUser", authUser);
-
- if (authUser.data) {
- user = authUser.data;
- }
- }
-
- return json({ session, user });
-}
-
-export default function AuthenticatedRoute() {
- const { session } = useLoaderData<typeof loader>();
-
- const transition = useNavigation();
-
- /* NProgress */
- useEffect(() => {
- if (
- (transition.state === "loading" || transition.state === "submitting") &&
- !NProgress.isStarted()
- ) {
- NProgress.start();
- } else {
- NProgress.done();
- }
- }, [transition.state]);
-
- if (!session) {
- return <Outlet />;
- }
-
- return (
- <CarbonProvider session={session}>
- <Outlet />
- </CarbonProvider>
- );
-}
diff --git a/apps/university/app/routes/about.tsx b/apps/university/app/routes/about.tsx
new file mode 100644
index 0000000000..fdacae46a5
--- /dev/null
+++ b/apps/university/app/routes/about.tsx
@@ -0,0 +1,48 @@
+import { Button, Heading } from "@carbon/react";
+import { Link } from "@remix-run/react";
+import { LuBookOpen, LuCirclePlay } from "react-icons/lu";
+import { Hero } from "~/components/Hero";
+import { sections } from "~/config";
+import { path } from "~/utils/path";
+
+export default function AboutRoute() {
+ return (
+ <div className="w-full flex flex-col">
+ <Hero>
+ <Heading
+ size="h1"
+ className="font-display text-[#212578] dark:text-white max-w-2xl"
+ >
+ What do you want to learn?
+ </Heading>
+ <p className="text-base max-w-2xl">
+ Want to take command of your business? Need a quick answer to a
+ problem? Test your knowledge and track your progress
+ </p>
+ <div className="flex items-center gap-2">
+ <Button
+ size="lg"
+ variant="secondary"
+ leftIcon={<LuCirclePlay />}
+ asChild
+ >
+ <Link
+ to={path.to.video(sections[0].courses[0].topics[0].videos[0].id)}
+ >
+ Begin your first lesson
+ </Link>
+ </Button>
+ <Button
+ size="lg"
+ variant="secondary"
+ leftIcon={<LuBookOpen />}
+ asChild
+ >
+ <Link to={path.to.about}>See how it works</Link>
+ </Button>
+ </div>
+ </Hero>
+ <div className="w-full px-4 max-w-6xl mx-auto my-16"></div>
+ </div>
+ );
+}
diff --git a/apps/university/app/routes/course+/$sectionId.$courseId.tsx b/apps/university/app/routes/course+/$sectionId.$courseId.tsx
new file mode 100644
index 0000000000..aff1d72d54
--- /dev/null
+++ b/apps/university/app/routes/course+/$sectionId.$courseId.tsx
@@ -0,0 +1,146 @@
+import { Button, cn, Progress, VStack } from "@carbon/react";
+import { Link, useParams } from "@remix-run/react";
+import { LuCirclePlay, LuFlag } from "react-icons/lu";
+import { sections } from "~/config";
+import { path } from "~/utils/path";
+import { formatDuration } from "~/utils/video";
+
+export default function CourseRoute() {
+ const { sectionId, courseId } = useParams();
+ const section = sections.find((section) => section.id === sectionId);
+ const course = section?.courses.find((course) => course.id === courseId);
+
+ const totalDuration =
+ course?.topics.reduce((acc, topic) => {
+ return acc + topic.videos.reduce((acc, video) => acc + video.duration, 0);
+ }, 0) ?? 0;
+
+ const totalChallenges =
+ course?.topics.reduce((acc, topic) => {
+ return acc + (topic.challenge === undefined ? 0 : 1);
+ }, 0) ?? 0;
+
+ if (!course) {
+ throw new Error("Course not found");
+ }
+
+ return (
+ <VStack spacing={4}>
+ <div className="flex flex-col">
+ <div
+ className="border rounded rounded-b-none px-8 py-3"
+ style={{
+ backgroundColor: section?.background,
+ color: section?.foreground,
+ }}
+ >
+ <div className="flex items-center justify-between gap-2">
+ <span className="uppercase text-sm font-display font-bold">
+ {section?.name}
+ </span>
+ </div>
+ </div>
+ <div className="border border-b-0 border-t-0 p-8">
+ <div className="flex flex-col gap-4">
+ <div className="flex items-start gap-4">
+ <div
+ className="flex-shrink-0 size-12 text-2xl p-3 rounded-full"
+ style={{
+ backgroundColor: section?.background,
+ color: section?.foreground,
+ }}
+ >
+ {section?.icon}
+ </div>
+ <div className="flex flex-col">
+ <h1 className="uppercase text-[10px] font-display font-bold text-muted-foreground">
+ Course
+ </h1>
+ <h2 className="text-2xl font-display tracking-tight">
+ {course.name}
+ </h2>
+ </div>
+ </div>
+ <p className="text-sm">{course.description}</p>
+ </div>
+ </div>
+ <div className="border rounded rounded-t-none px-8 py-3">
+ <div className="flex items-center justify-between gap-2">
+ <div className="flex items-center gap-4 text-xs">
+ <div className="flex items-center gap-1">
+ <span className="font-bold">Length:</span>
+ <span className="text-muted-foreground">
+ {formatDuration(totalDuration)}
+ </span>
+ </div>
+ <div className="flex items-center gap-1">
+ <span className="font-bold">Challenges:</span>
+ <span className="text-muted-foreground">{totalChallenges}</span>
+ </div>
+ </div>
+ <div className="flex items-center gap-1 text-xs">
+ <span className="font-bold text-emerald-500">0%</span>
+ <Progress value={0} />
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {course.topics.map((topic, index) => {
+ const isFirst = index === 0;
+ const isLast = index === course.topics.length - 1;
+ return (
+ <div
+ key={topic.id}
+ className={cn(
+ "border p-8 w-full",
+ isFirst && "rounded-t",
+ isLast && "rounded-b",
+ isFirst && !isLast && "border-b-0 rounded-b-none",
+ isLast && !isFirst && "border-t-0 rounded-t-none"
+ )}
+ >
+ <div className="grid grid-cols-2 gap-12">
+ <div className="flex flex-col gap-1">
+ <h3 className="text-[10px] uppercase font-display font-bold text-muted-foreground">
+ Topic
+ </h3>
+ <h2 className="text-xl font-display tracking-tight">
+ {topic.name}
+ </h2>
+ <p className="text-sm">{topic.description}</p>
+ </div>
+ <div className="flex flex-col gap-8 py-8 w-full text-sm">
+ <div className="flex flex-col gap-0">
+ {topic.videos.map((video) => (
+ <Link
+ key={video.id}
+ to={path.to.video(video.id)}
+ className="flex items-center justify-between gap-2 w-full rounded-md py-1.5 px-3 hover:bg-accent"
+ >
+ <div className="flex items-center gap-2">
+ <LuCirclePlay className="size-4 text-muted-foreground" />
+ <span>{video.name}</span>
+ </div>
+ <span className="text-muted-foreground text-xs">
+ {formatDuration(video.duration)}
+ </span>
+ </Link>
+ ))}
+ </div>
+ {topic.challenge && (
+ <Button
+ leftIcon={<LuFlag className="size-4" />}
+ variant="secondary"
+ >
+ Take Topic Challenge
+ </Button>
+ )}
+ </div>
+ </div>
+ </div>
+ );
+ })}
+ </VStack>
+ );
+}
diff --git a/apps/university/app/routes/course+/_layout.tsx b/apps/university/app/routes/course+/_layout.tsx
new file mode 100644
index 0000000000..e88c26c274
--- /dev/null
+++ b/apps/university/app/routes/course+/_layout.tsx
@@ -0,0 +1,77 @@
+import { Button, Heading } from "@carbon/react";
+import { Link, Outlet } from "@remix-run/react";
+import { LuBookOpen, LuCirclePlay } from "react-icons/lu";
+import { Hero } from "~/components/Hero";
+import { sections } from "~/config";
+import { path } from "~/utils/path";
+
+export default function CourseLayout() {
+ return (
+ <div className="w-full flex flex-col">
+ <Hero>
+ <Heading
+ size="h1"
+ className="font-display text-[#212578] dark:text-white max-w-xl"
+ >
+ Your Journey Starts Here
+ </Heading>
+ <p className="text-base max-w-xl">
+ Learn the basics of Carbon and start your journey to becoming an
+ expert in Carbon. All for free.
+ </p>
+ <div className="flex items-center gap-2">
+ <Button
+ size="lg"
+ variant="secondary"
+ leftIcon={<LuCirclePlay />}
+ asChild
+ >
+ <Link
+ to={path.to.video(sections[0].courses[0].topics[0].videos[0].id)}
+ >
+ Begin your first lesson
+ </Link>
+ </Button>
+ <Button
+ size="lg"
+ variant="secondary"
+ leftIcon={<LuBookOpen />}
+ asChild
+ >
+ <Link to={path.to.about}>See how it works</Link>
+ </Button>
+ </div>
+ </Hero>
+ <div className="w-full px-4 max-w-6xl mx-auto my-16">
+ <div className="grid grid-cols-1 md:grid-cols-[250px_1fr] gap-6">
+ <nav className="space-y-4">
+ {sections.map((section) => (
+ <div key={section.id} className="space-y-2">
+ <h3
+ className="font-display font-bold uppercase text-xs"
+ style={{ color: section.background }}
+ >
+ {section.name}
+ </h3>
+ <div className="space-y-0">
+ {section.courses.map((course) => (
+ <Link
+ key={course.id}
+ to={path.to.course(section.id, course.id)}
+ className="block py-1 text-sm hover:underline"
+ >
+ {course.name}
+ </Link>
+ ))}
+ </div>
+ </div>
+ ))}
+ </nav>
+ <main>
+ <Outlet />
+ </main>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/university/app/styles/tailwind.css b/apps/university/app/styles/tailwind.css
index 2cbbecb4f4..6bbe67d591 100644
--- a/apps/university/app/styles/tailwind.css
+++ b/apps/university/app/styles/tailwind.css
@@ -1,5 +1,6 @@
@import url("non.geist");
@import url("non.geist/mono");
+@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap");
@tailwind base;
@tailwind components;
@@ -37,30 +38,28 @@
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
+
+ --base-shadow-color: rgb(0 0 0 / 0.05);
+
+ --button-drop-shadow: rgb(0 0 0 / 0);
+ --button-shadow: inset 0px 1px 0px 0px rgb(255 255 255 / 1),
+ 0px 0px 0px 1px rgb(0 0 0 / 0.06), 0px 1px 0px 0px rgb(0 0 0 / 0.08),
+ 0px 2px 2px 0px rgb(0 0 0 / 0.04), 0px 3px 3px 0px rgb(0 0 0 / 0.02),
+ 0px 4px 4px 0px rgb(0 0 0 / 0.01);
+ --popover-shadow: 0px 0px 3.6px rgba(0, 0, 0, 0.04),
+ 0px 0px 10px rgba(0, 0, 0, 0.04), 0px 0px 24.1px rgba(0, 0, 0, 0.05),
+ 0px 0px 80px rgba(0, 0, 0, 0.08);
+ --dropdown-item-shadow: inset 0px 1px 0px rgb(255 255 255 / 0.02),
+ inset 0px 0px 0px 1px rgb(255 255 255 / 0.02),
+ 0px 1px 2px rgb(0 0 0 / 0.12), 0px 2px 4px rgb(0 0 0 / 0.08),
+ 0px 0px 0px 0.5px rgb(0 0 0 / 0.24);
+ --button-base-shadow: 0px 1px 1px -1px rgb(0 0 0 / 0.08),
+ 0px 2px 2px -1px rgb(0 0 0 / 0.08), 0px 0px 0px 1px rgb(0 0 0 / 0.06),
+ inset 0px 1px 0px #fff, inset 0px 1px 2px 1px #fff,
+ inset 0px 1px 2px rgb(0 0 0 / 0.06);
}
.dark {
- --background: 240 10% 3.9%;
- --foreground: 0 0% 98%;
- --card: 240 10% 3.9%;
- --card-foreground: 0 0% 98%;
- --popover: 240 10% 3.9%;
- --popover-foreground: 0 0% 98%;
- --primary: 0 0% 98%;
- --primary-foreground: 240 5.9% 10%;
- --active: 0 0% 98%;
- --active-foreground: 240 5.9% 10%;
- --secondary: 240 3.7% 15.9%;
- --secondary-foreground: 0 0% 98%;
- --muted: 240 3.7% 15.9%;
- --muted-foreground: 240 5% 64.9%;
- --accent: 240 3.7% 15.9%;
- --accent-foreground: 0 0% 98%;
- --destructive: 0 62.8% 30.6%;
- --destructive-foreground: 0 85.7% 97.3%;
- --border: 240 3.7% 15.9%;
- --input: 240 3.7% 15.9%;
- --ring: 240 4.9% 83.9%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
@@ -69,6 +68,31 @@
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
+
+ --button-drop-shadow: rgb(0 0 0 / 0.4);
+ --danger-drop-shadow: rgb(127 29 29 / 0.8);
+ --button-shadow: 0px -1px 0px 0px rgb(255 255 255 / 0.04),
+ 0px 0px 0px 1px rgb(255 255 255 / 0.12), 0px 0px 1px 0px rgb(0 0 0 / 0.04),
+ 0px 2px 2px 0px rgb(0 0 0 / 0.04), 0px 4px 2px 0px rgb(0 0 0 / 0.04),
+ 0px 6px 3px 0px rgb(0 0 0 / 0.04);
+ --popover-shadow: 0px 0px 4px rgba(0, 0, 0, 0.08),
+ 0px 0px 10px rgba(0, 0, 0, 0.12), 0px 0px 24px rgba(0, 0, 0, 0.16),
+ 0px 0px 80px rgba(0, 0, 0, 0.2);
+ --button-base-shadow: 0px 0px 0px 0.5px rgb(0 0 0 / 0.4),
+ 0px 1px 1px -1px rgb(0 0 0 / 0.12), 0px 2px 2px -1px rgb(0 0 0 / 0.12),
+ inset 0px 0.5px 0px rgb(255 255 255 / 0.06),
+ inset 0px 0px 1px 0px rgb(255 255 255 / 0.16),
+ inset 0px -6px 12px -4px rgb(0 0 0 / 0.16);
+ --button-primary-shadow: 0px 1px 1px -1px rgb(0 0 0 / 0.08),
+ 0px 2px 2px -1px rgb(0 0 0 / 0.08), 0px 0px 0px 1px rgb(0 0 0 / 0.06),
+ inset 0px 1px 0px #fff, inset 0px 0px 2px 1px #fff,
+ inset 0px 1px 2px rgb(0 0 0 / 0.06),
+ inset 0px -4px 8px -4px rgb(0 0 0 / 0.06);
}
}
@@ -84,26 +108,10 @@
}
}
-.forge-viewer {
- position: relative;
- width: 100%;
- height: 100%;
- min-height: 400px;
-}
-
-.forge-viewer > div {
- border-radius: var(--radius);
-}
-
-p.is-editor-empty:first-child:before {
- color: var(--muted-foreground);
- content: attr(data-placeholder);
- float: left;
- height: 0;
- pointer-events: none;
+.font-display {
+ font-family: "Poppins", sans-serif;
}
-.tiptap.ProseMirror-focused div[data-video-embed],
-.tiptap.ProseMirror-selectedNode div[data-video-embed] {
- @apply ring-2 ring-primary cursor-move p-2 rounded-lg;
+a.active {
+ font-weight: 600;
}
diff --git a/apps/university/app/utils/path.ts b/apps/university/app/utils/path.ts
index b885c097e7..44a9806b22 100644
--- a/apps/university/app/utils/path.ts
+++ b/apps/university/app/utils/path.ts
@@ -1,20 +1,25 @@
import { getAppUrl, SUPABASE_URL } from "@carbon/auth";
+import { generatePath } from "@remix-run/react";
-const x = "/x"; // from ~/routes/x+ folder
+const course = "/course"; // from ~/routes/course+ folder
+const video = "/video"; // from ~/routes/video+ folder
const ERP_URL = getAppUrl();
export const path = {
to: {
- authenticatedRoot: x,
+ about: "/about",
accountSettings: `${ERP_URL}/x/account`,
callback: "/callback",
+ course: (sectionId: string, courseId: string) =>
+ generatePath(`${course}/${sectionId}/${courseId}`),
dashboard: `${ERP_URL}/x`,
healthcheck: "/healthcheck",
login: "/login",
logout: "/logout",
refreshSession: "/refresh-session",
root: "/",
+ video: (id: string) => generatePath(`${video}/${id}`),
},
} as const;
diff --git a/apps/university/app/utils/video.ts b/apps/university/app/utils/video.ts
new file mode 100644
index 0000000000..0bc542d808
--- /dev/null
+++ b/apps/university/app/utils/video.ts
@@ -0,0 +1,5 @@
+export function formatDuration(duration: number) {
+ const minutes = Math.floor(duration / 60);
+ const seconds = duration % 60;
+ return `${minutes}:${seconds.toString().padStart(2, "0")}`;
+}
diff --git a/apps/university/public/carbon-word-dark.png b/apps/university/public/carbon-word-dark.png
deleted file mode 100644
index 3606059a75..0000000000
Binary files a/apps/university/public/carbon-word-dark.png and /dev/null differ
diff --git a/apps/university/public/carbon-word-dark.svg b/apps/university/public/carbon-word-dark.svg
index b555c4b360..45c24bd04c 100644
--- a/apps/university/public/carbon-word-dark.svg
+++ b/apps/university/public/carbon-word-dark.svg
@@ -1,10 +1,10 @@
-<svg width="1307" height="349" viewBox="0 0 1307 349" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M412.646 193.426C412.646 178.405 415.703 165.305 421.816 154.126C427.929 142.773 436.401 134.039 447.23 127.926C458.059 121.638 470.461 118.494 484.434 118.494C502.425 118.494 517.271 123.035 528.974 132.118C540.851 141.026 548.799 153.602 552.816 169.846H513.254C511.158 163.558 507.577 158.667 502.512 155.174C497.621 151.506 491.508 149.672 484.172 149.672C473.692 149.672 465.395 153.515 459.282 161.2C453.169 168.711 450.112 179.453 450.112 193.426C450.112 207.225 453.169 217.967 459.282 225.652C465.395 233.163 473.692 236.918 484.172 236.918C499.019 236.918 508.713 230.281 513.254 217.006H552.816C548.799 232.726 540.851 245.215 528.974 254.472C517.097 263.729 502.25 268.358 484.434 268.358C470.461 268.358 458.059 265.301 447.23 259.188C436.401 252.9 427.929 244.167 421.816 232.988C415.703 221.635 412.646 208.447 412.646 193.426Z" fill="white"/>
-<path d="M562.395 192.902C562.395 178.23 565.277 165.217 571.041 153.864C576.98 142.511 584.927 133.777 594.883 127.664C605.014 121.551 616.28 118.494 628.681 118.494C639.511 118.494 648.943 120.677 656.977 125.044C665.187 129.411 671.737 134.913 676.627 141.55V120.852H713.569V266H676.627V244.778C671.911 251.59 665.361 257.267 656.977 261.808C648.768 266.175 639.249 268.358 628.419 268.358C616.193 268.358 605.014 265.214 594.883 258.926C584.927 252.638 576.98 243.817 571.041 232.464C565.277 220.936 562.395 207.749 562.395 192.902ZM676.627 193.426C676.627 184.518 674.881 176.92 671.387 170.632C667.894 164.169 663.178 159.279 657.239 155.96C651.301 152.467 644.925 150.72 638.113 150.72C631.301 150.72 625.013 152.379 619.249 155.698C613.485 159.017 608.769 163.907 605.101 170.37C601.608 176.658 599.861 184.169 599.861 192.902C599.861 201.635 601.608 209.321 605.101 215.958C608.769 222.421 613.485 227.399 619.249 230.892C625.188 234.385 631.476 236.132 638.113 236.132C644.925 236.132 651.301 234.473 657.239 231.154C663.178 227.661 667.894 222.77 671.387 216.482C674.881 210.019 676.627 202.334 676.627 193.426Z" fill="white"/>
-<path d="M778.214 143.384C782.93 135.699 789.043 129.673 796.554 125.306C804.239 120.939 812.972 118.756 822.754 118.756V157.27H813.06C801.532 157.27 792.798 159.977 786.86 165.392C781.096 170.807 778.214 180.239 778.214 193.688V266H741.534V120.852H778.214V143.384Z" fill="white"/>
-<path d="M876.28 142.074C880.996 135.087 887.458 129.411 895.668 125.044C904.052 120.677 913.571 118.494 924.226 118.494C936.627 118.494 947.806 121.551 957.762 127.664C967.892 133.777 975.84 142.511 981.604 153.864C987.542 165.043 990.512 178.055 990.512 192.902C990.512 207.749 987.542 220.936 981.604 232.464C975.84 243.817 967.892 252.638 957.762 258.926C947.806 265.214 936.627 268.358 924.226 268.358C913.396 268.358 903.877 266.262 895.668 262.07C887.633 257.703 881.17 252.114 876.28 245.302V266H839.6V72.12H876.28V142.074ZM953.046 192.902C953.046 184.169 951.212 176.658 947.544 170.37C944.05 163.907 939.334 159.017 933.396 155.698C927.632 152.379 921.344 150.72 914.532 150.72C907.894 150.72 901.606 152.467 895.668 155.96C889.904 159.279 885.188 164.169 881.52 170.632C878.026 177.095 876.28 184.693 876.28 193.426C876.28 202.159 878.026 209.757 881.52 216.22C885.188 222.683 889.904 227.661 895.668 231.154C901.606 234.473 907.894 236.132 914.532 236.132C921.344 236.132 927.632 234.385 933.396 230.892C939.334 227.399 944.05 222.421 947.544 215.958C951.212 209.495 953.046 201.81 953.046 192.902Z" fill="white"/>
-<path d="M1073.76 268.358C1059.78 268.358 1047.21 265.301 1036.03 259.188C1024.85 252.9 1016.03 244.079 1009.57 232.726C1003.28 221.373 1000.14 208.273 1000.14 193.426C1000.14 178.579 1003.37 165.479 1009.83 154.126C1016.47 142.773 1025.46 134.039 1036.82 127.926C1048.17 121.638 1060.83 118.494 1074.81 118.494C1088.78 118.494 1101.44 121.638 1112.8 127.926C1124.15 134.039 1133.06 142.773 1139.52 154.126C1146.16 165.479 1149.48 178.579 1149.48 193.426C1149.48 208.273 1146.07 221.373 1139.26 232.726C1132.62 244.079 1123.54 252.9 1112.01 259.188C1100.66 265.301 1087.91 268.358 1073.76 268.358ZM1073.76 236.394C1080.4 236.394 1086.6 234.822 1092.36 231.678C1098.3 228.359 1103.01 223.469 1106.51 217.006C1110 210.543 1111.75 202.683 1111.75 193.426C1111.75 179.627 1108.08 169.06 1100.74 161.724C1093.58 154.213 1084.76 150.458 1074.28 150.458C1063.8 150.458 1054.98 154.213 1047.82 161.724C1040.83 169.06 1037.34 179.627 1037.34 193.426C1037.34 207.225 1040.75 217.879 1047.56 225.39C1054.54 232.726 1063.28 236.394 1073.76 236.394Z" fill="white"/>
-<path d="M1248.96 118.756C1266.25 118.756 1280.22 124.258 1290.88 135.262C1301.53 146.091 1306.86 161.287 1306.86 180.85V266H1270.18V185.828C1270.18 174.3 1267.3 165.479 1261.53 159.366C1255.77 153.078 1247.91 149.934 1237.95 149.934C1227.82 149.934 1219.79 153.078 1213.85 159.366C1208.08 165.479 1205.2 174.3 1205.2 185.828V266H1168.52V120.852H1205.2V138.93C1210.09 132.642 1216.29 127.751 1223.8 124.258C1231.49 120.59 1239.87 118.756 1248.96 118.756Z" fill="white"/>
+<svg width="1583" height="349" viewBox="0 0 1583 349" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M415.286 183.266C415.286 163.658 419.276 146.558 427.256 131.966C435.236 117.146 446.294 105.746 460.43 97.766C474.566 89.558 490.754 85.454 508.994 85.454C532.478 85.454 551.858 91.382 567.134 103.238C582.638 114.866 593.012 131.282 598.256 152.486H546.614C543.878 144.278 539.204 137.894 532.592 133.334C526.208 128.546 518.228 126.152 508.652 126.152C494.972 126.152 484.142 131.168 476.162 141.2C468.182 151.004 464.192 165.026 464.192 183.266C464.192 201.278 468.182 215.3 476.162 225.332C484.142 235.136 494.972 240.038 508.652 240.038C528.032 240.038 540.686 231.374 546.614 214.046H598.256C593.012 234.566 582.638 250.868 567.134 262.952C551.63 275.036 532.25 281.078 508.994 281.078C490.754 281.078 474.566 277.088 460.43 269.108C446.294 260.9 435.236 249.5 427.256 234.908C419.276 220.088 415.286 202.874 415.286 183.266Z" fill="white"/>
+<path d="M610.76 182.582C610.76 163.43 614.522 146.444 622.046 131.624C629.798 116.804 640.172 105.404 653.168 97.424C666.392 89.444 681.098 85.454 697.286 85.454C711.422 85.454 723.734 88.304 734.222 94.004C744.938 99.704 753.488 106.886 759.872 115.55V88.532H808.094V278H759.872V250.298C753.716 259.19 745.166 266.6 734.222 272.528C723.506 278.228 711.08 281.078 696.944 281.078C680.984 281.078 666.392 276.974 653.168 268.766C640.172 260.558 629.798 249.044 622.046 234.224C614.522 219.176 610.76 201.962 610.76 182.582ZM759.872 183.266C759.872 171.638 757.592 161.72 753.032 153.512C748.472 145.076 742.316 138.692 734.564 134.36C726.812 129.8 718.49 127.52 709.598 127.52C700.706 127.52 692.498 129.686 684.974 134.018C677.45 138.35 671.294 144.734 666.506 153.17C661.946 161.378 659.666 171.182 659.666 182.582C659.666 193.982 661.946 204.014 666.506 212.678C671.294 221.114 677.45 227.612 684.974 232.172C692.726 236.732 700.934 239.012 709.598 239.012C718.49 239.012 726.812 236.846 734.564 232.514C742.316 227.954 748.472 221.57 753.032 213.362C757.592 204.926 759.872 194.894 759.872 183.266Z" fill="white"/>
+<path d="M892.478 117.944C898.634 107.912 906.614 100.046 916.418 94.346C926.45 88.646 937.85 85.796 950.618 85.796V136.07H937.964C922.916 136.07 911.516 139.604 903.764 146.672C896.24 153.74 892.478 166.052 892.478 183.608V278H844.598V88.532H892.478V117.944Z" fill="white"/>
+<path d="M1020.49 116.234C1026.64 107.114 1035.08 99.704 1045.8 94.004C1056.74 88.304 1069.17 85.454 1083.07 85.454C1099.26 85.454 1113.85 89.444 1126.85 97.424C1140.07 105.404 1150.45 116.804 1157.97 131.624C1165.72 146.216 1169.6 163.202 1169.6 182.582C1169.6 201.962 1165.72 219.176 1157.97 234.224C1150.45 249.044 1140.07 260.558 1126.85 268.766C1113.85 276.974 1099.26 281.078 1083.07 281.078C1068.94 281.078 1056.51 278.342 1045.8 272.87C1035.31 267.17 1026.87 259.874 1020.49 250.982V278H972.607V24.92H1020.49V116.234ZM1120.69 182.582C1120.69 171.182 1118.3 161.378 1113.51 153.17C1108.95 144.734 1102.8 138.35 1095.04 134.018C1087.52 129.686 1079.31 127.52 1070.42 127.52C1061.76 127.52 1053.55 129.8 1045.8 134.36C1038.27 138.692 1032.12 145.076 1027.33 153.512C1022.77 161.948 1020.49 171.866 1020.49 183.266C1020.49 194.666 1022.77 204.584 1027.33 213.02C1032.12 221.456 1038.27 227.954 1045.8 232.514C1053.55 236.846 1061.76 239.012 1070.42 239.012C1079.31 239.012 1087.52 236.732 1095.04 232.172C1102.8 227.612 1108.95 221.114 1113.51 212.678C1118.3 204.242 1120.69 194.21 1120.69 182.582Z" fill="white"/>
+<path d="M1278.26 281.078C1260.02 281.078 1243.61 277.088 1229.02 269.108C1214.42 260.9 1202.91 249.386 1194.47 234.566C1186.27 219.746 1182.16 202.646 1182.16 183.266C1182.16 163.886 1186.38 146.786 1194.82 131.966C1203.48 117.146 1215.22 105.746 1230.04 97.766C1244.86 89.558 1261.39 85.454 1279.63 85.454C1297.87 85.454 1314.4 89.558 1329.22 97.766C1344.04 105.746 1355.67 117.146 1364.11 131.966C1372.77 146.786 1377.1 163.886 1377.1 183.266C1377.1 202.646 1372.66 219.746 1363.76 234.566C1355.1 249.386 1343.24 260.9 1328.2 269.108C1313.38 277.088 1296.73 281.078 1278.26 281.078ZM1278.26 239.354C1286.93 239.354 1295.02 237.302 1302.55 233.198C1310.3 228.866 1316.45 222.482 1321.01 214.046C1325.57 205.61 1327.85 195.35 1327.85 183.266C1327.85 165.254 1323.07 151.46 1313.49 141.884C1304.14 132.08 1292.63 127.178 1278.95 127.178C1265.27 127.178 1253.75 132.08 1244.41 141.884C1235.29 151.46 1230.73 165.254 1230.73 183.266C1230.73 201.278 1235.17 215.186 1244.06 224.99C1253.18 234.566 1264.58 239.354 1278.26 239.354Z" fill="white"/>
+<path d="M1506.96 85.796C1529.53 85.796 1547.77 92.978 1561.68 107.342C1575.59 121.478 1582.54 141.314 1582.54 166.85V278H1534.66V173.348C1534.66 158.3 1530.9 146.786 1523.37 138.806C1515.85 130.598 1505.59 126.494 1492.59 126.494C1479.37 126.494 1468.88 130.598 1461.13 138.806C1453.61 146.786 1449.84 158.3 1449.84 173.348V278H1401.96V88.532H1449.84V112.13C1456.23 103.922 1464.32 97.538 1474.13 92.978C1484.16 88.19 1495.1 85.796 1506.96 85.796Z" fill="white"/>
<path d="M181.165 139.644V69.822L241.346 35.0571L241.054 104.879L181.165 139.644Z" fill="#60FFD2"/>
<path d="M181.165 69.822V139.644L120.4 104.879V35.0571L181.165 69.822Z" fill="#36B5B4"/>
<path d="M120.4 35.0571L181.165 69.822L241.346 35.0571L181.165 0L120.4 35.0571Z" fill="#5FE4D2"/>
diff --git a/apps/university/public/carbon-word-light.png b/apps/university/public/carbon-word-light.png
deleted file mode 100644
index becd8f13bb..0000000000
Binary files a/apps/university/public/carbon-word-light.png and /dev/null differ
diff --git a/apps/university/public/carbon-word-light.svg b/apps/university/public/carbon-word-light.svg
index 3e899a2d1b..0aba9da4d8 100644
--- a/apps/university/public/carbon-word-light.svg
+++ b/apps/university/public/carbon-word-light.svg
@@ -1,10 +1,10 @@
-<svg width="1307" height="349" viewBox="0 0 1307 349" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M412.646 193.426C412.646 178.405 415.703 165.305 421.816 154.126C427.929 142.773 436.401 134.039 447.23 127.926C458.059 121.638 470.461 118.494 484.434 118.494C502.425 118.494 517.271 123.035 528.974 132.118C540.851 141.026 548.799 153.602 552.816 169.846H513.254C511.158 163.558 507.577 158.667 502.512 155.174C497.621 151.506 491.508 149.672 484.172 149.672C473.692 149.672 465.395 153.515 459.282 161.2C453.169 168.711 450.112 179.453 450.112 193.426C450.112 207.225 453.169 217.967 459.282 225.652C465.395 233.163 473.692 236.918 484.172 236.918C499.019 236.918 508.713 230.281 513.254 217.006H552.816C548.799 232.726 540.851 245.215 528.974 254.472C517.097 263.729 502.25 268.358 484.434 268.358C470.461 268.358 458.059 265.301 447.23 259.188C436.401 252.9 427.929 244.167 421.816 232.988C415.703 221.635 412.646 208.447 412.646 193.426Z" fill="#212278"/>
-<path d="M562.395 192.902C562.395 178.23 565.277 165.217 571.041 153.864C576.98 142.511 584.927 133.777 594.883 127.664C605.014 121.551 616.28 118.494 628.681 118.494C639.511 118.494 648.943 120.677 656.977 125.044C665.187 129.411 671.737 134.913 676.627 141.55V120.852H713.569V266H676.627V244.778C671.911 251.59 665.361 257.267 656.977 261.808C648.768 266.175 639.249 268.358 628.419 268.358C616.193 268.358 605.014 265.214 594.883 258.926C584.927 252.638 576.98 243.817 571.041 232.464C565.277 220.936 562.395 207.749 562.395 192.902ZM676.627 193.426C676.627 184.518 674.881 176.92 671.387 170.632C667.894 164.169 663.178 159.279 657.239 155.96C651.301 152.467 644.925 150.72 638.113 150.72C631.301 150.72 625.013 152.379 619.249 155.698C613.485 159.017 608.769 163.907 605.101 170.37C601.608 176.658 599.861 184.169 599.861 192.902C599.861 201.635 601.608 209.321 605.101 215.958C608.769 222.421 613.485 227.399 619.249 230.892C625.188 234.385 631.476 236.132 638.113 236.132C644.925 236.132 651.301 234.473 657.239 231.154C663.178 227.661 667.894 222.77 671.387 216.482C674.881 210.019 676.627 202.334 676.627 193.426Z" fill="#212278"/>
-<path d="M778.214 143.384C782.93 135.699 789.043 129.673 796.554 125.306C804.239 120.939 812.972 118.756 822.754 118.756V157.27H813.06C801.532 157.27 792.798 159.977 786.86 165.392C781.096 170.807 778.214 180.239 778.214 193.688V266H741.534V120.852H778.214V143.384Z" fill="#212278"/>
-<path d="M876.28 142.074C880.996 135.087 887.458 129.411 895.668 125.044C904.052 120.677 913.571 118.494 924.226 118.494C936.627 118.494 947.806 121.551 957.762 127.664C967.892 133.777 975.84 142.511 981.604 153.864C987.542 165.043 990.512 178.055 990.512 192.902C990.512 207.749 987.542 220.936 981.604 232.464C975.84 243.817 967.892 252.638 957.762 258.926C947.806 265.214 936.627 268.358 924.226 268.358C913.396 268.358 903.877 266.262 895.668 262.07C887.633 257.703 881.17 252.114 876.28 245.302V266H839.6V72.12H876.28V142.074ZM953.046 192.902C953.046 184.169 951.212 176.658 947.544 170.37C944.05 163.907 939.334 159.017 933.396 155.698C927.632 152.379 921.344 150.72 914.532 150.72C907.894 150.72 901.606 152.467 895.668 155.96C889.904 159.279 885.188 164.169 881.52 170.632C878.026 177.095 876.28 184.693 876.28 193.426C876.28 202.159 878.026 209.757 881.52 216.22C885.188 222.683 889.904 227.661 895.668 231.154C901.606 234.473 907.894 236.132 914.532 236.132C921.344 236.132 927.632 234.385 933.396 230.892C939.334 227.399 944.05 222.421 947.544 215.958C951.212 209.495 953.046 201.81 953.046 192.902Z" fill="#212278"/>
-<path d="M1073.76 268.358C1059.78 268.358 1047.21 265.301 1036.03 259.188C1024.85 252.9 1016.03 244.079 1009.57 232.726C1003.28 221.373 1000.14 208.273 1000.14 193.426C1000.14 178.579 1003.37 165.479 1009.83 154.126C1016.47 142.773 1025.46 134.039 1036.82 127.926C1048.17 121.638 1060.83 118.494 1074.81 118.494C1088.78 118.494 1101.44 121.638 1112.8 127.926C1124.15 134.039 1133.06 142.773 1139.52 154.126C1146.16 165.479 1149.48 178.579 1149.48 193.426C1149.48 208.273 1146.07 221.373 1139.26 232.726C1132.62 244.079 1123.54 252.9 1112.01 259.188C1100.66 265.301 1087.91 268.358 1073.76 268.358ZM1073.76 236.394C1080.4 236.394 1086.6 234.822 1092.36 231.678C1098.3 228.359 1103.01 223.469 1106.51 217.006C1110 210.543 1111.75 202.683 1111.75 193.426C1111.75 179.627 1108.08 169.06 1100.74 161.724C1093.58 154.213 1084.76 150.458 1074.28 150.458C1063.8 150.458 1054.98 154.213 1047.82 161.724C1040.83 169.06 1037.34 179.627 1037.34 193.426C1037.34 207.225 1040.75 217.879 1047.56 225.39C1054.54 232.726 1063.28 236.394 1073.76 236.394Z" fill="#212278"/>
-<path d="M1248.96 118.756C1266.25 118.756 1280.22 124.258 1290.88 135.262C1301.53 146.091 1306.86 161.287 1306.86 180.85V266H1270.18V185.828C1270.18 174.3 1267.3 165.479 1261.53 159.366C1255.77 153.078 1247.91 149.934 1237.95 149.934C1227.82 149.934 1219.79 153.078 1213.85 159.366C1208.08 165.479 1205.2 174.3 1205.2 185.828V266H1168.52V120.852H1205.2V138.93C1210.09 132.642 1216.29 127.751 1223.8 124.258C1231.49 120.59 1239.87 118.756 1248.96 118.756Z" fill="#212278"/>
+<svg width="1583" height="349" viewBox="0 0 1583 349" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M415.286 183.266C415.286 163.658 419.276 146.558 427.256 131.966C435.236 117.146 446.294 105.746 460.43 97.766C474.566 89.558 490.754 85.454 508.994 85.454C532.478 85.454 551.858 91.382 567.134 103.238C582.638 114.866 593.012 131.282 598.256 152.486H546.614C543.878 144.278 539.204 137.894 532.592 133.334C526.208 128.546 518.228 126.152 508.652 126.152C494.972 126.152 484.142 131.168 476.162 141.2C468.182 151.004 464.192 165.026 464.192 183.266C464.192 201.278 468.182 215.3 476.162 225.332C484.142 235.136 494.972 240.038 508.652 240.038C528.032 240.038 540.686 231.374 546.614 214.046H598.256C593.012 234.566 582.638 250.868 567.134 262.952C551.63 275.036 532.25 281.078 508.994 281.078C490.754 281.078 474.566 277.088 460.43 269.108C446.294 260.9 435.236 249.5 427.256 234.908C419.276 220.088 415.286 202.874 415.286 183.266Z" fill="#212278"/>
+<path d="M610.76 182.582C610.76 163.43 614.522 146.444 622.046 131.624C629.798 116.804 640.172 105.404 653.168 97.424C666.392 89.444 681.098 85.454 697.286 85.454C711.422 85.454 723.734 88.304 734.222 94.004C744.938 99.704 753.488 106.886 759.872 115.55V88.532H808.094V278H759.872V250.298C753.716 259.19 745.166 266.6 734.222 272.528C723.506 278.228 711.08 281.078 696.944 281.078C680.984 281.078 666.392 276.974 653.168 268.766C640.172 260.558 629.798 249.044 622.046 234.224C614.522 219.176 610.76 201.962 610.76 182.582ZM759.872 183.266C759.872 171.638 757.592 161.72 753.032 153.512C748.472 145.076 742.316 138.692 734.564 134.36C726.812 129.8 718.49 127.52 709.598 127.52C700.706 127.52 692.498 129.686 684.974 134.018C677.45 138.35 671.294 144.734 666.506 153.17C661.946 161.378 659.666 171.182 659.666 182.582C659.666 193.982 661.946 204.014 666.506 212.678C671.294 221.114 677.45 227.612 684.974 232.172C692.726 236.732 700.934 239.012 709.598 239.012C718.49 239.012 726.812 236.846 734.564 232.514C742.316 227.954 748.472 221.57 753.032 213.362C757.592 204.926 759.872 194.894 759.872 183.266Z" fill="#212278"/>
+<path d="M892.478 117.944C898.634 107.912 906.614 100.046 916.418 94.346C926.45 88.646 937.85 85.796 950.618 85.796V136.07H937.964C922.916 136.07 911.516 139.604 903.764 146.672C896.24 153.74 892.478 166.052 892.478 183.608V278H844.598V88.532H892.478V117.944Z" fill="#212278"/>
+<path d="M1020.49 116.234C1026.64 107.114 1035.08 99.704 1045.8 94.004C1056.74 88.304 1069.17 85.454 1083.07 85.454C1099.26 85.454 1113.85 89.444 1126.85 97.424C1140.07 105.404 1150.45 116.804 1157.97 131.624C1165.72 146.216 1169.6 163.202 1169.6 182.582C1169.6 201.962 1165.72 219.176 1157.97 234.224C1150.45 249.044 1140.07 260.558 1126.85 268.766C1113.85 276.974 1099.26 281.078 1083.07 281.078C1068.94 281.078 1056.51 278.342 1045.8 272.87C1035.31 267.17 1026.87 259.874 1020.49 250.982V278H972.607V24.92H1020.49V116.234ZM1120.69 182.582C1120.69 171.182 1118.3 161.378 1113.51 153.17C1108.95 144.734 1102.8 138.35 1095.04 134.018C1087.52 129.686 1079.31 127.52 1070.42 127.52C1061.76 127.52 1053.55 129.8 1045.8 134.36C1038.27 138.692 1032.12 145.076 1027.33 153.512C1022.77 161.948 1020.49 171.866 1020.49 183.266C1020.49 194.666 1022.77 204.584 1027.33 213.02C1032.12 221.456 1038.27 227.954 1045.8 232.514C1053.55 236.846 1061.76 239.012 1070.42 239.012C1079.31 239.012 1087.52 236.732 1095.04 232.172C1102.8 227.612 1108.95 221.114 1113.51 212.678C1118.3 204.242 1120.69 194.21 1120.69 182.582Z" fill="#212278"/>
+<path d="M1278.26 281.078C1260.02 281.078 1243.61 277.088 1229.02 269.108C1214.42 260.9 1202.91 249.386 1194.47 234.566C1186.27 219.746 1182.16 202.646 1182.16 183.266C1182.16 163.886 1186.38 146.786 1194.82 131.966C1203.48 117.146 1215.22 105.746 1230.04 97.766C1244.86 89.558 1261.39 85.454 1279.63 85.454C1297.87 85.454 1314.4 89.558 1329.22 97.766C1344.04 105.746 1355.67 117.146 1364.11 131.966C1372.77 146.786 1377.1 163.886 1377.1 183.266C1377.1 202.646 1372.66 219.746 1363.76 234.566C1355.1 249.386 1343.24 260.9 1328.2 269.108C1313.38 277.088 1296.73 281.078 1278.26 281.078ZM1278.26 239.354C1286.93 239.354 1295.02 237.302 1302.55 233.198C1310.3 228.866 1316.45 222.482 1321.01 214.046C1325.57 205.61 1327.85 195.35 1327.85 183.266C1327.85 165.254 1323.07 151.46 1313.49 141.884C1304.14 132.08 1292.63 127.178 1278.95 127.178C1265.27 127.178 1253.75 132.08 1244.41 141.884C1235.29 151.46 1230.73 165.254 1230.73 183.266C1230.73 201.278 1235.17 215.186 1244.06 224.99C1253.18 234.566 1264.58 239.354 1278.26 239.354Z" fill="#212278"/>
+<path d="M1506.96 85.796C1529.53 85.796 1547.77 92.978 1561.68 107.342C1575.59 121.478 1582.54 141.314 1582.54 166.85V278H1534.66V173.348C1534.66 158.3 1530.9 146.786 1523.37 138.806C1515.85 130.598 1505.59 126.494 1492.59 126.494C1479.37 126.494 1468.88 130.598 1461.13 138.806C1453.61 146.786 1449.84 158.3 1449.84 173.348V278H1401.96V88.532H1449.84V112.13C1456.23 103.922 1464.32 97.538 1474.13 92.978C1484.16 88.19 1495.1 85.796 1506.96 85.796Z" fill="#212278"/>
<path d="M181.165 139.644V69.822L241.346 35.0571L241.054 104.879L181.165 139.644Z" fill="#60FFD2"/>
<path d="M181.165 69.822V139.644L120.4 104.879V35.0571L181.165 69.822Z" fill="#36B5B4"/>
<path d="M120.4 35.0571L181.165 69.822L241.346 35.0571L181.165 0L120.4 35.0571Z" fill="#5FE4D2"/>
@@ -18,8 +18,8 @@
<path d="M181.165 278.88V348.702L120.4 313.937V244.115L181.165 278.88Z" fill="#2F31AE"/>
<path d="M120.4 244.115L181.165 278.88L241.346 244.115L181.165 209.057L120.4 244.115Z" fill="#6041D0"/>
<path d="M60.7652 348.702V278.88L120.947 244.115L120.654 313.937L60.7652 348.702Z" fill="#7D7FE5"/>
-<path d="M60.7652 278.88V348.702L-1.52588e-05 313.937V244.115L60.7652 278.88Z" fill="#2F31AE"/>
-<path d="M-1.52588e-05 244.115L60.7652 278.88L120.947 244.115L60.7656 209.057L-1.52588e-05 244.115Z" fill="#6041D0"/>
+<path d="M60.7652 278.88V348.702L0 313.937V244.115L60.7652 278.88Z" fill="#2F31AE"/>
+<path d="M0 244.115L60.7652 278.88L120.947 244.115L60.7656 209.057L0 244.115Z" fill="#6041D0"/>
<path d="M301.017 348.702V278.88L361.198 244.115L360.906 313.937L301.017 348.702Z" fill="#7D7FE5"/>
<path d="M301.017 278.88V348.702L240.252 313.937V244.115L301.017 278.88Z" fill="#2F31AE"/>
<path d="M240.252 244.115L301.017 278.88L361.198 244.115L301.018 209.057L240.252 244.115Z" fill="#6041D0"/>
diff --git a/packages/auth/src/services/session.server.ts b/packages/auth/src/services/session.server.ts
index cd08e5bc64..a4b0f9d232 100644
--- a/packages/auth/src/services/session.server.ts
+++ b/packages/auth/src/services/session.server.ts
@@ -93,6 +93,19 @@ export async function getAuthSession(
return session.get(SESSION_KEY);
}
+export async function getOrRefreshAuthSession(
+ request: Request
+): Promise<AuthSession | null> {
+ const session = await getAuthSession(request);
+ if (!session) return null;
+
+ if (isExpiringSoon(session.expiresAt)) {
+ return refreshAuthSession(request);
+ }
+
+ return session;
+}
+
export async function getSessionFlash(request: Request) {
const session = await getSession(request);