# iamfabiuu/ytu_app architecture

> Architecture diagram of the GitHub repository iamfabiuu/ytu_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iamfabiuu/ytu_app
- Repository: https://github.com/iamfabiuu/ytu_app

## Overview

YTU is a Recife cultural-discovery and walking-route app. Users enter through account setup or sign-in, then explore places, inspect map details and recommended routes, and follow a route stop by stop. The map route controller draws stored segment geometry or requests missing walking segments from OSRM. The tree also shows saved places, coupons, achievements, and profile/settings areas; their internal wiring is not established by the sampled source, so they are represented as app destinations rather than connected to speculative services.

Main entry points: [`src/App.tsx`](https://github.com/iamfabiuu/ytu_app/blob/main/src/App.tsx) (Route shell), [`src/components/Routejourney.tsx`](https://github.com/iamfabiuu/ytu_app/blob/main/src/components/Routejourney.tsx) (Route journey), [`src/map/route.ts`](https://github.com/iamfabiuu/ytu_app/blob/main/src/map/route.ts) (Route drawing), [`src/main.tsx`](https://github.com/iamfabiuu/ytu_app/blob/main/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and access"]
  node_main["React entry<br/>[main.tsx]"]
  node_app["Route shell<br/>[App.tsx]"]
  node_guards["Access guards<br/>[Guards.tsx]"]
  node_authhook["Auth state hook<br/>[useAuth.ts]"]
  node_auth["Demo auth<br/>[fakeAuth.ts]"]
end

subgraph group_discovery["Place discovery"]
  node_home["Home discovery<br/>[Home.tsx]"]
  node_mapview["Map discovery<br/>[MapScreen.tsx]"]
  node_places["Place catalogue<br/>[places.ts]"]
  node_placeinfo["Place details data<br/>[placeDetails.ts]"]
  node_placepages["Place detail pages<br/>[PlaceDetail.tsx]"]
end

subgraph group_mapping["Maps and routes"]
  node_realmap["Interactive map<br/>[RealMap.tsx]"]
  node_routeview["Route journey<br/>[Routejourney.tsx]"]
  node_routes["Route catalogue<br/>[routes.ts]"]
  node_routecontroller["Route drawing<br/>[route.ts]"]
  node_geometry["Segment geometry<br/>[segmentGeometry.ts]"]
end

subgraph group_account["Account and extras"]
  node_saved["Saved places<br/>[Saved.tsx]"]
  node_coupons["Coupons<br/>[Coupons.tsx]"]
  node_achievements["Achievements<br/>[Conquistas.tsx]"]
  node_achievementdata["Achievement data<br/>[achievements.ts]"]
  node_profile["Profile<br/>[Profile.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
end

node_visitor(("Visitor"))
node_browserstore[("Browser storage")]
node_osrm{{"OSRM routing"}}

node_visitor -->|"opens"| node_main
node_main -->|"renders"| node_app
node_app -->|"gates routes"| node_guards
node_app -->|"reads auth state"| node_authhook
node_authhook -->|"reads state"| node_auth
node_auth -->|"persists session"| node_browserstore
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_mapview
node_app -->|"routes to"| node_placepages
node_app -->|"routes to"| node_routeview
node_app -->|"routes to"| node_saved
node_app -->|"routes to"| node_coupons
node_app -->|"routes to"| node_achievements
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_settings
node_mapview -->|"lists places"| node_places
node_routeview -->|"loads route"| node_routes
node_routeview -->|"resolves stops"| node_places
node_routeview -->|"renders map"| node_realmap
node_routecontroller -->|"reads segments"| node_geometry
node_routecontroller -.->|"requests missing segments"| node_osrm
node_achievements -->|"reads achievements"| node_achievementdata

click node_main "https://github.com/iamfabiuu/ytu_app/blob/main/src/main.tsx"
click node_app "https://github.com/iamfabiuu/ytu_app/blob/main/src/App.tsx"
click node_guards "https://github.com/iamfabiuu/ytu_app/blob/main/src/components/Guards.tsx"
click node_authhook "https://github.com/iamfabiuu/ytu_app/blob/main/src/layouts/lib/useAuth.ts"
click node_auth "https://github.com/iamfabiuu/ytu_app/blob/main/src/layouts/lib/fakeAuth.ts"
click node_home "https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Home.tsx"
click node_mapview "https://github.com/iamfabiuu/ytu_app/blob/main/src/screens/MapScreen.tsx"
click node_places "https://github.com/iamfabiuu/ytu_app/blob/main/src/data/places.ts"
click node_placeinfo "https://github.com/iamfabiuu/ytu_app/blob/main/src/data/placeDetails.ts"
click node_placepages "https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/PlaceDetail.tsx"
click node_realmap "https://github.com/iamfabiuu/ytu_app/blob/main/src/components/RealMap.tsx"
click node_routeview "https://github.com/iamfabiuu/ytu_app/blob/main/src/components/Routejourney.tsx"
click node_routes "https://github.com/iamfabiuu/ytu_app/blob/main/src/data/routes.ts"
click node_routecontroller "https://github.com/iamfabiuu/ytu_app/blob/main/src/map/route.ts"
click node_geometry "https://github.com/iamfabiuu/ytu_app/blob/main/src/lib/segmentGeometry.ts"
click node_saved "https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Saved.tsx"
click node_coupons "https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Coupons.tsx"
click node_achievements "https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Conquistas.tsx"
click node_achievementdata "https://github.com/iamfabiuu/ytu_app/blob/main/src/data/achievements.ts"
click node_profile "https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Profile.tsx"
click node_settings "https://github.com/iamfabiuu/ytu_app/blob/main/src/screens/Settings.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_guards,node_authhook,node_auth toneBlue
class node_home,node_mapview,node_places,node_placeinfo,node_placepages,node_browserstore toneAmber
class node_realmap,node_routeview,node_routes,node_routecontroller,node_geometry toneMint
class node_saved,node_coupons,node_achievements,node_achievementdata,node_profile,node_settings toneRose
class node_visitor,node_osrm toneIndigo
```

## Components

### App entry and access

- [React entry](https://github.com/iamfabiuu/ytu_app/blob/main/src/main.tsx): `src/main.tsx`
- [Route shell](https://github.com/iamfabiuu/ytu_app/blob/main/src/App.tsx): `src/App.tsx`
- [Access guards](https://github.com/iamfabiuu/ytu_app/blob/main/src/components/Guards.tsx): `src/components/Guards.tsx`
- [Auth state hook](https://github.com/iamfabiuu/ytu_app/blob/main/src/layouts/lib/useAuth.ts): `src/layouts/lib/useAuth.ts`
- [Demo auth](https://github.com/iamfabiuu/ytu_app/blob/main/src/layouts/lib/fakeAuth.ts): `src/layouts/lib/fakeAuth.ts`

### Place discovery

- [Home discovery](https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Map discovery](https://github.com/iamfabiuu/ytu_app/blob/main/src/screens/MapScreen.tsx): `src/screens/MapScreen.tsx`
- [Place catalogue](https://github.com/iamfabiuu/ytu_app/blob/main/src/data/places.ts): `src/data/places.ts`
- [Place details data](https://github.com/iamfabiuu/ytu_app/blob/main/src/data/placeDetails.ts): `src/data/placeDetails.ts`
- [Place detail pages](https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/PlaceDetail.tsx): `src/pages/PlaceDetail.tsx`

### Maps and routes

- [Interactive map](https://github.com/iamfabiuu/ytu_app/blob/main/src/components/RealMap.tsx): `src/components/RealMap.tsx`
- [Route journey](https://github.com/iamfabiuu/ytu_app/blob/main/src/components/Routejourney.tsx): `src/components/Routejourney.tsx`
- [Route catalogue](https://github.com/iamfabiuu/ytu_app/blob/main/src/data/routes.ts): `src/data/routes.ts`
- [Route drawing](https://github.com/iamfabiuu/ytu_app/blob/main/src/map/route.ts): `src/map/route.ts`
- [Segment geometry](https://github.com/iamfabiuu/ytu_app/blob/main/src/lib/segmentGeometry.ts): `src/lib/segmentGeometry.ts`

### Account and extras

- [Saved places](https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Saved.tsx): `src/pages/Saved.tsx`
- [Coupons](https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Coupons.tsx): `src/pages/Coupons.tsx`
- [Achievements](https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Conquistas.tsx): `src/pages/Conquistas.tsx`
- [Achievement data](https://github.com/iamfabiuu/ytu_app/blob/main/src/data/achievements.ts): `src/data/achievements.ts`
- [Profile](https://github.com/iamfabiuu/ytu_app/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Settings](https://github.com/iamfabiuu/ytu_app/blob/main/src/screens/Settings.tsx): `src/screens/Settings.tsx`

### Other components

- **Visitor**
- **Browser storage**
- **OSRM routing**

## Connections

- Visitor → React entry: opens
- React entry → Route shell: renders
- Route shell → Access guards: gates routes
- Route shell → Auth state hook: reads auth state
- Auth state hook → Demo auth: reads state
- Demo auth → Browser storage: persists session
- Route shell → Home discovery: routes to
- Route shell → Map discovery: routes to
- Route shell → Place detail pages: routes to
- Route shell → Route journey: routes to
- Route shell → Saved places: routes to
- Route shell → Coupons: routes to
- Route shell → Achievements: routes to
- Route shell → Profile: routes to
- Route shell → Settings: routes to
- Map discovery → Place catalogue: lists places
- Route journey → Route catalogue: loads route
- Route journey → Place catalogue: resolves stops
- Route journey → Interactive map: renders map
- Route drawing → Segment geometry: reads segments
- Route drawing → OSRM routing: requests missing segments
- Achievements → Achievement data: reads achievements
