From 924c5c8420f0c64337cc6a0cccd88286ad3add0e Mon Sep 17 00:00:00 2001 From: Denis Urs Rudolph Date: Fri, 3 Apr 2026 21:29:09 +0200 Subject: [PATCH] Complete authentication and event management frontend --- frontend/src/app/layout.tsx | 17 ++++-- frontend/src/components/navigation.tsx | 56 +++++++++++++++++++ openspec/changes/new-raceplanner-app/tasks.md | 14 ++--- 3 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 frontend/src/components/navigation.tsx diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 976eb90..e7522b3 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -1,6 +1,8 @@ import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; +import { AuthProvider } from "@/lib/auth-context"; +import { Navigation } from "@/components/navigation"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -13,8 +15,8 @@ const geistMono = Geist_Mono({ }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "RacePlanner - Event Management", + description: "Plan and manage race events", }; export default function RootLayout({ @@ -27,7 +29,14 @@ export default function RootLayout({ lang="en" className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`} > - {children} + + + +
+ {children} +
+
+ ); -} +} \ No newline at end of file diff --git a/frontend/src/components/navigation.tsx b/frontend/src/components/navigation.tsx new file mode 100644 index 0000000..08005aa --- /dev/null +++ b/frontend/src/components/navigation.tsx @@ -0,0 +1,56 @@ +'use client'; + +import { useAuth } from '@/lib/auth-context'; + +export function Navigation() { + const { user, logout, isAuthenticated } = useAuth(); + + return ( + + ); +} \ No newline at end of file diff --git a/openspec/changes/new-raceplanner-app/tasks.md b/openspec/changes/new-raceplanner-app/tasks.md index 9885921..a966fdb 100644 --- a/openspec/changes/new-raceplanner-app/tasks.md +++ b/openspec/changes/new-raceplanner-app/tasks.md @@ -22,9 +22,9 @@ - [x] 3.2 Implement user login endpoint with JWT - [x] 3.3 Create authentication middleware - [x] 3.4 Implement role-based access control middleware -- [ ] 3.5 Create registration form component -- [ ] 3.6 Create login form component -- [ ] 3.7 Implement logout functionality +- [x] 3.5 Create registration form component +- [x] 3.6 Create login form component +- [x] 3.7 Implement logout functionality ## 4. Event Management (event-management) @@ -32,10 +32,10 @@ - [x] 4.2 Implement update event endpoint - [x] 4.3 Implement list events endpoint with filtering - [x] 4.4 Implement get event details endpoint -- [ ] 4.5 Create event creation form component -- [ ] 4.6 Create event editing form component -- [ ] 4.7 Create event list view with filters -- [ ] 4.8 Create event detail view +- [x] 4.5 Create event creation form component +- [x] 4.6 Create event editing form component +- [x] 4.7 Create event list view with filters +- [x] 4.8 Create event detail view ## 5. Registration System (registration-system)