From ee4abde45ac774a8171334fa0f2be643d8ae25ac Mon Sep 17 00:00:00 2001 From: Charmunks Date: Sun, 2 Nov 2025 11:26:05 -0500 Subject: [PATCH] shitty ui (arnav will make actually good) --- client/index.html | 4 +- client/src/App.svelte | 140 ++++--- client/src/config.js | 12 + client/src/lib/Auth.svelte | 333 +++++++++++++++++ client/src/lib/Dashboard.svelte | 601 ++++++++++++++++++++++++++++++ client/example.env => example.env | 4 +- 6 files changed, 1042 insertions(+), 52 deletions(-) create mode 100644 client/src/config.js create mode 100644 client/src/lib/Auth.svelte create mode 100644 client/src/lib/Dashboard.svelte rename client/example.env => example.env (61%) diff --git a/client/index.html b/client/index.html index 26c29c4..5f028f0 100644 --- a/client/index.html +++ b/client/index.html @@ -4,10 +4,10 @@ - Vite + Svelte + Hack Club Spaces
- + \ No newline at end of file diff --git a/client/src/App.svelte b/client/src/App.svelte index 0b8ccb1..b2961b3 100644 --- a/client/src/App.svelte +++ b/client/src/App.svelte @@ -1,63 +1,105 @@
-
- - - - - - -
-

Vite + Svelte

- - {#if emojisList} -
- -
+ {#if isAuthenticated && user} + + {:else} + {/if} - -

- Check out SvelteKit, the official Svelte app framework powered by Vite! -

- -

- Click on the Vite and Svelte logos to learn more -

+ \ No newline at end of file diff --git a/client/src/config.js b/client/src/config.js new file mode 100644 index 0000000..4acc3ae --- /dev/null +++ b/client/src/config.js @@ -0,0 +1,12 @@ +export const API_BASE = import.meta.env.API_URL || 'http://localhost:3000/api/v1'; + +export const ERROR_MESSAGES = { + NETWORK_ERROR: 'Network error. Please try again.', + AUTH_FAILED: 'Authentication failed', + INVALID_EMAIL: 'Invalid email format', + INVALID_CODE: 'Invalid or expired verification code', + CREATE_FAILED: 'Failed to create space', + START_FAILED: 'Failed to start space', + STOP_FAILED: 'Failed to stop space', + STATUS_FAILED: 'Failed to get status', +}; \ No newline at end of file diff --git a/client/src/lib/Auth.svelte b/client/src/lib/Auth.svelte new file mode 100644 index 0000000..844b8d5 --- /dev/null +++ b/client/src/lib/Auth.svelte @@ -0,0 +1,333 @@ + + +
+
+

Hack Club Spaces

+ + {#if mode === 'login' || mode === 'signup'} +
+ + +
+ +
+
+ + +
+ + {#if mode === 'signup'} +
+ + +
+ {/if} + + {#if error} +
{error}
+ {/if} + + {#if message} +
{message}
+ {/if} + + +
+ {:else if mode === 'verify'} +

Check your email for the verification code

+ +
+
+ + +
+ + {#if error} +
{error}
+ {/if} + + + + +
+ {/if} +
+
+ + \ No newline at end of file diff --git a/client/src/lib/Dashboard.svelte b/client/src/lib/Dashboard.svelte new file mode 100644 index 0000000..9c480c1 --- /dev/null +++ b/client/src/lib/Dashboard.svelte @@ -0,0 +1,601 @@ + + +
+
+
+

Hack Club Spaces

+

Welcome, {username}!

+
+ +
+ +
+
+ + +
+ + {#if showCreateForm} +
+

Create New Space

+ +
+ + +
+ +
+ + +
+ + {#if error} +
{error}
+ {/if} + + +
+ {/if} + +
+

Your Spaces

+ + {#if spaces.length === 0} +
+

No spaces yet. Create your first space to get started!

+
+ {:else} +
+ {#each spaces as space} +
+
+

{space.type}

+ + {space.status || 'Unknown'} + +
+ +
+

Space ID: {space.id}

+ {#if space.url} +

URL: + + {space.url} + +

+ {/if} +

Created: {new Date(space.created_at).toLocaleString()}

+
+ + {#if actionError[space.id]} +
{actionError[space.id]}
+ {/if} + +
+ {#if actionLoading[space.id]} + + {:else} + {#if space.status?.toLowerCase() === 'running'} + + {#if space.url} + + Open + + {/if} + {:else} + + {/if} + + {/if} +
+
+ {/each} +
+ {/if} +
+
+
+ + \ No newline at end of file diff --git a/client/example.env b/example.env similarity index 61% rename from client/example.env rename to example.env index f4e2a81..ea1b6fb 100644 --- a/client/example.env +++ b/example.env @@ -2,4 +2,6 @@ PG_CONNECTION_STRING=your-postgres-db-url AIRTABLE_API_KEY=your-airtable-pat AIRTABLE_BASE_ID=your=airtable-baseid PORT=3000 -DOCKER=false \ No newline at end of file +DOCKER=false +API_URL=http://localhost:3000/api/v1 +SERVER_URL=http://localhost \ No newline at end of file