diff --git a/ai/prompts/lms-context.md b/ai/prompts/lms-context.md new file mode 100644 index 00000000..0c670219 --- /dev/null +++ b/ai/prompts/lms-context.md @@ -0,0 +1,12 @@ +# Prompt + +This prompt is used to give any AI chat bot context about ClassroomIO + +```txt +I am building a LMS for teachers and students to collaborate on a course. Students can enroll in a course or be giving access to a course. Teachers can be invited into an org by an admin to create courses and manage students. For auth we support Email/Password and Google. + +The tech stack is +- Sveltekit - dashboard (teacher view) and lms (student view) +- Supabase - Auth, DB requests, Storage +- Hono - API for long running processes like video uploads +``` diff --git a/apps/dashboard/src/hooks.server.ts b/apps/dashboard/src/hooks.server.ts index 7f920834..55f237cc 100644 --- a/apps/dashboard/src/hooks.server.ts +++ b/apps/dashboard/src/hooks.server.ts @@ -1,7 +1,7 @@ import type { Handle } from '@sveltejs/kit'; import { validateUser } from '$lib/utils/services/middlewares'; -const PUBLIC_ROUTES = [ +const PUBLIC_API_ROUTES = [ '/api/completion', 'student_prove_payment', 'teacher_student_buycourse', @@ -11,7 +11,7 @@ const PUBLIC_ROUTES = [ ]; function isPublicRoute(pathname: string) { - return PUBLIC_ROUTES.some((route) => pathname.includes(route)); + return PUBLIC_API_ROUTES.some((route) => pathname.includes(route)); } export const handle: Handle = async ({ event, resolve }) => { diff --git a/apps/dashboard/src/lib/components/CourseLandingPage/components/PricingSection.svelte b/apps/dashboard/src/lib/components/CourseLandingPage/components/PricingSection.svelte index 0d2a9a38..98b96859 100644 --- a/apps/dashboard/src/lib/components/CourseLandingPage/components/PricingSection.svelte +++ b/apps/dashboard/src/lib/components/CourseLandingPage/components/PricingSection.svelte @@ -2,8 +2,11 @@ import get from 'lodash/get'; import PrimaryButton from '$lib/components/PrimaryButton/index.svelte'; import getCurrencyFormatter from '$lib/utils/functions/getCurrencyFormatter'; - import { isCourseFree } from '$lib/utils/functions/course'; - import { getStudentInviteLink } from '$lib/utils/functions/course'; + import { + isCourseFree, + getStudentInviteLink, + calcCourseDiscount + } from '$lib/utils/functions/course'; import { currentOrg, currentOrgDomain } from '$lib/utils/store/org'; import { goto } from '$app/navigation'; import HtmlRender from '$lib/components/HTMLRender/HTMLRender.svelte'; @@ -12,7 +15,6 @@ import { ROLE } from '$lib/utils/constants/roles'; import { capturePosthogEvent } from '$lib/utils/services/posthog'; import { t } from '$lib/utils/functions/translations'; - import { calcCourseDiscount } from '$lib/utils/functions/course'; interface Props { className?: string; @@ -48,8 +50,10 @@ course_cost: courseData.cost, course_free: isFree }); + if (isFree) { const link = getStudentInviteLink(courseData, $currentOrg.siteName, $currentOrgDomain); + goto(link); } else { openModal = true; diff --git a/apps/dashboard/src/lib/components/Org/ProfileMenu/Menu.svelte b/apps/dashboard/src/lib/components/Org/ProfileMenu/Menu.svelte index 47513632..d828bc6e 100644 --- a/apps/dashboard/src/lib/components/Org/ProfileMenu/Menu.svelte +++ b/apps/dashboard/src/lib/components/Org/ProfileMenu/Menu.svelte @@ -1,7 +1,7 @@