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: create outline for carbon university

Brad Barbin31869a927aaf
diff --git a/apps/erp/app/modules/production/ui/Jobs/ProductionEventForm.tsx b/apps/erp/app/modules/production/ui/Jobs/ProductionEventForm.tsx
index a4df8ba1d6..1053d760a4 100644
--- a/apps/erp/app/modules/production/ui/Jobs/ProductionEventForm.tsx
+++ b/apps/erp/app/modules/production/ui/Jobs/ProductionEventForm.tsx
@@ -92,6 +92,11 @@ const ProductionEventForm = ({
options={operationOptions ?? []}
/>
<Employee name="employeeId" label="Employee" />
+ <WorkCenter
+ name="workCenterId"
+ label="Work Center"
+ processId={initialValues.jobOperationId}
+ />
<Select
name="type"
label="Event Type"
@@ -101,7 +106,6 @@ const ProductionEventForm = ({
{ label: "Setup", value: "Setup" },
]}
/>
- <WorkCenter name="workCenterId" label="Work Center" />
<DateTimePicker
name="startTime"
label="Start Time"
diff --git a/apps/erp/app/routes/x+/job+/$jobId.events.new.tsx b/apps/erp/app/routes/x+/job+/$jobId.events.new.tsx
index b62c93c39b..b5b2589918 100644
--- a/apps/erp/app/routes/x+/job+/$jobId.events.new.tsx
+++ b/apps/erp/app/routes/x+/job+/$jobId.events.new.tsx
@@ -11,29 +11,23 @@ import {
upsertProductionEvent,
} from "~/modules/production";
import { ProductionEventForm } from "~/modules/production/ui/Jobs";
-import { getWorkCentersList } from "~/modules/resources";
import { getParams, path } from "~/utils/path";
export async function loader({ request, params }: LoaderFunctionArgs) {
- const { client, companyId } = await requirePermissions(request, {
+ const { client } = await requirePermissions(request, {
create: "production",
});
const { jobId } = params;
if (!jobId) throw notFound("jobId not found");
- const [jobOperations, workCenters] = await Promise.all([
- getJobOperations(client, jobId),
- getWorkCentersList(client, companyId),
- ]);
+ const [jobOperations] = await Promise.all([getJobOperations(client, jobId)]);
- const operationOptions = jobOperations.data?.map((operation) => ({
- label: `${operation.description} - ${
- workCenters.data?.find((center) => center.id === operation.workCenterId)
- ?.name
- }`,
- value: operation.id,
- }));
+ const operationOptions =
+ jobOperations.data?.map((operation) => ({
+ label: operation.description ?? "",
+ value: operation.id,
+ })) ?? [];
return json({ operationOptions });
}
diff --git a/apps/university/app/config.tsx b/apps/university/app/config.tsx
index 4ae0dec408..02f9250a8c 100644
--- a/apps/university/app/config.tsx
+++ b/apps/university/app/config.tsx
@@ -1,8 +1,24 @@
-import { LuCirclePlay, LuHexagon } from "react-icons/lu";
+import {
+ LuBox,
+ LuCalculator,
+ LuCirclePlay,
+ LuCodeXml,
+ LuCreditCard,
+ LuFactory,
+ LuFolderCheck,
+ LuHexagon,
+ LuShapes,
+ LuShoppingCart,
+ LuSquareStack,
+ LuTruck,
+ LuTvMinimalPlay,
+ LuUpload,
+ LuWebhook,
+} from "react-icons/lu";
-type Config = Section[];
+type Config = Module[];
-type Section = {
+type Module = {
name: string;
id: string;
background: string;
@@ -24,6 +40,7 @@ type Topic = {
description: string;
challenge: Question[];
lessons: Lesson[];
+ supplemental?: Lesson[];
};
interface Question {
@@ -41,25 +58,25 @@ type Lesson = {
duration: number;
};
-export const sections: Config = [
+export const modules: Config = [
{
- name: "Getting Started",
+ name: "Carbon Overview",
background: "#6041d0",
foreground: "#fff",
- id: "getting-started",
+ id: "carbon-overview",
courses: [
{
- name: "Carbon Overview",
- id: "carbon-overview",
+ name: "Introducing Carbon",
+ id: "introducing-carbon",
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.",
+ "Learn the fundamentals of Carbon and understand its architecture and capabilities.",
icon: <LuHexagon />,
topics: [
{
- name: "Introducing Carbon",
- id: "introduction",
+ name: "What is Carbon?",
+ id: "what-is-carbon",
description:
- "This topic covers the basics of Carbon. Here you will learn what it is, how the platform and modules work, and the architecture.",
+ "Meet Carbon, the next generation of accessible, scalable, and data-centric ERP/MES/QMS software.",
challenge: [
{
id: "q1",
@@ -105,34 +122,110 @@ export const sections: Config = [
duration: 100,
},
{
- id: "about-carbon-modules",
+ id: "carbon-modules",
+ videoId: "1234567890",
+ name: "Carbon's Modules",
+ description:
+ "Learn about Carbon's modular architecture and how different modules work together to provide comprehensive business management capabilities.",
+ duration: 100,
+ },
+ {
+ id: "architecture-overview",
+ videoId: "1234567890",
+ name: "Architecture Overview",
+ description:
+ "Understand Carbon's technical architecture, including its web-based design, database structure, and API capabilities.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "The Basics",
+ id: "the-basics",
+ description:
+ "Master the fundamental components of Carbon's interface and data management.",
+ icon: <LuShapes />,
+ topics: [
+ {
+ name: "Core Components",
+ id: "core-components",
+ description:
+ "Learn about the essential building blocks of Carbon: tables, forms, documents, and custom fields.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "Which component is used to display and manage data in Carbon?",
+ options: ["Forms", "Tables", "Documents", "Custom Fields"],
+ correctAnswer: 1,
+ },
+ {
+ id: "q2",
+ question:
+ "What allows you to collect and edit information in Carbon?",
+ options: ["Tables", "Forms", "Documents", "Custom Fields"],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "tables",
+ videoId: "1234567890",
+ name: "Tables",
+ description:
+ "Learn how to use tables to view, sort, filter, and manage your data effectively in Carbon.",
+ duration: 100,
+ },
+ {
+ id: "forms",
+ videoId: "1234567890",
+ name: "Forms",
+ description:
+ "Master the art of creating and using forms to input and edit data in Carbon.",
+ duration: 100,
+ },
+ {
+ id: "documents",
videoId: "1234567890",
- name: "About Carbon's Modules",
- description: "",
+ name: "Documents",
+ description:
+ "Understand how to work with documents, including creation, editing, and sharing capabilities.",
duration: 100,
},
{
- id: "carbon-architecture",
+ id: "custom-fields",
videoId: "1234567890",
- name: "Carbon's Architecture",
- description: "",
+ name: "Custom Fields",
+ description:
+ "Learn how to extend Carbon's functionality by creating custom fields to capture additional data.",
duration: 100,
},
],
},
],
},
+ ],
+ },
+ {
+ name: "Getting Started",
+ background: "#4AA99D",
+ foreground: "#fff",
+ id: "getting-started",
+ courses: [
{
- name: "Getting Setup",
- id: "getting-setup",
- description: "Learn how to setup your organization to use Carbon.",
+ name: "Setting Up Your Company",
+ id: "setting-up-company",
+ description:
+ "Learn how to setup your organization to use Carbon effectively.",
icon: <LuCirclePlay />,
topics: [
{
- name: "Setting Up Your Company",
+ name: "Company Setup",
id: "company-setup",
description:
- "Learn how to setup your company in Carbon. This includes creating your company, adding users, and setting up your company's preferences. This is the first step to getting your organization ready to use Carbon.",
+ "Learn how to setup your company in Carbon. This includes creating your company, adding users, and setting up your company's preferences.",
challenge: [
{
id: "q1",
@@ -165,30 +258,80 @@ export const sections: Config = [
name: "Company Setup",
videoId: "1234567890",
description:
- "Learn how to setup your company in Carbon. This includes creating your company, adding users, and setting up your company's preferences. This is the first step to getting your organization ready to use Carbon.",
+ "Learn how to setup your company in Carbon. This includes creating your company, adding users, and setting up your company's preferences.",
duration: 100,
},
{
- id: "users-setup",
- name: "Users & Permissions",
+ id: "users-permissions",
+ name: "Users and Permissions",
videoId: "1234567890",
description:
- "Learn how to setup your users in Carbon. This includes creating your users, adding users, and setting up your users' preferences.",
+ "Learn how to setup your users in Carbon. This includes creating users, setting permissions, and managing access levels.",
duration: 100,
},
{
- id: "resources-setup",
- name: "Resources",
+ id: "locations-resources",
+ name: "Locations and Resources",
videoId: "1234567890",
description:
- "Learn how to setup your work centers, machines, and processes in Carbon. This is the first step to getting your organization ready to use Carbon.",
+ "Learn how to setup your work centers, machines, and processes in Carbon. This is essential for manufacturing and resource planning.",
duration: 100,
},
{
- id: "integrations-setup",
+ id: "integrations",
name: "Integrations",
videoId: "1234567890",
- description: "Learn how to setup your integrations in Carbon.",
+ description:
+ "Learn how to setup your integrations in Carbon to connect with other business systems and tools.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Migrating Data",
+ id: "migrating-data",
+ description:
+ "Learn how to import and migrate your existing data into Carbon.",
+ icon: <LuUpload />,
+ topics: [
+ {
+ name: "Import Tools",
+ id: "import-tools",
+ description:
+ "Learn how to use Carbon's import tools to bring your existing data into the system efficiently.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "What is the primary method for importing data into Carbon?",
+ options: [
+ "Manual entry",
+ "Import tools",
+ "API only",
+ "Database migration",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "import-tools",
+ name: "Import Tools",
+ videoId: "1234567890",
+ description:
+ "Learn how to use Carbon's built-in import tools to efficiently migrate your data from other systems.",
+ duration: 100,
+ },
+ ],
+ supplemental: [
+ {
+ id: "importing-data-api",
+ videoId: "1234567890",
+ name: "Importing Data with the API",
+ description:
+ "Learn how to use Carbon's API to programmatically import data and integrate with other systems.",
duration: 100,
},
],
@@ -198,59 +341,1210 @@ export const sections: Config = [
],
},
{
- name: "Parts & Materials",
- background: "#4AA99D",
- foreground: "#fff",
- id: "bom",
- courses: [],
- },
- {
- name: "Selling",
+ name: "Parts and Materials",
background: "#488FB9",
foreground: "#fff",
- id: "selling",
- courses: [],
+ id: "parts-materials",
+ courses: [
+ {
+ name: "Defining an Item",
+ id: "defining-item",
+ description:
+ "Learn how to define and manage different types of items in Carbon.",
+ icon: <LuSquareStack />,
+ topics: [
+ {
+ name: "Item Types",
+ id: "item-types",
+ description:
+ "Understand the different types of items in Carbon: parts, materials, consumables, and tools.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "Which of the following is NOT a type of item in Carbon?",
+ options: ["Parts", "Materials", "Consumables", "Services"],
+ correctAnswer: 3,
+ },
+ ],
+ lessons: [
+ {
+ id: "parts-materials-consumables-tools",
+ videoId: "1234567890",
+ name: "Parts, Materials and Tools",
+ description:
+ "Learn the differences between various item types and when to use each one in your business processes.",
+ duration: 100,
+ },
+ {
+ id: "method-types",
+ videoId: "1234567890",
+ name: "Method Types",
+ description:
+ "Understand the different method types available for items and how they affect manufacturing processes.",
+ duration: 100,
+ },
+ {
+ id: "tracking-types",
+ videoId: "1234567890",
+ name: "Tracking Types",
+ description:
+ "Learn about different tracking types and how they help manage inventory and traceability.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Manufacturing Methods",
+ id: "manufacturing-methods",
+ description:
+ "Learn how to create and manage manufacturing methods, bills of process, and bills of materials.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What defines how an item is manufactured in Carbon?",
+ options: [
+ "Bill of Materials",
+ "Method",
+ "Process",
+ "Work Order",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "methods",
+ videoId: "1234567890",
+ name: "Methods",
+ description:
+ "Learn how to create and manage manufacturing methods that define how items are produced.",
+ duration: 100,
+ },
+ {
+ id: "bill-of-process",
+ videoId: "1234567890",
+ name: "Bill of Process",
+ description:
+ "Understand how to create and manage bills of process that define the manufacturing steps.",
+ duration: 100,
+ },
+ {
+ id: "bill-of-materials",
+ videoId: "1234567890",
+ name: "Bill of Materials",
+ description:
+ "Learn how to create and manage bills of materials that define what components are needed.",
+ duration: 100,
+ },
+ {
+ id: "revisions-versions",
+ videoId: "1234567890",
+ name: "Revisions and Versions",
+ description:
+ "Master the revision and version control system for managing changes to methods and bills.",
+ duration: 100,
+ },
+ {
+ id: "get-method-save-method",
+ videoId: "1234567890",
+ name: "Get Method and Save Method",
+ description:
+ "Learn how to retrieve and save methods programmatically using Carbon's API.",
+ duration: 100,
+ },
+ ],
+ supplemental: [
+ {
+ id: "product-configurator",
+ videoId: "1234567890",
+ name: "Product Configurator",
+ description:
+ "Learn how to use Carbon's product configurator to create complex, configurable products.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Replenishing an Item",
+ id: "replenishing-item",
+ description:
+ "Learn how to keep your inventory stocked using Carbon's planning, purchasing, and job management tools.",
+ icon: <LuBox />,
+ topics: [
+ {
+ name: "Replenishing an Item",
+ id: "replenishing-an-item",
+ description:
+ "Understand the full lifecycle of replenishing inventory, including traceability, planning, purchasing, and job creation.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "Which of the following is NOT a method for replenishing inventory in Carbon?",
+ options: [
+ "Manual stock adjustment",
+ "Automated planning and purchasing",
+ "Job creation for manufacturing",
+ "Ignoring low stock alerts",
+ ],
+ correctAnswer: 3,
+ },
+ ],
+ lessons: [
+ {
+ id: "planning",
+ videoId: "1234567890",
+ name: "Planning",
+ description:
+ "See how Carbon's planning tools help you forecast demand and generate replenishment requirements.",
+ duration: 100,
+ },
+ {
+ id: "inventory-management",
+ videoId: "1234567890",
+ name: "Inventory Levels",
+ description:
+ "Learn how to monitor and manage inventory levels, set reorder points, and handle stock movements.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ ],
},
{
- name: "Manufacturing",
- background: "#78B2C4",
+ name: "Selling",
+ background: "#3c5ec0",
foreground: "#fff",
id: "selling",
- courses: [],
- },
- {
- name: "Buying",
- background: "#EFB655",
- foreground: "#fff",
- id: "buying",
- courses: [],
- },
- {
- name: "Shipping & Receiving",
- background: "#EF8729",
- foreground: "#fff",
- id: "quality",
- courses: [],
- },
- {
- name: "Quality",
- background: "#DD6444",
- foreground: "#fff",
- id: "developing",
- courses: [],
- },
- {
- name: "Developing",
- background: "#8487C5", // "#AB7DB3",
- foreground: "#fff",
- id: "example-1",
- courses: [],
+ courses: [
+ {
+ name: "Quoting and Estimating",
+ id: "quoting-estimating",
+ description:
+ "Learn how to create quotes, estimates, and convert them to orders.",
+ icon: <LuCalculator />,
+ topics: [
+ {
+ name: "Quoting",
+ id: "quote-process",
+ description:
+ "Master the complete quoting process from RFQ to order conversion.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the first step in the quoting process?",
+ options: [
+ "Creating a quote",
+ "Recording an RFQ",
+ "Calculating costs",
+ "Sending to customer",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "recording-rfq",
+ videoId: "1234567890",
+ name: "Recording an RFQ",
+ description:
+ "Learn how to record and manage Request for Quote (RFQ) documents from customers.",
+ duration: 100,
+ },
+ {
+ id: "quote-overview",
+ videoId: "1234567890",
+ name: "Quote Overview",
+ description:
+ "Understand the structure and components of a quote in Carbon.",
+ duration: 100,
+ },
+
+ {
+ id: "digital-quotes",
+ videoId: "1234567890",
+ name: "Digital Quotes",
+ description:
+ "Create professional digital quotes that can be easily shared with customers.",
+ duration: 100,
+ },
+ {
+ id: "quote-revisions",
+ videoId: "1234567890",
+ name: "Quote Revisions",
+ description:
+ "Learn how to manage quote revisions and track changes throughout the quoting process.",
+ duration: 100,
+ },
+ {
+ id: "converting-quotes-orders",
+ videoId: "1234567890",
+ name: "Converting Quotes to Orders",
+ description:
+ "Master the process of converting approved quotes into sales orders.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Estimating",
+ id: "estimating",
+ description:
+ "Learn how to create accurate estimates using different methods and cost calculations.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "What is the primary purpose of quote methods in Carbon?",
+ options: [
+ "To track customer preferences",
+ "To standardize the estimation process",
+ "To manage inventory levels",
+ "To create invoices",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "quote-methods",
+ videoId: "1234567890",
+ name: "Quote Methods",
+ description:
+ "Learn how to use different quote methods to standardize your estimation process and ensure consistency.",
+ duration: 100,
+ },
+ {
+ id: "quote-costing",
+ videoId: "1234567890",
+ name: "Quote Costing and Pricing",
+ description:
+ "Master the art of calculating accurate costs for quotes including materials, labor, and overhead.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Sales to Shipment",
+ id: "sales-shipment",
+ description:
+ "Learn how to manage the complete sales process from order to shipment.",
+ icon: <LuTruck />,
+ topics: [
+ {
+ name: "Order Management",
+ id: "order-management",
+ description:
+ "Master the complete order management process including make-to-order parts and shipping.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What happens after a sales order is created?",
+ options: [
+ "Immediate shipping",
+ "Production planning",
+ "Customer payment",
+ "Order cancellation",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "sales-orders",
+ videoId: "1234567890",
+ name: "Sales Orders",
+ description:
+ "Learn how to create and manage sales orders in Carbon.",
+ duration: 100,
+ },
+ {
+ id: "make-to-order-parts",
+ videoId: "1234567890",
+ name: "Make to Order Parts",
+ description:
+ "Understand how to handle make-to-order parts and production planning.",
+ duration: 100,
+ },
+ {
+ id: "shipping-orders",
+ videoId: "1234567890",
+ name: "Shipping Orders",
+ description: "Learn how to process and track order shipments.",
+ duration: 100,
+ },
+ {
+ id: "sales-invoices",
+ videoId: "1234567890",
+ name: "Sales Invoices",
+ description:
+ "Master the creation and management of sales invoices.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Manufacturing",
+ background: "#EFB655",
+ foreground: "#000000cc",
+ id: "manufacturing",
+ courses: [
+ {
+ name: "Managing Production",
+ id: "managing-production",
+ description:
+ "Learn how to manage the complete production lifecycle from job creation to completion.",
+ icon: <LuFactory />,
+ topics: [
+ {
+ name: "Job Overview",
+ id: "job-overview",
+ description:
+ "Understand the fundamentals of job management and how jobs drive production in Carbon.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the primary purpose of a job in Carbon?",
+ options: [
+ "To track customer orders",
+ "To manage production work",
+ "To handle inventory",
+ "To process invoices",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "job-overview",
+ videoId: "1234567890",
+ name: "Job Overview",
+ description:
+ "Learn the fundamentals of job management and how jobs drive production in Carbon.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Scheduling",
+ id: "scheduling",
+ description:
+ "Master the art of scheduling jobs and managing production timelines effectively.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the primary goal of production scheduling?",
+ options: [
+ "To maximize inventory levels",
+ "To optimize resource utilization",
+ "To minimize customer orders",
+ "To reduce quality checks",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "scheduling",
+ videoId: "1234567890",
+ name: "Scheduling",
+ description:
+ "Learn how to schedule jobs and manage production timelines effectively.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Production Planning",
+ id: "production-planning",
+ description:
+ "Understand how to plan production activities and coordinate resources.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What does production planning help determine?",
+ options: [
+ "Customer preferences",
+ "Resource requirements and timelines",
+ "Supplier pricing",
+ "Quality standards",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "production-planning",
+ videoId: "1234567890",
+ name: "Production Planning",
+ description:
+ "Learn how to plan production activities and coordinate resources effectively.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Closing a Job",
+ id: "closing-job",
+ description:
+ "Master the process of completing and closing jobs in the production system.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the final step in job management?",
+ options: [
+ "Starting the job",
+ "Scheduling the job",
+ "Closing the job",
+ "Planning the job",
+ ],
+ correctAnswer: 2,
+ },
+ ],
+ lessons: [
+ {
+ id: "closing-job",
+ videoId: "1234567890",
+ name: "Closing a Job",
+ description:
+ "Learn the proper process for completing and closing jobs in the production system.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Shop Floor",
+ id: "shop-floor",
+ description:
+ "Learn how to manage shop floor operations using Carbon's MES capabilities.",
+ icon: <LuTvMinimalPlay />,
+ topics: [
+ {
+ name: "MES Overview",
+ id: "mes-overview",
+ description:
+ "Understand Manufacturing Execution Systems and how Carbon implements MES functionality.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What does MES stand for?",
+ options: [
+ "Manufacturing Execution System",
+ "Material Exchange System",
+ "Management Execution System",
+ "Manufacturing Exchange System",
+ ],
+ correctAnswer: 0,
+ },
+ ],
+ lessons: [
+ {
+ id: "mes-overview",
+ videoId: "1234567890",
+ name: "MES Overview",
+ description:
+ "Learn about Manufacturing Execution Systems and how Carbon implements MES functionality.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Tracking Time and Quantities",
+ id: "tracking-time-quantities",
+ description:
+ "Master the tracking of production time and quantities for accurate job costing.",
+ challenge: [
+ {
+ id: "q1",
+ question: "Why is tracking time and quantities important?",
+ options: [
+ "For inventory management only",
+ "For accurate job costing and efficiency analysis",
+ "For customer satisfaction",
+ "For supplier management",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "tracking-time-quantities",
+ videoId: "1234567890",
+ name: "Tracking Time and Quantities",
+ description:
+ "Learn how to track production time and quantities for accurate job costing and efficiency analysis.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Tracking Batch and Serial Parts",
+ id: "tracking-batch-serial",
+ description:
+ "Learn how to track batch and serial numbered parts for traceability.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "What is the purpose of tracking batch and serial parts?",
+ options: [
+ "To increase inventory levels",
+ "To provide traceability and quality control",
+ "To reduce production costs",
+ "To speed up shipping",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "tracking-batch-serial",
+ videoId: "1234567890",
+ name: "Tracking Batch and Serial Parts",
+ description:
+ "Learn how to track batch and serial numbered parts for traceability and quality control.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Issuing Parts",
+ id: "issuing-parts",
+ description:
+ "Understand how to issue parts to jobs and track material consumption.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What happens when parts are issued to a job?",
+ options: [
+ "Inventory levels increase",
+ "Inventory levels decrease",
+ "Customer orders are created",
+ "Suppliers are notified",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "issuing-parts",
+ videoId: "1234567890",
+ name: "Issuing Parts",
+ description:
+ "Learn how to issue parts to jobs and track material consumption accurately.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Job Traveler",
+ id: "job-traveler",
+ description:
+ "Master the job traveler system for guiding production processes.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is a job traveler used for?",
+ options: [
+ "Customer communication",
+ "Guiding production processes and instructions",
+ "Supplier management",
+ "Quality control only",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "job-traveler",
+ videoId: "1234567890",
+ name: "Job Traveler",
+ description:
+ "Learn how to use job travelers to guide production processes and provide instructions.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Buying",
+ background: "#EF8729",
+ foreground: "#fff",
+ id: "buying",
+ courses: [
+ {
+ name: "Purchasing Basics",
+ id: "purchasing-basics",
+ description:
+ "Learn the fundamentals of purchasing and procurement in Carbon.",
+ icon: <LuShoppingCart />,
+ topics: [
+ {
+ name: "Purchasing Overview",
+ id: "purchasing-overview",
+ description:
+ "Understand the complete purchasing process from supplier selection to payment.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the first step in the purchasing process?",
+ options: [
+ "Creating a purchase order",
+ "Receiving goods",
+ "Identifying needs",
+ "Paying suppliers",
+ ],
+ correctAnswer: 2,
+ },
+ ],
+ lessons: [
+ {
+ id: "purchasing-overview",
+ videoId: "1234567890",
+ name: "Purchasing Overview",
+ description:
+ "Learn about the complete purchasing process from supplier selection to payment.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Supplier Quotes",
+ id: "supplier-quotes",
+ description:
+ "Learn how to manage supplier quotes and compare pricing effectively.",
+ challenge: [
+ {
+ id: "q1",
+ question: "Why are supplier quotes important?",
+ options: [
+ "To increase inventory",
+ "To compare pricing and select the best supplier",
+ "To reduce quality checks",
+ "To speed up shipping",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "supplier-quotes",
+ videoId: "1234567890",
+ name: "Supplier Quotes",
+ description:
+ "Learn how to manage supplier quotes and compare pricing effectively.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Purchase Orders",
+ id: "purchase-orders",
+ description:
+ "Master the creation and management of purchase orders.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is a purchase order?",
+ options: [
+ "A customer order",
+ "A formal request to buy goods or services",
+ "A quality inspection report",
+ "A shipping document",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "purchase-orders",
+ videoId: "1234567890",
+ name: "Purchase Orders",
+ description:
+ "Learn how to create and manage purchase orders effectively.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Receiving a Purchase Order",
+ id: "receiving-purchase-order",
+ description:
+ "Understand how to receive and inspect purchased goods.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "What should be done when receiving a purchase order?",
+ options: [
+ "Immediately pay the supplier",
+ "Inspect goods and update inventory",
+ "Create a new purchase order",
+ "Contact the customer",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "receiving-purchase-order",
+ videoId: "1234567890",
+ name: "Receiving a Purchase Order",
+ description:
+ "Learn how to receive and inspect purchased goods properly.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Purchase Invoices",
+ id: "purchase-invoices",
+ description:
+ "Learn how to process and manage purchase invoices for payment.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the purpose of a purchase invoice?",
+ options: [
+ "To track customer orders",
+ "To request payment from suppliers",
+ "To record received goods and request payment",
+ "To manage inventory levels",
+ ],
+ correctAnswer: 2,
+ },
+ ],
+ lessons: [
+ {
+ id: "purchase-invoices",
+ videoId: "1234567890",
+ name: "Purchase Invoices",
+ description:
+ "Learn how to process and manage purchase invoices for payment.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Advanced Purchasing",
+ id: "advanced-purchasing",
+ description:
+ "Master advanced purchasing techniques and strategic procurement.",
+ icon: <LuCreditCard />,
+ topics: [
+ {
+ name: "Purchasing Planning",
+ id: "purchasing-planning",
+ description:
+ "Learn how to plan purchasing activities based on demand and inventory levels.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is purchasing planning based on?",
+ options: [
+ "Supplier preferences only",
+ "Demand forecasts and inventory levels",
+ "Customer orders only",
+ "Quality requirements only",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "purchasing-planning",
+ videoId: "1234567890",
+ name: "Purchasing Planning",
+ description:
+ "Learn how to plan purchasing activities based on demand and inventory levels.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Historical Costs",
+ id: "historical-costs",
+ description:
+ "Understand how to analyze historical costs for better purchasing decisions.",
+ challenge: [
+ {
+ id: "q1",
+ question: "Why are historical costs important?",
+ options: [
+ "To increase inventory levels",
+ "To make better purchasing decisions and negotiate prices",
+ "To reduce quality checks",
+ "To speed up shipping",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "historical-costs",
+ videoId: "1234567890",
+ name: "Historical Costs",
+ description:
+ "Learn how to analyze historical costs for better purchasing decisions.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Supplier Pricing",
+ id: "supplier-pricing",
+ description:
+ "Master supplier pricing analysis and negotiation strategies.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the goal of supplier pricing analysis?",
+ options: [
+ "To increase costs",
+ "To optimize costs and improve supplier relationships",
+ "To reduce quality",
+ "To slow down delivery",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "supplier-pricing",
+ videoId: "1234567890",
+ name: "Supplier Pricing",
+ description:
+ "Learn how to analyze supplier pricing and develop negotiation strategies.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Quality",
+ background: "#DD6444",
+ foreground: "#fff",
+ id: "quality",
+ courses: [
+ {
+ name: "Tracking Quality",
+ id: "tracking-quality",
+ description:
+ "Learn how to implement and manage quality control processes in Carbon.",
+ icon: <LuFolderCheck />,
+ topics: [
+ {
+ name: "Non-Conformances",
+ id: "non-conformances",
+ description:
+ "Understand how to track and manage non-conforming materials and products.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is a non-conformance?",
+ options: [
+ "A successful product",
+ "A product or material that doesn't meet specifications",
+ "A customer order",
+ "A supplier invoice",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "non-conformances",
+ videoId: "1234567890",
+ name: "Non-Conformances",
+ description:
+ "Learn how to track and manage non-conforming materials and products.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Gauges and Calibrations",
+ id: "gauges-calibrations",
+ description:
+ "Master the management of measurement equipment and calibration schedules.",
+ challenge: [
+ {
+ id: "q1",
+ question: "Why is gauge calibration important?",
+ options: [
+ "To increase costs",
+ "To ensure measurement accuracy and quality control",
+ "To reduce inventory",
+ "To speed up production",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "gauges-calibrations",
+ videoId: "1234567890",
+ name: "Gauges and Calibrations",
+ description:
+ "Learn how to manage measurement equipment and calibration schedules.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Developing",
+ background: "#10d131",
+ foreground: "#000000cc",
+ id: "developing",
+ courses: [
+ {
+ name: "Using the API",
+ id: "using-api",
+ description:
+ "Learn how to integrate with Carbon using its powerful API capabilities.",
+ icon: <LuCodeXml />,
+ topics: [
+ {
+ name: "API Keys",
+ id: "api-keys",
+ description:
+ "Understand how to create and manage API keys for secure access to Carbon's API.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the purpose of an API key?",
+ options: [
+ "To increase costs",
+ "To provide secure access to Carbon's API",
+ "To reduce quality",
+ "To slow down performance",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "api-keys",
+ videoId: "1234567890",
+ name: "API Keys",
+ description:
+ "Learn how to create and manage API keys for secure access to Carbon's API.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "TypeScript API Client",
+ id: "typescript-api-client",
+ description:
+ "Learn how to use Carbon's TypeScript API client for seamless integration.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "What is the advantage of using the TypeScript API client?",
+ options: [
+ "To increase costs",
+ "To provide type safety and better development experience",
+ "To reduce quality",
+ "To slow down performance",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "typescript-api-client",
+ videoId: "1234567890",
+ name: "TypeScript API Client",
+ description:
+ "Learn how to use Carbon's TypeScript API client for seamless integration.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "C# API Client",
+ id: "csharp-api-client",
+ description:
+ "Master the C# API client for .NET applications and integrations.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What platform is the C# API client designed for?",
+ options: [
+ "Web browsers",
+ ".NET applications",
+ "Mobile apps",
+ "Linux systems",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "csharp-api-client",
+ videoId: "1234567890",
+ name: "C# API Client",
+ description:
+ "Learn how to use Carbon's C# API client for .NET applications.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Python API Client",
+ id: "python-api-client",
+ description:
+ "Learn how to integrate with Carbon using the Python API client.",
+ challenge: [
+ {
+ id: "q1",
+ question:
+ "What is Python commonly used for in API integration?",
+ options: [
+ "Web development only",
+ "Data analysis, automation, and integration",
+ "Mobile development",
+ "Database management only",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "python-api-client",
+ videoId: "1234567890",
+ name: "Python API Client",
+ description:
+ "Learn how to integrate with Carbon using the Python API client.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "Integrating with Carbon",
+ id: "integrating-carbon",
+ description:
+ "Learn advanced integration techniques and best practices for connecting with Carbon.",
+ icon: <LuWebhook />,
+ topics: [
+ {
+ name: "Webhooks",
+ id: "webhooks",
+ description:
+ "Understand how to use webhooks for real-time event notifications from Carbon.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the primary benefit of webhooks?",
+ options: [
+ "To increase costs",
+ "To receive real-time event notifications",
+ "To reduce quality",
+ "To slow down performance",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "webhooks",
+ videoId: "1234567890",
+ name: "Webhooks",
+ description:
+ "Learn how to use webhooks for real-time event notifications from Carbon.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Integrations",
+ id: "integrations",
+ description:
+ "Master the process of integrating Carbon with other business systems and tools.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What is the goal of system integrations?",
+ options: [
+ "To increase complexity",
+ "To streamline workflows and improve efficiency",
+ "To reduce functionality",
+ "To slow down processes",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "integrations",
+ videoId: "1234567890",
+ name: "Integrations",
+ description:
+ "Learn how to integrate Carbon with other business systems and tools.",
+ duration: 100,
+ },
+ ],
+ },
+ {
+ name: "Applications",
+ id: "applications",
+ description:
+ "Learn how to build custom applications that integrate with Carbon's platform.",
+ challenge: [
+ {
+ id: "q1",
+ question: "What can you build with Carbon's API?",
+ options: [
+ "Only mobile apps",
+ "Custom applications, dashboards, and tools",
+ "Only web applications",
+ "Only desktop software",
+ ],
+ correctAnswer: 1,
+ },
+ ],
+ lessons: [
+ {
+ id: "applications",
+ videoId: "1234567890",
+ name: "Applications",
+ description:
+ "Learn how to build custom applications that integrate with Carbon's platform.",
+ duration: 100,
+ },
+ ],
+ },
+ ],
+ },
+ ],
},
- // {
- // name: "Example",
- // background: "#8487C5",
- // foreground: "#fff",
- // id: "example-2",
- // courses: [],
- // },
];
diff --git a/apps/university/app/root.tsx b/apps/university/app/root.tsx
index 1663d67744..4295b969a0 100644
--- a/apps/university/app/root.tsx
+++ b/apps/university/app/root.tsx
@@ -36,12 +36,13 @@ import type {
} from "@vercel/remix";
import { json } from "@vercel/remix";
import React, { useEffect } from "react";
-import { sections } from "~/config";
+import { modules } from "~/config";
import { getMode, setMode } from "~/services/mode.server";
import NProgress from "~/styles/nprogress.css?url";
import Tailwind from "~/styles/tailwind.css?url";
+import { motion } from "framer-motion";
import { LuChevronDown, LuFingerprint, LuMoon, LuSun } from "react-icons/lu";
import AvatarMenu from "./components/AvatarMenu";
import { useMode } from "./hooks/useMode";
@@ -207,28 +208,31 @@ export default function App() {
const fetcher = useFetcher<typeof action>();
const user = useOptionalUser();
- // Calculate total challenges from sections config
- const totalChallenges = sections.reduce((total, section) => {
+ // Calculate total challenges from modules config
+ const totalChallenges = modules.reduce((total, module) => {
return (
total +
- section.courses.reduce((courseTotal, course) => {
+ module.courses.reduce((courseTotal, course) => {
return (
courseTotal +
course.topics.reduce((topicTotal, topic) => {
- return topicTotal + (topic.challenge ? 1 : 0);
+ const hasChallenge = topic.challenge && topic.challenge.length > 0;
+ return topicTotal + (hasChallenge ? 1 : 0);
}, 0)
);
}, 0)
);
}, 0);
- const completionPercentage = Math.min(
- Math.round(
- (challengeAttempts.filter((attempt) => attempt.passed).length /
- totalChallenges) *
- 100
- ),
- 100
+ const passedChallenges = challengeAttempts
+ .filter((attempt) => attempt.passed)
+ .filter(
+ (attempt, index, self) =>
+ index === self.findIndex((a) => a.topicId === attempt.topicId)
+ ).length;
+
+ const completionPercentage = Math.round(
+ (passedChallenges / totalChallenges) * 100
);
return (
@@ -315,20 +319,36 @@ export default function App() {
{disclosure.isOpen ? "Less" : "More"}
</Button>
</div>
- <div
+ <motion.div
className={cn(
- "w-full bg-black/20 transition-all duration-300 ease-in-out",
- disclosure.isOpen
- ? "h-auto opacity-100"
- : "h-0 opacity-0 overflow-hidden"
+ "w-full bg-black/20",
+ disclosure.isOpen ? "overflow-visible" : "overflow-hidden"
)}
+ initial={{ height: 0, opacity: 0 }}
+ animate={{
+ height: disclosure.isOpen ? "auto" : 0,
+ opacity: disclosure.isOpen ? 1 : 0,
+ }}
+ transition={{
+ height: {
+ duration: 0.3,
+ ease: "easeInOut",
+ },
+ opacity: {
+ duration: 0.2,
+ delay: disclosure.isOpen ? 0.1 : 0,
+ ease: "easeInOut",
+ },
+ }}
>
<div className="max-w-5xl mx-auto px-3 py-4 flex gap-8 z-logo items-center text-white w-full">
<div className="w-full bg-white/10 rounded-lg p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8">
- {sections.map((section) =>
- section.courses.map((course) => {
+ {modules.map((module) =>
+ module.courses.map((course) => {
const totalChallenges = course.topics.reduce(
- (acc, topic) => acc + (topic.challenge ? 1 : 0),
+ (acc, topic) =>
+ acc +
+ (topic.challenge && topic.challenge.length > 0 ? 1 : 0),
0
);
@@ -348,7 +368,7 @@ export default function App() {
return (
<Link
- to={path.to.course(section.id, course.id)}
+ to={path.to.course(module.id, course.id)}
key={course.id}
className={cn(
"cursor-pointer flex items-center gap-2",
@@ -358,8 +378,8 @@ export default function App() {
<div
className="size-8 rounded-lg flex items-center justify-center"
style={{
- backgroundColor: section.background,
- color: section.foreground,
+ backgroundColor: module.background,
+ color: module.foreground,
}}
>
{course.icon}
@@ -377,7 +397,7 @@ export default function App() {
)}
</div>
</div>
- </div>
+ </motion.div>
</div>
)}
<Outlet />
diff --git a/apps/university/app/routes/_index.tsx b/apps/university/app/routes/_index.tsx
index 9d0f8b38e1..6412d13e69 100644
--- a/apps/university/app/routes/_index.tsx
+++ b/apps/university/app/routes/_index.tsx
@@ -1,9 +1,9 @@
import { redirect, type LoaderFunctionArgs } from "@vercel/remix";
-import { sections } from "~/config";
+import { modules } 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));
+ throw redirect(path.to.course(modules[0].id, modules[0].courses[0].id));
}
export default function IndexRoute() {
diff --git a/apps/university/app/routes/about.tsx b/apps/university/app/routes/about.tsx
index 0766bbc8bd..3906560697 100644
--- a/apps/university/app/routes/about.tsx
+++ b/apps/university/app/routes/about.tsx
@@ -2,32 +2,52 @@ import { Button, Heading } from "@carbon/react";
import { Link } from "@remix-run/react";
import { LuCirclePlay } from "react-icons/lu";
import { Hero } from "~/components/Hero";
-import { sections } from "~/config";
+import { modules } from "~/config";
+import { useOptionalUser } from "~/hooks/useUser";
import { path } from "~/utils/path";
export default function AboutRoute() {
+ const user = useOptionalUser();
return (
<div className="w-full flex flex-col">
<Hero>
<Heading
- size="h1"
+ size="display"
className="font-display text-[#212578] dark:text-white max-w-2xl"
>
- What do you want to learn?
+ Carbon University
</Heading>
<p className="text-muted-foreground text-balance text-left font-medium tracking-tighter text-lg max-w-2xl">
Want to take command of your business? Need a quick answer to a
- problem? Test your knowledge and track your progress.
+ problem or onboard a new employee? 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.login}>Sign up to register</Link>
- </Button>
+ {user ? (
+ <Button
+ size="lg"
+ variant="secondary"
+ leftIcon={<LuCirclePlay />}
+ asChild
+ >
+ <Link
+ to={path.to.lesson(
+ modules[0].courses[0].topics[0].lessons[0].id
+ )}
+ >
+ Begin your first lesson
+ </Link>
+ </Button>
+ ) : (
+ <Button
+ size="lg"
+ variant="secondary"
+ leftIcon={<LuCirclePlay />}
+ asChild
+ >
+ <Link to={path.to.login}>Sign up to register</Link>
+ </Button>
+ )}
</div>
</Hero>
<section className="border-b">
@@ -78,7 +98,7 @@ export default function AboutRoute() {
>
<Link
to={path.to.lesson(
- sections[0].courses[0].topics[0].lessons[0].id
+ modules[0].courses[0].topics[0].lessons[0].id
)}
>
Begin your first lesson
diff --git a/apps/university/app/routes/challenge+/$id.tsx b/apps/university/app/routes/challenge+/$id.tsx
index f0500c2c82..2d72c3b6d0 100644
--- a/apps/university/app/routes/challenge+/$id.tsx
+++ b/apps/university/app/routes/challenge+/$id.tsx
@@ -8,7 +8,7 @@ import {
useParams,
useSubmit,
} from "@remix-run/react";
-import { useEffect, useMemo, useState } from "react";
+import { useEffect, useMemo, useRef, useState } from "react";
import ConfettiExplosion from "react-confetti-explosion";
import {
LuChevronLeft,
@@ -92,6 +92,7 @@ export default function ChallengeRoute() {
const { id } = useParams();
const user = useOptionalUser();
const actionData = useActionData<ActionData>();
+ const audioRef = useRef<HTMLAudioElement | null>(null);
const submit = useSubmit();
@@ -105,7 +106,7 @@ export default function ChallengeRoute() {
throw new Error("Topic not found");
}
- const { section, course, topic } = context;
+ const { module, course, topic } = context;
// Shuffle the questions
const shuffledQuestions = useMemo(
@@ -119,6 +120,9 @@ export default function ChallengeRoute() {
useEffect(() => {
if (actionData) {
setIsSubmitted(true);
+ if (actionData.passed && audioRef.current) {
+ audioRef.current.play();
+ }
}
}, [actionData]);
@@ -191,7 +195,7 @@ export default function ChallengeRoute() {
className="mr-2"
asChild
>
- <Link to={path.to.course(section.id, course.id)}>Back to course</Link>
+ <Link to={path.to.course(module.id, course.id)}>Back to course</Link>
</Button>
<Button
@@ -199,7 +203,7 @@ export default function ChallengeRoute() {
className="text-sm text-muted-foreground"
asChild
>
- <Link to={path.to.course(section.id, course.id)}>{course.name}</Link>
+ <Link to={path.to.course(module.id, course.id)}>{course.name}</Link>
</Button>
<span className="text-muted-foreground text-sm">/</span>
@@ -213,8 +217,8 @@ export default function ChallengeRoute() {
<div
className="border rounded-lg rounded-b-none p-4"
style={{
- backgroundColor: section?.background,
- color: section?.foreground,
+ backgroundColor: module?.background,
+ color: module?.foreground,
}}
>
<div className="flex flex-col gap-4">
@@ -222,9 +226,9 @@ export default function ChallengeRoute() {
<div
className="flex-shrink-0 size-12 text-2xl p-3 rounded-full border"
style={{
- backgroundColor: section?.background,
- borderColor: section?.foreground,
- color: section?.foreground,
+ backgroundColor: module?.background,
+ borderColor: module?.foreground,
+ color: module?.foreground,
}}
>
<LuFlag />
@@ -285,7 +289,7 @@ export default function ChallengeRoute() {
leftIcon={<LuChevronLeft />}
asChild
>
- <Link to={path.to.course(section.id, course.id)}>
+ <Link to={path.to.course(module.id, course.id)}>
Return to Course Page
</Link>
</Button>
@@ -409,14 +413,19 @@ export default function ChallengeRoute() {
)}
{actionData?.passed && (
- <div className="fixed inset-0 flex items-center justify-center pointer-events-none">
- <ConfettiExplosion
- particleCount={200}
- force={1}
- duration={3000}
- width={1600}
- />
- </div>
+ <>
+ <audio ref={audioRef} preload="auto">
+ <source src="/victory.mp3" type="audio/mpeg" />
+ </audio>
+ <div className="fixed inset-0 flex items-center justify-center pointer-events-none">
+ <ConfettiExplosion
+ particleCount={200}
+ force={1}
+ duration={3000}
+ width={1600}
+ />
+ </div>
+ </>
)}
</div>
);
diff --git a/apps/university/app/routes/course+/$sectionId.$courseId.tsx b/apps/university/app/routes/course+/$moduleId.$courseId.tsx
similarity index 75%
rename from apps/university/app/routes/course+/$sectionId.$courseId.tsx
rename to apps/university/app/routes/course+/$moduleId.$courseId.tsx
index 4f75b646dc..73d047625d 100644
--- a/apps/university/app/routes/course+/$sectionId.$courseId.tsx
+++ b/apps/university/app/routes/course+/$moduleId.$courseId.tsx
@@ -7,7 +7,7 @@ import {
LuFlag,
LuRotateCcw,
} from "react-icons/lu";
-import { sections } from "~/config";
+import { modules } from "~/config";
import { useProgress } from "~/hooks";
import { path } from "~/utils/path";
import { formatDuration } from "~/utils/video";
@@ -25,9 +25,9 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
export default function CourseRoute() {
const { lessonCompletions, challengeAttempts } = useProgress();
- const { sectionId, courseId } = useParams();
- const section = sections.find((section) => section.id === sectionId);
- const course = section?.courses.find((course) => course.id === courseId);
+ const { moduleId, courseId } = useParams();
+ const module = modules.find((module) => module.id === moduleId);
+ const course = module?.courses.find((course) => course.id === courseId);
const totalDuration =
course?.topics.reduce((acc, topic) => {
@@ -76,13 +76,16 @@ export default function CourseRoute() {
<div
className="border rounded-lg rounded-b-none px-8 py-3"
style={{
- backgroundColor: section?.background,
- color: section?.foreground,
+ backgroundColor: module?.background,
+ color: module?.foreground,
}}
>
- <div className="flex items-center justify-between gap-2">
+ <div className="flex flex-col items-start">
+ <span className="text-[10px] uppercase font-display font-bold opacity-80">
+ Section
+ </span>
<span className="uppercase text-sm font-display font-bold">
- {section?.name}
+ {module?.name}
</span>
</div>
</div>
@@ -92,8 +95,8 @@ export default function CourseRoute() {
<div
className="flex-shrink-0 size-12 text-2xl p-3 rounded-lg"
style={{
- backgroundColor: section?.background,
- color: section?.foreground,
+ backgroundColor: module?.background,
+ color: module?.foreground,
}}
>
{course.icon}
@@ -165,7 +168,7 @@ export default function CourseRoute() {
</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-4 py-8 w-full text-sm">
<div className="flex flex-col gap-0">
{topic.lessons.map((lesson) => {
const isCompleted = completedLessons.includes(lesson.id);
@@ -177,9 +180,9 @@ export default function CourseRoute() {
>
<div className="flex items-center gap-2">
{isCompleted ? (
- <LuCircleCheck className="size-4 text-emerald-500" />
+ <LuCircleCheck className="size-4 flex-shrink-0 text-emerald-500" />
) : (
- <LuCirclePlay className="size-4 text-muted-foreground" />
+ <LuCirclePlay className="size-4 flex-shrink-0 text-muted-foreground" />
)}
<span>{lesson.name}</span>
</div>
@@ -195,7 +198,7 @@ export default function CourseRoute() {
<Button
variant="primary"
leftIcon={
- <LuCircleCheck className="size-4 text-emerald-500" />
+ <LuCircleCheck className="size-4 flex-shrink-0 text-emerald-500" />
}
>
Topic Challenge Completed
@@ -224,6 +227,37 @@ export default function CourseRoute() {
</Button>
)
) : null}
+ {topic.supplemental && topic.supplemental.length > 0 && (
+ <div className="flex flex-col gap-0">
+ <h3 className="text-[10px] uppercase font-display font-bold text-muted-foreground">
+ Supplemental Videos
+ </h3>
+ {topic.supplemental?.map((lesson) => {
+ const isCompleted = completedLessons.includes(
+ lesson.id
+ );
+ return (
+ <Link
+ key={lesson.id}
+ to={path.to.lesson(lesson.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">
+ {isCompleted ? (
+ <LuCircleCheck className="size-4 flex-shrink-0 text-emerald-500" />
+ ) : (
+ <LuCirclePlay className="size-4 flex-shrink-0 text-muted-foreground" />
+ )}
+ <span>{lesson.name}</span>
+ </div>
+ <span className="text-muted-foreground text-xs">
+ {formatDuration(lesson.duration)}
+ </span>
+ </Link>
+ );
+ })}
+ </div>
+ )}
</div>
</div>
</div>
diff --git a/apps/university/app/routes/course+/_layout.tsx b/apps/university/app/routes/course+/_layout.tsx
index 3e9806d392..f838bdf292 100644
--- a/apps/university/app/routes/course+/_layout.tsx
+++ b/apps/university/app/routes/course+/_layout.tsx
@@ -2,7 +2,7 @@ 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 { modules } from "~/config";
import { useOptionalUser } from "~/hooks/useUser";
import { path } from "~/utils/path";
@@ -31,7 +31,7 @@ export default function CourseLayout() {
>
<Link
to={path.to.lesson(
- sections[0].courses[0].topics[0].lessons[0].id
+ modules[0].courses[0].topics[0].lessons[0].id
)}
>
Begin your first lesson
@@ -49,21 +49,21 @@ export default function CourseLayout() {
</Hero>
)}
<div className="w-full px-4 max-w-5xl mx-auto my-16">
- <div className="grid grid-cols-1 md:grid-cols-[250px_1fr] gap-6">
+ <div className="grid grid-cols-1 md:grid-cols-[220px_1fr] gap-6">
<nav className="space-y-4">
- {sections.map((section) => (
- <div key={section.id} className="space-y-2">
+ {modules.map((module) => (
+ <div key={module.id} className="space-y-2">
<h3
className="font-display font-bold uppercase text-xs"
- style={{ color: section.background }}
+ style={{ color: module.background }}
>
- {section.name}
+ {module.name}
</h3>
<div className="space-y-0">
- {section.courses.map((course) => (
+ {module.courses.map((course) => (
<Link
key={course.id}
- to={path.to.course(section.id, course.id)}
+ to={path.to.course(module.id, course.id)}
className="block py-1 text-sm hover:underline"
>
{course.name}
diff --git a/apps/university/app/routes/lesson+/$id.tsx b/apps/university/app/routes/lesson+/$id.tsx
index ae65c38e3e..9cf3e1a26f 100644
--- a/apps/university/app/routes/lesson+/$id.tsx
+++ b/apps/university/app/routes/lesson+/$id.tsx
@@ -96,7 +96,7 @@ export default function LessonRoute() {
throw new Error("Lesson not found");
}
- const { section, course, topic, lesson } = context;
+ const { module, course, topic, lesson } = context;
const nextLesson = getNextLesson(id);
const previousLesson = getPreviousLesson(id);
const hasChallenge = topic.challenge && topic.challenge.length > 0;
@@ -140,7 +140,7 @@ export default function LessonRoute() {
className="mr-2"
asChild
>
- <Link to={path.to.course(section.id, course.id)}>Back to course</Link>
+ <Link to={path.to.course(module.id, course.id)}>Back to course</Link>
</Button>
<Button
@@ -148,7 +148,7 @@ export default function LessonRoute() {
className="text-sm text-muted-foreground"
asChild
>
- <Link to={path.to.course(section.id, course.id)}>{course.name}</Link>
+ <Link to={path.to.course(module.id, course.id)}>{course.name}</Link>
</Button>
<span className="text-muted-foreground text-sm">/</span>
@@ -170,7 +170,7 @@ export default function LessonRoute() {
<div
className="w-full h-12 rounded-b-lg flex items-center justify-end gap-2 px-3"
style={{
- backgroundColor: section.background,
+ backgroundColor: module.background,
}}
>
<Button
@@ -193,8 +193,8 @@ export default function LessonRoute() {
<div
className="border rounded-lg rounded-b-none p-4"
style={{
- backgroundColor: section?.background,
- color: section?.foreground,
+ backgroundColor: module?.background,
+ color: module?.foreground,
}}
>
<div className="flex flex-col gap-4">
@@ -202,7 +202,7 @@ export default function LessonRoute() {
<div
className="flex-shrink-0 size-12 text-2xl p-3 rounded-lg bg-black/20"
style={{
- color: section?.foreground,
+ color: module?.foreground,
}}
>
{course.icon}
@@ -281,9 +281,9 @@ export default function LessonRoute() {
>
<div className="flex items-center gap-2">
{isCompleted ? (
- <LuCircleCheck className="size-4 text-emerald-500" />
+ <LuCircleCheck className="size-4 flex-shrink-0 text-emerald-500" />
) : (
- <LuCirclePlay className="size-4 text-muted-foreground" />
+ <LuCirclePlay className="size-4 flex-shrink-0 text-muted-foreground" />
)}
<span
className={
@@ -305,7 +305,9 @@ export default function LessonRoute() {
isChallengeCompleted ? (
<Button
variant="primary"
- leftIcon={<LuCircleCheck className="size-4 text-emerald-500" />}
+ leftIcon={
+ <LuCircleCheck className="size-4 flex-shrink-0 text-emerald-500" />
+ }
>
Topic Challenge Completed
</Button>
diff --git a/apps/university/app/styles/docs.css b/apps/university/app/styles/docs.css
index c0bda68f30..432059e06e 100644
--- a/apps/university/app/styles/docs.css
+++ b/apps/university/app/styles/docs.css
@@ -182,39 +182,39 @@
max-width: 50%;
}
-.Docs .doc-section {
+.Docs .doc-module {
display: flex;
border-bottom-width: 1px;
--tw-border-opacity: 1;
border-color: hsl(var(--border) / var(--tw-border-opacity));
}
-.Docs.Docs--table-editor .doc-section--introduction .text {
+.Docs.Docs--table-editor .doc-module--introduction .text {
width: 85%;
}
-.Docs.Docs--table-editor .doc-section--client-libraries {
+.Docs.Docs--table-editor .doc-module--client-libraries {
flex-direction: column;
margin-bottom: 40px;
}
-.Docs.Docs--table-editor .doc-section--client-libraries .code,
-.Docs.Docs--table-editor .doc-section--client-libraries .text {
+.Docs.Docs--table-editor .doc-module--client-libraries .code,
+.Docs.Docs--table-editor .doc-module--client-libraries .text {
width: 100%;
max-width: none;
}
-.Docs.Docs--table-editor .doc-section--client-libraries .code {
+.Docs.Docs--table-editor .doc-module--client-libraries .code {
margin-bottom: 20px;
}
-.Docs .doc-section article:first-child {
+.Docs .doc-module article:first-child {
color: var(--tw-prose-body);
max-width: 65ch;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(p):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.25em;
@@ -223,7 +223,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where([class~="lead"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -236,7 +236,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(a):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
text-decoration: underline;
@@ -252,7 +252,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(strong):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-bold);
@@ -260,14 +260,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(a strong):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: inherit;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(blockquote strong):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -276,7 +276,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(thead th strong):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -285,7 +285,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
list-style-type: none;
@@ -296,7 +296,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="A"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -305,7 +305,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="a"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -314,7 +314,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="A s"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -323,7 +323,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="a s"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -332,7 +332,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="I"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -341,7 +341,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="i"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -350,7 +350,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="I s"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -359,7 +359,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="i s"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -368,7 +368,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol[type="1"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -377,7 +377,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
list-style-type: none;
@@ -387,7 +387,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol > li):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -397,7 +397,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul > li):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -406,7 +406,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(dt):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-headings);
@@ -415,7 +415,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(hr):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
border-color: var(--tw-prose-hr);
@@ -425,7 +425,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(blockquote):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-weight: 500;
@@ -440,7 +440,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(blockquote p:first-of-type):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -449,7 +449,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(blockquote p:last-of-type):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -458,7 +458,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h1):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-headings);
@@ -469,7 +469,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h1 strong):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-weight: 900;
@@ -477,7 +477,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h2):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-headings);
@@ -489,7 +489,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h2 strong):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-weight: 800;
@@ -497,7 +497,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h3):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-headings);
@@ -509,7 +509,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h3 strong):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-weight: 700;
@@ -517,7 +517,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h4):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-headings);
@@ -529,7 +529,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h4 strong):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-weight: 700;
@@ -537,7 +537,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(img):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 2em;
@@ -545,7 +545,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(picture):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
display: block;
@@ -554,7 +554,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(kbd):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-weight: 500;
@@ -567,7 +567,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-code);
@@ -580,7 +580,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(code):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -589,28 +589,28 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)):after {
content: "";
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(a code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: inherit;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h1 code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: inherit;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h2 code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: inherit;
@@ -618,7 +618,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h3 code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: inherit;
@@ -626,14 +626,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h4 code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: inherit;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(blockquote code):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -642,7 +642,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(thead th code):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -651,7 +651,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(pre):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-pre-code);
@@ -668,7 +668,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(pre code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
background-color: transparent;
@@ -683,7 +683,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(pre code):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -692,7 +692,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(pre code):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -701,7 +701,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(table):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
width: 100%;
@@ -714,7 +714,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(thead):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
border-bottom-width: 1px;
@@ -722,7 +722,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(thead th):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--tw-prose-headings);
@@ -734,7 +734,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tbody tr):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
border-bottom-width: 1px;
@@ -742,7 +742,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tbody tr:last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -751,14 +751,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tbody td):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
vertical-align: baseline;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tfoot):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
border-top-width: 1px;
@@ -766,14 +766,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tfoot td):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
vertical-align: top;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figcaption):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: hsl(var(--muted-foreground));
@@ -783,7 +783,7 @@
font-family: Office Code Pro, monospace;
}
-.Docs .doc-section article:first-child {
+.Docs .doc-module article:first-child {
--tw-prose-links: hsl(var(--foreground));
--tw-prose-kbd: #111827;
--tw-prose-kbd-shadows: 17 24 39;
@@ -799,7 +799,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(video):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 2em;
@@ -807,7 +807,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0.5em;
@@ -815,21 +815,21 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol > li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
padding-left: 0.375em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul > li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
padding-left: 0.375em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ul > li p):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -839,7 +839,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ul > li > :first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -848,7 +848,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ul > li > :last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -857,7 +857,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ol > li > :first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -866,7 +866,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ol > li > :last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -875,7 +875,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul ul, ul ol, ol ul, ol ol):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -885,7 +885,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(dl):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.25em;
@@ -893,7 +893,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(dd):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0.5em;
@@ -901,7 +901,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tbody td, tfoot td):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -910,14 +910,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figure):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin: 3rem 0;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > :first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -926,7 +926,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > :last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -935,14 +935,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h5):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--colors-scale12);
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h1, h2, h3, h4, h5, h6):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -951,7 +951,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(article h2, article h3, article h4, article h5, article h6):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -961,14 +961,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
position: relative;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul li):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -984,7 +984,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol > li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
display: block;
@@ -993,7 +993,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol > li):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1016,7 +1016,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(p img):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
border: 1px solid hsl(var(--border));
@@ -1025,7 +1025,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(iframe):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
border: 1px solid hsl(var(--border) / 0.9);
@@ -1033,20 +1033,20 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(td):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
border-bottom: 1px solid hsl(var(--muted));
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(a:hover):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figure.quote-figure p:first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1055,7 +1055,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figure.quote-figure p:last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1064,19 +1064,19 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figure img):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin: 0;
}
-.Docs .doc-section article:first-child {
+.Docs .doc-module article:first-child {
font-size: 0.875rem;
line-height: 1.7142857;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(p):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.1428571em;
@@ -1084,7 +1084,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where([class~="lead"]):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1096,7 +1096,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(blockquote):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.3333333em;
@@ -1105,7 +1105,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h1):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 2.1428571em;
@@ -1115,7 +1115,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h2):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 1.4285714em;
@@ -1125,7 +1125,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h3):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 1.2857143em;
@@ -1135,7 +1135,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h4):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.4285714em;
@@ -1144,7 +1144,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(img):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.7142857em;
@@ -1152,7 +1152,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(picture):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.7142857em;
@@ -1160,7 +1160,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(picture > img):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1170,7 +1170,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(video):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.7142857em;
@@ -1178,7 +1178,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(kbd):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 0.8571429em;
@@ -1187,28 +1187,28 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 0.8571429em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h2 code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 0.9em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h3 code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 0.8888889em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(pre):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 0.8571429em;
@@ -1220,7 +1220,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.1428571em;
@@ -1229,7 +1229,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.1428571em;
@@ -1238,7 +1238,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0.2857143em;
@@ -1246,21 +1246,21 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ol > li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
padding-left: 0.4285714em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul > li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
padding-left: 0.4285714em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ul > li p):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1270,7 +1270,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ul > li > :first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1279,7 +1279,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ul > li > :last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1288,7 +1288,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ol > li > :first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1297,7 +1297,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > ol > li > :last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1306,7 +1306,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(ul ul, ul ol, ol ul, ol ol):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1316,7 +1316,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(dl):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.1428571em;
@@ -1324,14 +1324,14 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(dt):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.1428571em;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(dd):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0.2857143em;
@@ -1339,7 +1339,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(hr):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 2.8571429em;
@@ -1347,35 +1347,35 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(hr + *):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h2 + *):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h3 + *):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h4 + *):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0;
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(table):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 0.8571429em;
@@ -1383,7 +1383,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(thead th):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
padding-right: 1em;
@@ -1392,7 +1392,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(thead th:first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1401,7 +1401,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(thead th:last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1410,7 +1410,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tbody td, tfoot td):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1419,7 +1419,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tbody td:first-child, tfoot td:first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1428,7 +1428,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(tbody td:last-child, tfoot td:last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1437,7 +1437,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figure):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.7142857em;
@@ -1445,7 +1445,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figure > *):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0;
@@ -1453,7 +1453,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(figcaption):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
font-size: 0.8571429em;
@@ -1462,7 +1462,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > :first-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1471,7 +1471,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(.prose > :last-child):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1479,7 +1479,7 @@
margin-bottom: 0;
}
-.Docs .doc-section article:first-child {
+.Docs .doc-module article:first-child {
--tw-prose-body: hsl(var(--foreground));
--tw-prose-headings: hsl(var(--foreground));
--tw-prose-lead: hsl(var(--foreground));
@@ -1510,7 +1510,7 @@
}
.Docs
- .doc-section
+ .doc-module
article:first-child
:where(h1, h2, h3, h4, h5):not(
:where([class~="not-prose"], [class~="not-prose"] *)
@@ -1518,11 +1518,11 @@
font-weight: 400;
}
-.Docs .doc-section article:first-child {
+.Docs .doc-module article:first-child {
max-width: none;
}
-.Docs.Docs--table-editor .doc-section__table-name {
+.Docs.Docs--table-editor .doc-module__table-name {
margin-top: 1rem;
}
diff --git a/apps/university/app/utils/path.ts b/apps/university/app/utils/path.ts
index 039facb392..9afc52e77e 100644
--- a/apps/university/app/utils/path.ts
+++ b/apps/university/app/utils/path.ts
@@ -13,8 +13,8 @@ export const path = {
accountSettings: `${ERP_URL}/x/account`,
callback: "/callback",
challenge: (topicId: string) => generatePath(`${challenge}/${topicId}`),
- course: (sectionId: string, courseId: string) =>
- generatePath(`${course}/${sectionId}/${courseId}`),
+ course: (moduleId: string, courseId: string) =>
+ generatePath(`${course}/${moduleId}/${courseId}`),
dashboard: `${ERP_URL}/x`,
healthcheck: "/healthcheck",
login: "/login",
diff --git a/apps/university/app/utils/video.ts b/apps/university/app/utils/video.ts
index 195e908f46..883622218c 100644
--- a/apps/university/app/utils/video.ts
+++ b/apps/university/app/utils/video.ts
@@ -1,4 +1,4 @@
-import { sections } from "~/config";
+import { modules } from "~/config";
export function formatDuration(duration: number) {
const minutes = Math.floor(duration / 60);
@@ -7,14 +7,14 @@ export function formatDuration(duration: number) {
}
export function findTopicContext(topicId: string) {
- for (const section of sections) {
- for (const course of section.courses) {
+ for (const module of modules) {
+ for (const course of module.courses) {
const topic = course.topics.find(
(topic: { id: string }) => topic.id === topicId
);
if (topic) {
return {
- section,
+ module,
course,
topic,
};
@@ -25,15 +25,15 @@ export function findTopicContext(topicId: string) {
}
export function getLessonContext(lessonId: string) {
- for (const section of sections) {
- for (const course of section.courses) {
+ for (const module of modules) {
+ for (const course of module.courses) {
for (const topic of course.topics) {
const lesson = topic.lessons.find(
(lesson: { id: string }) => lesson.id === lessonId
);
if (lesson) {
return {
- section,
+ module,
course,
topic,
lesson,
diff --git a/apps/university/public/victory.mp3 b/apps/university/public/victory.mp3
new file mode 100644
index 0000000000..fdfa4d4a45
Binary files /dev/null and b/apps/university/public/victory.mp3 differ
diff --git a/packages/database/supabase/migrations/20250629172232_univeristy-fixes.sql b/packages/database/supabase/migrations/20250629172232_univeristy-fixes.sql
new file mode 100644
index 0000000000..9915c5fa35
--- /dev/null
+++ b/packages/database/supabase/migrations/20250629172232_univeristy-fixes.sql
@@ -0,0 +1,7 @@
+-- Add unique constraint to lessonCompletion to prevent duplicate completions
+ALTER TABLE "lessonCompletion"
+ADD CONSTRAINT "unique_lesson_completion" UNIQUE ("userId", "courseId", "lessonId");
+
+-- Add unique constraint to challengeAttempt to prevent multiple passed attempts
+CREATE UNIQUE INDEX "unique_passed_challenge" ON "challengeAttempt" ("userId", "courseId", "topicId")
+WHERE passed = true;