+
+
+
+

-
-
-
-
What's your main goal today?
-
- This will help us personalize your experience on Classroomio
-
-
-
-
- {#each roles as role, index}
-
- {/each}
-
- {#if errors.role}
-
{errors.role}
- {/if}
-
+
ClassroomIO
- {:else}
-
-
-
-
-
-
-
-
-
-
-
- {#if step > 1}
-
(step = step - 1)}
- />
{/if}
-
+
+
+
+
+
+
+
+
+
+ {#if step > 1}
+
(step = step - 1)}
+ />
+ {/if}
+
+
-
+{/if}
diff --git a/src/routes/org/[slug]/index.svelte b/src/routes/org/[slug]/index.svelte
new file mode 100644
index 00000000..e02f416e
--- /dev/null
+++ b/src/routes/org/[slug]/index.svelte
@@ -0,0 +1,398 @@
+
+
+
+
+
+ Dashboard - ClassroomIO
+
+
+
+
+
+
+ {#each boxes as box}
+
+
{box.label}
+
{box.value}
+
+ {/each}
+
+
+
+
+
+
Your Schedule
+
+ {#if !$isMobile}
+
+
+
+ {/if}
+
+ {#if $isMobile}
+
+ {:else}
+
+ {formatDate($store?.selected)}
+
+ {/if}
+
+ {#each selectedDateLessonData as lessonData}
+
+ {:else}
+
+ No lesson on this day
+
+ {/each}
+
+
+
+
+
+
Your Activities
+
+ {#each activities as activity}
+
+
+
+
+
{activity.name}
+
+ {activity.description}
+
+
View
+
+
+
+
+
+ {/each}
+
+
+
+
+
+
diff --git a/src/routes/org/[slug]/settings.svelte b/src/routes/org/[slug]/settings.svelte
new file mode 100644
index 00000000..a01c11a4
--- /dev/null
+++ b/src/routes/org/[slug]/settings.svelte
@@ -0,0 +1 @@
+settings
diff --git a/src/routes/org/[slug]/site.svelte b/src/routes/org/[slug]/site.svelte
new file mode 100644
index 00000000..c3a68fa6
--- /dev/null
+++ b/src/routes/org/[slug]/site.svelte
@@ -0,0 +1 @@
+Sites Page
diff --git a/src/utils/functions/getCurrencyFormatter.ts b/src/utils/functions/getCurrencyFormatter.ts
new file mode 100644
index 00000000..3603fcec
--- /dev/null
+++ b/src/utils/functions/getCurrencyFormatter.ts
@@ -0,0 +1,7 @@
+export default (currency: string | undefined) => {
+ return new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: currency,
+ minimumFractionDigits: 2,
+ });
+};
diff --git a/src/utils/functions/org.js b/src/utils/functions/org.js
new file mode 100644
index 00000000..e69de29b
diff --git a/src/utils/functions/validator.js b/src/utils/functions/validator.js
index 17a0f8b9..2c579f71 100644
--- a/src/utils/functions/validator.js
+++ b/src/utils/functions/validator.js
@@ -28,10 +28,8 @@ const resetValidationSchema = z.object({
const onboardingValidationSchema = {
stepOne: z.object({
fullname: z.string().min(1, { message: 'Enter your fullname' }),
- role: z.string({
- required_error: 'Please select a goal',
- invalid_type_error: 'Please select a goal',
- }),
+ orgName: z.string().min(1, { message: 'Enter your organisation name' }),
+ siteName: z.string().min(1, { message: 'Enter your site name' }),
}),
stepTwo: z.object({
goal: z
diff --git a/src/utils/services/org/index.js b/src/utils/services/org/index.js
new file mode 100644
index 00000000..e2bde4cd
--- /dev/null
+++ b/src/utils/services/org/index.js
@@ -0,0 +1,39 @@
+import { supabase } from '../../functions/supabase';
+import { orgs, currentOrg } from '../../store/org';
+
+export async function getOrganizations(userId) {
+ const { data, error } = await supabase
+ .from('organizationmember')
+ .select(
+ `
+ id,
+ profile_id,
+ organization (
+ id,
+ name,
+ siteName
+ )
+ `
+ )
+ .eq('profile_id', userId);
+
+ const orgsArray = [];
+ if (data.length) {
+ data.forEach((orgMember) => {
+ orgsArray.push({
+ id: orgMember?.organization?.id,
+ name: orgMember?.organization?.name,
+ siteName: orgMember?.organization?.siteName,
+ });
+ });
+
+ orgs.set(orgsArray);
+ currentOrg.set(orgsArray[0]);
+ }
+
+ return {
+ orgs: orgsArray,
+ currentOrg: orgsArray[0],
+ error,
+ };
+}
diff --git a/src/utils/store/org.js b/src/utils/store/org.js
new file mode 100644
index 00000000..bc0e88e7
--- /dev/null
+++ b/src/utils/store/org.js
@@ -0,0 +1,4 @@
+import { writable } from 'svelte/store';
+
+export const orgs = writable([]);
+export const currentOrg = writable({});
diff --git a/static/images/classroomio-course-img-template.jpg b/static/images/classroomio-course-img-template.jpg
new file mode 100644
index 00000000..b8fe4e4a
Binary files /dev/null and b/static/images/classroomio-course-img-template.jpg differ
diff --git a/supabase/.gitignore b/supabase/.gitignore
new file mode 100644
index 00000000..773c7c3e
--- /dev/null
+++ b/supabase/.gitignore
@@ -0,0 +1,3 @@
+# Supabase
+.branches
+.temp
diff --git a/supabase/config.toml b/supabase/config.toml
new file mode 100644
index 00000000..c208a647
--- /dev/null
+++ b/supabase/config.toml
@@ -0,0 +1,71 @@
+# A string used to distinguish different Supabase projects on the same host. Defaults to the working
+# directory name when running `supabase init`.
+project_id = "classroomio"
+
+[api]
+# Port to use for the API URL.
+port = 54321
+# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
+# endpoints. public and storage are always included.
+schemas = []
+# Extra schemas to add to the search_path of every request.
+extra_search_path = ["extensions"]
+# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
+# for accidental or malicious requests.
+max_rows = 1000
+
+[db]
+# Port to use for the local database URL.
+port = 54322
+# The database major version to use. This has to be the same as your remote database's. Run `SHOW
+# server_version;` on the remote database to check.
+major_version = 12
+
+[studio]
+# Port to use for Supabase Studio.
+port = 54323
+
+# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
+# are monitored, and you can view the emails that would have been sent from the web interface.
+[inbucket]
+# Port to use for the email testing server web interface.
+port = 54324
+smtp_port = 54325
+pop3_port = 54326
+
+[storage]
+# The maximum file size allowed (e.g. "5MB", "500KB").
+file_size_limit = "50MiB"
+
+[auth]
+# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
+# in emails.
+site_url = "http://localhost:3000"
+# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
+additional_redirect_urls = ["https://localhost:3000"]
+# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 seconds (one
+# week).
+jwt_expiry = 3600
+# Allow/disallow new user signups to your project.
+enable_signup = true
+
+[auth.email]
+# Allow/disallow new user signups via email to your project.
+enable_signup = true
+# If enabled, a user will be required to confirm any email change on both the old, and new email
+# addresses. If disabled, only the new email is required to confirm.
+double_confirm_changes = true
+# If enabled, users need to confirm their email address before signing in.
+enable_confirmations = false
+
+# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
+# `discord`, `facebook`, `github`, `gitlab`, `google`, `twitch`, `twitter`, `slack`, `spotify`.
+[auth.external.apple]
+enabled = false
+client_id = ""
+secret = ""
+# Overrides the default auth redirectUrl.
+redirect_uri = ""
+# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
+# or any other third-party OIDC providers.
+url = ""
diff --git a/supabase/seed.sql b/supabase/seed.sql
new file mode 100644
index 00000000..e69de29b