added login with pages and database, also correct errors in score submit

This commit is contained in:
2026-06-22 13:36:34 +01:00
parent 192564fb79
commit fbc181c890
42 changed files with 31351 additions and 1599 deletions

View File

@@ -1,8 +1,8 @@
event_type,division,event_state,winner,time_completed
100m Sprint,Year 7,0,,
100m Sprint,Year 8,0,,
100m Sprint,Year 9,2,East,
100m Sprint,Year 10,1,,
100m Sprint,Year 9,0,,
100m Sprint,Year 10,0,,
200m Sprint,Year 7,0,,
200m Sprint,Year 8,0,,
200m Sprint,Year 9,0,,
1 event_type division event_state winner time_completed
2 100m Sprint Year 7 0
3 100m Sprint Year 8 0
4 100m Sprint Year 9 2 0 East
5 100m Sprint Year 10 1 0
6 200m Sprint Year 7 0
7 200m Sprint Year 8 0
8 200m Sprint Year 9 0

View File

@@ -59,11 +59,11 @@ Dante Sorensen,1000m Long Distance,0,C
Mia Nguyen,1000m Long Distance,0,C
Oluseun Alade,1000m Long Distance,0,C
Tobias Crane,1000m Long Distance,0,C
Alaric Olawale,100m Sprint,1,A
Ava Mackenzie,100m Sprint,2,A
Bjorn Oyelaran,100m Sprint,3,A
Jack Simmons,100m Sprint,4,A
Kai Johansson,100m Sprint,5,A
Alaric Olawale,100m Sprint,0,A
Ava Mackenzie,100m Sprint,0,A
Bjorn Oyelaran,100m Sprint,0,A
Jack Simmons,100m Sprint,0,A
Kai Johansson,100m Sprint,0,A
Clark Kent,100m Sprint,0,B
Cormac Halvorsen,100m Sprint,0,B
Marcus Okafor,100m Sprint,0,B
1 player_registered event_registered player_placement bracket
59 Mia Nguyen 1000m Long Distance 0 C
60 Oluseun Alade 1000m Long Distance 0 C
61 Tobias Crane 1000m Long Distance 0 C
62 Alaric Olawale 100m Sprint 1 0 A
63 Ava Mackenzie 100m Sprint 2 0 A
64 Bjorn Oyelaran 100m Sprint 3 0 A
65 Jack Simmons 100m Sprint 4 0 A
66 Kai Johansson 100m Sprint 5 0 A
67 Clark Kent 100m Sprint 0 B
68 Cormac Halvorsen 100m Sprint 0 B
69 Marcus Okafor 100m Sprint 0 B

View File

@@ -1,7 +1,9 @@
preset,placement,points
1,1,10
1,2,7
1,3,5
1,1,5
1,2,4
1,3,3
1,4,2
1,5,1
2,1,50
2,2,30
2,3,10
1 preset placement points
2 1 1 10 5
3 1 2 7 4
4 1 3 5 3
5 1 4 2
6 1 5 1
7 2 1 50
8 2 2 30
9 2 3 10

View File

@@ -43,11 +43,18 @@ async function seed() {
await db.delete(schema.players);
await db.delete(schema.divisions);
await db.delete(schema.teams);
await db.delete(schema.scorers);
await db.delete(schema.sessions);
await client.execute('DELETE FROM sqlite_sequence');
console.log('Database reset complete. Seeding...');
let passwordHash = await Bun.password.hash('password');
await db
.insert(schema.scorers)
.values({ id: crypto.randomUUID(), username: 'admin', passwordHash: passwordHash });
// --- 1. Teams ---
const teamsCSV = readCSV('teams.csv');
for (const row of teamsCSV) {