[Issue #6] Multi-page app example #17

Merged
HugoNijhuis merged 1 commits from issue-6-multi-page-example into main 2026-01-09 16:10:26 +00:00
Owner

Summary

Adds a comprehensive multi-page example demonstrating the navigation package capabilities.

Changes

  • Added examples/multipage/main.go with a complete routing demonstration:
    • Home page with welcome message and feature overview
    • About page explaining the navigation package
    • Users page with a list of users linking to detail pages
    • User detail page using route parameters (:id)
    • Admin page protected by an AuthGuard
    • Custom 404 not found page
    • Consistent page layout with navigation bar
    • Login/logout flow demonstrating reactive auth state

Features Demonstrated

  • Router setup with multiple routes (/, /about, /users, /users/:id, /admin)
  • Route parameters with NumericIdGuard validation
  • Navigation using Link component and programmatic Navigate/Back
  • Route guards with AuthGuard for protected routes
  • Browser history integration

Closes #6

## Summary Adds a comprehensive multi-page example demonstrating the navigation package capabilities. ## Changes - Added `examples/multipage/main.go` with a complete routing demonstration: - Home page with welcome message and feature overview - About page explaining the navigation package - Users page with a list of users linking to detail pages - User detail page using route parameters (`:id`) - Admin page protected by an `AuthGuard` - Custom 404 not found page - Consistent page layout with navigation bar - Login/logout flow demonstrating reactive auth state ## Features Demonstrated - Router setup with multiple routes (`/`, `/about`, `/users`, `/users/:id`, `/admin`) - Route parameters with `NumericIdGuard` validation - Navigation using `Link` component and programmatic `Navigate`/`Back` - Route guards with `AuthGuard` for protected routes - Browser history integration Closes #6
HugoNijhuis added 1 commit 2026-01-09 16:02:05 +00:00
Add multi-page app example demonstrating navigation
All checks were successful
CI / build (pull_request) Successful in 27s
CI / build (push) Successful in 28s
a13e215e31
Add a comprehensive example showing client-side routing:
- Router setup with multiple routes (/, /about, /users, /admin)
- Route parameters (/users/:id) with the NumericIdGuard
- Navigation using Link component and programmatic Navigate/Back
- Route guards with AuthGuard for protected admin page
- Browser history integration with back/forward support

Closes #6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
Owner

Code Review - LGTM

Summary

Excellent multi-page routing example demonstrating navigation package capabilities.

Highlights

  • Clean separation with page functions and layout helpers
  • Proper demonstration of routes, parameters, guards, and history
  • Correct closure capture in loops
  • Good edge case handling (user not found)
  • Uses only public APIs - no internal package imports

Minor Notes

  • Global auth state is fine for a demo
  • Simulated login flow is simple but effective

Approved for merge.

## Code Review - LGTM ### Summary Excellent multi-page routing example demonstrating navigation package capabilities. ### Highlights - Clean separation with page functions and layout helpers - Proper demonstration of routes, parameters, guards, and history - Correct closure capture in loops - Good edge case handling (user not found) - **Uses only public APIs** - no internal package imports ### Minor Notes - Global auth state is fine for a demo - Simulated login flow is simple but effective Approved for merge.
HugoNijhuis merged commit a13e215e31 into main 2026-01-09 16:10:26 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flowmade-one/iris#17