Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dreancaste/TriviaPP/llms.txt

Use this file to discover all available pages before exploring further.

TriviaPP uses Angular’s RouterModule.forRoot() configured with the PreloadAllModules preloading strategy. Every feature module is lazy-loaded — meaning its JavaScript bundle is only fetched on demand — but Angular begins downloading all lazy modules in the background as soon as the initial page is stable. This gives the app fast first-load times while ensuring that subsequent navigation feels instant. Route protection is applied selectively via AuthGuard using Angular’s canActivate hook: public pages like login, registration, and the wiki are always accessible, while the game’s core features require a verified Amplify session.

Route Table

PathModuleAuth RequiredDescription
'' (empty)NoRedirects immediately to /login. Matches when the app is opened with no path.
loginLoginPageModuleNoUser sign-in screen. Entry point for returning players.
registerRegisterPageModuleNoNew account registration with AWS Cognito email confirmation flow.
homeHomePageModuleYes (AuthGuard)Main dashboard. Provides navigation links to all protected features.
profileProfilePageModuleYes (AuthGuard)Player profile editor — display name, avatar capture, and haptic settings.
triviaTriviaPageModuleYes (AuthGuard)10-question Star Wars trivia session with score tracking.
rankingRankingPageModuleYes (AuthGuard)Daily Firebase leaderboard showing all submitted scores for today.
historyHistoryPageModuleYes (AuthGuard)Local match history list with cumulative correct-answer statistics.
wikiWikiPageModuleNoStar Wars wiki browser — characters, films, and planets sourced from SWAPI.

Wiki Sub-routes

The wiki module defines its own child router (WikiPageRoutingModule) using RouterModule.forChild(). The following paths are all nested under the top-level wiki route:
Full PathDescription
wiki/Wiki home page displaying the three section cards (characters, films, planets).
wiki/charactersPaginated list of Star Wars characters fetched from SWAPI.
wiki/filmsList of Star Wars films with episode metadata and curiosities.
wiki/planetsList of planets with climate, terrain, and population data.
wiki/detail/:type/:idEntity detail page. :type is one of characters, films, or planets; :id is the SWAPI numeric ID.
The wiki route and all of its children are intentionally left without AuthGuard. This allows unauthenticated users to browse Star Wars lore freely — for example, directly following a deep link to a planet detail page — without being redirected to the login screen. Only the game features (trivia, ranking, history, profile) require authentication.

Preloading Strategy

PreloadAllModules is applied globally in AppRoutingModule:
@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }),
  ],
  exports: [RouterModule],
})
export class AppRoutingModule {}
With this strategy Angular loads the initial route bundle first, renders the page, then silently downloads every other lazy module in the background. By the time a user navigates from login to home, the home bundle is already cached — making navigation seamless even on slower mobile connections.
PreloadAllModules preloads all lazy modules, including the wiki. If you add a very large third-party dependency inside a single feature module in the future, consider switching to a custom preloading strategy to avoid competing with the initial load.
For details on how AuthGuard validates sessions at each protected route, see the AuthGuard reference.

Build docs developers (and LLMs) love