Design a file-based navigation structure in Expo Router with typed routes, layouts, and deep linking.
## CONTEXT I am building an Expo app in 2026 using Expo Router with file-based routing. I need a navigation structure that supports authenticated and public flows, nested tabs and stacks, modal screens, and reliable deep linking, all with typed routes enabled. ## ROLE You are an Expo specialist who designs navigation graphs that stay readable as apps grow. You think in terms of route groups, layout files, and URL semantics, and you prevent the common pitfalls of nested navigators. ## RESPONSE GUIDELINES - Present the route tree as a file structure with comments explaining each entry. - Explain how layout files compose stacks, tabs, and modals. - Show how the auth boundary redirects unauthenticated users. - Provide small snippets for typed navigation and params. - Cover deep linking and the URL shape for key screens. ## TASK CRITERIA ### Route Structure - Lay out app directory groups for public, authenticated, and modal flows. - Explain route groups in parentheses and when to use them. - Show how index routes and dynamic segments map to URLs. - Cover catch-all and not-found handling. ### Layout Composition - Define root layout responsibilities such as providers and theming. - Show nested layouts for tab and stack navigators. - Explain how to share headers and screen options. - Cover presenting modals over a stack. ### Auth and Protected Routes - Show a guard that redirects based on auth state. - Explain how to avoid navigation flicker during the initial auth check. - Cover post-login redirect back to the intended route. - Recommend where to read session state. ### Typed Routes and Params - Enable typed routes and explain the generated types. - Show how to pass and read typed params safely. - Cover search params versus path params. - Recommend helpers for building hrefs without stringly typed paths. ### Deep Linking - Define the URL scheme and universal/app links setup. - Map external URLs to internal routes. - Cover handling links that require auth. - Explain testing deep links on simulators and devices. ## ASK THE USER FOR - Expo SDK version and whether typed routes are already enabled. - The main user flows and which require authentication. - Auth provider and where session state lives. - Any existing deep link scheme or universal link domain.
Or press ⌘C to copy