Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions src/db/supabase.ts
Original file line number Diff line number Diff line change
@@ -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);
1 change: 1 addition & 0 deletions src/lib/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
],
};
}
Expand Down
28 changes: 28 additions & 0 deletions src/pages/api/nomination.ts
Original file line number Diff line number Diff line change
@@ -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");
};
20 changes: 20 additions & 0 deletions src/pages/api/votes.ts
Original file line number Diff line number Diff line change
@@ -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");
};
57 changes: 57 additions & 0 deletions src/pages/nomination.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nominate</title>
</head>
<body>
<header>
<hgroup>
<h1>2026 Canadian Cloud Award</h1>
<p>Vote for oustanding Canadian tech companies that drive community impact, foster growth and showcase innovation through cloud technology. Professional services are excluded</p>
<p>The winning company will be recognized at the Cloud Summit 2026 event!</p>
</hgroup>
</header>
<main>
<section>
<form method="post" action="/api/nomination">
<hgroup>
<h2>Nominate a Local Canadian Tech Company</h2>
<p>Know a great local company that deserves recognition? Let us know!</p>
</hgroup>
<div>
<label for="company">Company Name</label>
<input type="text" name="company" id="company" placeholder="e.g Cloudflare" required>
</div>
<div>
<label for="website">Company Website</label>
<input type="text" name="website" id="website" placeholder="e.g https://cloudflare.com" required>
</div>
<div>
<label for="justification">Why should this company be included?</label>
<textarea name="justification" id="justification" placeholder="Tell us why this company would be a valuable addition..."></textarea>
</div>
<button type="submit">Submit Nomination</button>
</form>
</section>
<section>
<form method="post" action="/api/votes">
<hgroup>
<h2>Vote for Your Favourite Local Tech Company</h2>
<p>Cast your vote for your favourite company</p>
</hgroup>
<div>
<label for="company">Choose a company:</label>
<select name="company" id="company">
<option value="Company A">Company A</option>
<option value="Company B">Company A</option>
<option value="Company B">Company A</option>
</select>
</div>
<button type="submit">Submit</button>
</form>
</section>
</main>
</body>
</html>
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
"exclude": ["dist"],
"compilerOptions": {
"types": ["astro/client"]
}
}