diff --git a/package-lock.json b/package-lock.json index c1f8d17..d65d15c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.1", "dependencies": { "@astrojs/sitemap": "^3.7.2", + "@supabase/supabase-js": "^2.105.1", "astro": "^5.15.9", "gsap": "^3.14.2", "lucide-astro": "^0.556.0", @@ -1449,6 +1450,92 @@ "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", "license": "MIT" }, + "node_modules/@supabase/auth-js": { + "version": "2.105.1", + "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.105.1.tgz", + "integrity": "sha512-zc4s8Xg4truwE1Q4Q8M8oUVDARMd05pKh73NyQsMbYU1HDdDN2iiKzena/yu+yJze3WrD4c092FdckPiK1rLQw==", + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@supabase/functions-js": { + "version": "2.105.1", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.105.1.tgz", + "integrity": "sha512-dTk1e7oE51VGc1lS2S0J0NLo0Wp4JYChj74ArJKbIWgoWuFwO0wcJYjeyOV3AAEpKst8/LQWUZOUKO1tRXBrpA==", + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@supabase/phoenix": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@supabase/phoenix/-/phoenix-0.4.1.tgz", + "integrity": "sha512-hWGJkDAfWUNY8k0C080u3sGNFd2ncl9erhKgP7hnGkgJWEfT5Pd/SXal4QmWXBECVlZrannMAc9sBaaRyWpiUA==", + "license": "MIT" + }, + "node_modules/@supabase/postgrest-js": { + "version": "2.105.1", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-2.105.1.tgz", + "integrity": "sha512-6SbtsoWC55xfsm7gbfLqvF+yIwTQEbjt+jFGf4klDpwSnUy17Hv5x0Dq52oqwTQlw6Ta0h1D5gTP0/pApqNojA==", + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@supabase/realtime-js": { + "version": "2.105.1", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.105.1.tgz", + "integrity": "sha512-3X3cUEl5cJ4lRQHr1hXHx0b98OaL97RRO2vrRZ98FD91JV/MquZHhrGJSv/+IkOnjF6E2e0RUOxE8P3Zi035ow==", + "license": "MIT", + "dependencies": { + "@supabase/phoenix": "^0.4.1", + "@types/ws": "^8.18.1", + "tslib": "2.8.1", + "ws": "^8.18.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@supabase/storage-js": { + "version": "2.105.1", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.105.1.tgz", + "integrity": "sha512-owfdCNH5ikXXDusjzsgU6LavEBqGUoueOnL/9XIucld70/WJ/rbqp89K//c9QPICDNuegsmpoeasydDAiucLKQ==", + "license": "MIT", + "dependencies": { + "iceberg-js": "^0.8.1", + "tslib": "2.8.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@supabase/supabase-js": { + "version": "2.105.1", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.105.1.tgz", + "integrity": "sha512-4gn6HmsAkCCVU7p8JmgKGhHJ5Btod4ZzSp8qKZf4JHaTxbhaIK86/usHzeLxWv7EJJDhBmILDmJOSOf9iF4CLA==", + "license": "MIT", + "dependencies": { + "@supabase/auth-js": "2.105.1", + "@supabase/functions-js": "2.105.1", + "@supabase/postgrest-js": "2.105.1", + "@supabase/realtime-js": "2.105.1", + "@supabase/storage-js": "2.105.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/@swc/helpers": { "version": "0.5.17", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", @@ -1539,6 +1626,15 @@ "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "license": "MIT" }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", @@ -2579,6 +2675,15 @@ "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", "license": "BSD-2-Clause" }, + "node_modules/iceberg-js": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/iceberg-js/-/iceberg-js-0.8.1.tgz", + "integrity": "sha512-1dhVQZXhcHje7798IVM+xoo/1ZdVfzOMIc8/rgVSijRK38EDqOJoGula9N/8ZI5RD8QTxNQtK/Gozpr+qUqRRA==", + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/import-meta-resolve": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", @@ -4890,6 +4995,27 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/ws": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz", + "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xxhash-wasm": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.1.0.tgz", diff --git a/package.json b/package.json index 461f184..73d785c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@astrojs/sitemap": "^3.7.2", + "@supabase/supabase-js": "^2.105.1", "astro": "^5.15.9", "gsap": "^3.14.2", "lucide-astro": "^0.556.0", diff --git a/src/db/supabase.ts b/src/db/supabase.ts new file mode 100644 index 0000000..043b229 --- /dev/null +++ b/src/db/supabase.ts @@ -0,0 +1,6 @@ +import { createClient } from "@supabase/supabase-js"; + +const supabaseUrl = import.meta.env.SUPABASE_URL; +const supabaseKey = import.meta.env.SUPABASE_KEY; + +export const supabase = createClient(supabaseUrl, supabaseKey); diff --git a/src/lib/content.ts b/src/lib/content.ts index 8b6770c..78238a0 100644 --- a/src/lib/content.ts +++ b/src/lib/content.ts @@ -177,6 +177,7 @@ export function getNavigationContent(city: City): NavigationContent { links: [ { text: 'Get Tickets', href: citySpecificContent[city].ticketUrl }, { text: 'Schedule', href: '/#schedule' }, + { text: 'Nomination', href: '/nomination' } ], }; } diff --git a/src/pages/api/nomination.ts b/src/pages/api/nomination.ts new file mode 100644 index 0000000..e93bfa0 --- /dev/null +++ b/src/pages/api/nomination.ts @@ -0,0 +1,28 @@ +import type { APIRoute } from "astro"; +import { supabase } from "../../db/supabase"; + +export const prerender = false; + +export const POST: APIRoute = async ({ request, redirect }) => { + const formData = await request.formData(); + + const company = formData.get("company"); + const website = formData.get("website"); + const justification = formData.get("justification"); + + console.log({ company, website, justification }); + + const { data, error } = await supabase.from("nominations").insert({ + company, + website, + justification, + }); + + console.log("SUPABASE RESULT:", { data, error }); + + if (error) { + return redirect("/nomination?success=false"); + } + + return redirect("/nomination?succes=true"); +}; diff --git a/src/pages/api/votes.ts b/src/pages/api/votes.ts new file mode 100644 index 0000000..f1fa9f0 --- /dev/null +++ b/src/pages/api/votes.ts @@ -0,0 +1,20 @@ +import type { APIRoute } from "astro"; +import { supabase } from "../../db/supabase"; + +export const prerender = false; + +export const POST: APIRoute = async ({ request, redirect }) => { + const formData = await request.formData(); + + const company = formData.get("company"); + + const { error } = await supabase.from("votes").insert({ + company, + }); + + if (error) { + return redirect("/nomination?success=false"); + } + + return redirect("/nomination?success=true"); +}; diff --git a/src/pages/nomination.astro b/src/pages/nomination.astro new file mode 100644 index 0000000..5e2307c --- /dev/null +++ b/src/pages/nomination.astro @@ -0,0 +1,57 @@ + + + + + + Nominate + + +
+
+

2026 Canadian Cloud Award

+

Vote for oustanding Canadian tech companies that drive community impact, foster growth and showcase innovation through cloud technology. Professional services are excluded

+

The winning company will be recognized at the Cloud Summit 2026 event!

+
+
+
+
+
+
+

Nominate a Local Canadian Tech Company

+

Know a great local company that deserves recognition? Let us know!

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+

Vote for Your Favourite Local Tech Company

+

Cast your vote for your favourite company

+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 8bf91d3..cb655f3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,8 @@ { "extends": "astro/tsconfigs/strict", "include": [".astro/types.d.ts", "**/*"], - "exclude": ["dist"] + "exclude": ["dist"], + "compilerOptions": { + "types": ["astro/client"] + } }