From 06a43c5cfb1964c5fee41614bc9d3b7593b53290 Mon Sep 17 00:00:00 2001 From: Stephanie Gredell Date: Tue, 22 Jul 2025 19:14:19 -0700 Subject: [PATCH] stuff --- main.go | 6 ++++++ templates/create-hackathon.html | 23 ++++++++++++++++++++ templates/hackathons.html | 38 +++++++++++++++++++++++++++++++++ templates/index.html | 4 ++-- todo.md | 27 +++++++++++++++++++++-- 5 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 templates/create-hackathon.html create mode 100644 templates/hackathons.html diff --git a/main.go b/main.go index 320ce9a..3280c11 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,12 @@ func main() { mux.HandleFunc("/auth/twitch/callback", h.Callback) mux.HandleFunc("/logout", h.Logout) + mux.HandleFunc("/create-hackathon", h.CreateHackathon) + mux.HandleFunc("/hackathon/create", h.ParseHackthonForm) + + mux.HandleFunc("/hackathon/{provider}", h.ListHackathonsByProvider) + mux.HandleFunc("/hackathon/{provider}/{user}", h.ListHackathonsByUser) + // pages route mux.HandleFunc("/", h.Home) mux.Handle("/welcome", handlers.RequireAuth(http.HandlerFunc(h.Welcome))) diff --git a/templates/create-hackathon.html b/templates/create-hackathon.html new file mode 100644 index 0000000..68d6952 --- /dev/null +++ b/templates/create-hackathon.html @@ -0,0 +1,23 @@ + + + + + + + HackHost - Hackathon Platform + + + + + HI +
+ + + + + + +
+ + + diff --git a/templates/hackathons.html b/templates/hackathons.html new file mode 100644 index 0000000..020620a --- /dev/null +++ b/templates/hackathons.html @@ -0,0 +1,38 @@ + + + + + + + HackHost - Hackathon Platform + + + + + {{if .Hackathons}} + + + + + + + + + + {{range .Hackathons}} + + + + + + + + + {{end}} +
IDNameOwner IDStart DateEnd DateProvider
{{.Id}}{{.HackathonName}}{{.OwnerId}}{{.StartDate}}{{.EndDate}}{{.Provider}}
+ {{else}} +

No hackathons found for provider: {{.Provider}}

+ {{end}} + + + diff --git a/templates/index.html b/templates/index.html index 16cae14..0cd0078 100644 --- a/templates/index.html +++ b/templates/index.html @@ -26,8 +26,8 @@
-

Host and Participate in Amazing Hackathons

-

A platform for developers to showcase their skills, collaborate, and win prizes.

+

Code as a Community

+

A platform for deveopers to showcase their skills.

Join a hackathon today!
diff --git a/todo.md b/todo.md index 9540288..714bddb 100644 --- a/todo.md +++ b/todo.md @@ -1,19 +1,42 @@ userid user_type username capabilities provider avatar_url 1 hacker|repo|streamer codegirl 1,2,3,4,5 twitch|github ... - +2 .... nutshadedude 1,2,3 twitch ... capability_id capability_name 1 join_hacka 2 -hackathon_id hackathon_name owner_id +hackathon_id hackathon_name description owner_id 1 something cool 1 hackathon_cap id capabilities_id hackathon_id 1 +groups +id user_id_starter +1 1 + + +participants +p_id u + +hackathon_group +id group_id hackathon_id + participants userid, hackathon_id + +SELECT h.*, p.* FROM hackathons h, participants p INNER JOIN participants ON participants.hackathon_id WHERE h.id = p.hackathon_tch + # ACTUAL TODOS - handle refreshing tokens + +/hackathon/twitch +/hackathon/twitch/codegirl007 +/hackathon/twitch/codegirl007/hackathon-name + +/groups/hackathon/create +/groups + +SELECT * FROM hackathon WHERE provider = ? AND owner_id = ? INNER JOIN users id ON hackathons.owner_id = users.id;