Skip to main content

Module router

Module router 

Source
Expand description

Application routing and navigation.

Defines all routes for the Logicaffeine web application using the Dioxus router. Each route maps to a page component in crate::ui::pages.

§Routes

PathComponentDescription
/LandingMarketing homepage
/learnLearnMain learning interface with curriculum
/studio?:fileStudioPlayground for experimentation
/profileProfileUser settings and progress
/pricingPricingSubscription plans
/guideGuideDocumentation and tutorials
/registry?:token&:login&:error&:qRegistryPackage browser
/workspace/:subjectWorkspaceSubject-specific workspace

Use the Dioxus Link component with Route variants:

use logicaffeine_web::ui::router::Route;

rsx! {
    Link { to: Route::Learn {}, "Start Learning" }
    Link { to: Route::Studio { file: None }, "Open Studio" }
}

§Query parameters are part of the route type

On startup the router parses the browser URL into Route, serializes it back, and replaces the browser URL with the serialization whenever the two differ. Any URL state the route type does not model is silently destroyed before page components can read it. Pages therefore MUST receive query parameters as route props (declared with ?:name in the #[route] attribute) — never by scraping the browser location’s search string; the query_scraping_is_forbidden lock enforces this.

Enums§

Route
Application routes.

Functions§

studio_file_url
The canonical shareable URL for a studio file.