# uvaestudantes/noponto-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/uvaestudantes/noponto-frontend
- Repository: https://github.com/uvaestudantes/noponto-frontend

## Overview

NoPonto is a Rio de Janeiro public-transit mobile app. Its main user workflow is to search for a line, inspect its route and map, and monitor vehicles or stop arrivals; separate screens cover favorites, line details, fares, and settings. The graph includes documented runtime stages and central modules from the source index. Some screen-to-component wiring and unsampled integrations cannot be verified from the excerpts, so those relationships are omitted or marked unverified.

Main entry points: [`NoPonto/app/index.tsx`](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/index.tsx) (Transit map), [`NoPonto/src/services/eventosParada.ts`](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/eventosParada.ts) (Stop event service), [`NoPonto/app/linhas.tsx`](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/linhas.tsx) (Line details), [`NoPonto/src/hooks/useMobilidadeRio.ts`](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/hooks/useMobilidadeRio.ts) (Transit realtime hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App screens"]
  node_home["Transit map<br/>[index.tsx]"]
  node_line_screen["Line details<br/>[linhas.tsx]"]
  node_favorites_screen["Favorites screen<br/>[favoritos.tsx]"]
  node_settings["Settings<br/>[configuracao.tsx]"]
  node_fares["Fare display<br/>[tarifas.tsx]"]
end

subgraph group_map["Map and routes"]
  node_map_host["Map host<br/>[mapOSM.tsx]"]
  node_map_markup["WebView markup<br/>[mapHtml.tsx]"]
  node_map_script["Map renderer<br/>[mapScript.ts]"]
  node_line_container["Line explorer"]
end

subgraph group_live["Live transit"]
  node_live_hook["Transit realtime hook"]
  node_gps["GPS subscriptions<br/>[gpsHub.ts]"]
  node_structure["Route structure<br/>[estruturaV2.ts]"]
  node_radar_hook["Stop radar hook<br/>[useRadarParada.ts]"]
  node_stop_events["Stop event service<br/>[eventosParada.ts]"]
  node_api["Transit API client<br/>[api.ts]"]
  node_vehicle_data["Vehicle map data<br/>[veiculosMapa.ts]"]
  node_rail_data["Rail realtime<br/>[railRealtime.ts]"]
end

subgraph group_support["Search and preferences"]
  node_search_ui["Search sections<br/>[searchSections.tsx]"]
  node_search_logic["Search presentation"]
  node_search_history[("Search history<br/>[searchHistory.ts]")]
  node_favorites_hook["Favorites hook<br/>[useFavoritos.ts]"]
  node_favorites_store[("Favorites collection<br/>[favoritos.ts]")]
  node_indicators["Vehicle indicators<br/>[indicadores.ts]"]
  node_indicator_provider["Indicator preferences"]
end

node_user(("Rider"))

node_map_host -->|"loads"| node_map_markup
node_map_markup -->|"embeds"| node_map_script
node_map_script -->|"uses assets"| node_indicators
node_live_hook -->|"updates subscriptions"| node_gps
node_live_hook -->|"loads itineraries"| node_structure
node_radar_hook -->|"fetches arrivals"| node_stop_events
node_radar_hook -->|"requests metadata"| node_api
node_stop_events -->|"requests events"| node_api
node_stop_events -->|"uses vehicle types"| node_vehicle_data
node_stop_events -->|"uses rail types"| node_rail_data
node_favorites_hook -->|"hydrates and updates"| node_favorites_store
node_search_history -->|"formats selections"| node_search_logic
node_indicator_provider -.->|"uses preferences"| node_indicators
node_user -.->|"opens map"| node_home
node_user -.->|"opens line"| node_line_screen
node_user -.->|"views favorites"| node_favorites_screen
node_user -.->|"configures app"| node_settings
node_home -.->|"displays map"| node_map_host
node_home -.->|"offers search"| node_search_ui
node_search_ui -.->|"presents results"| node_search_logic
node_search_logic -.->|"uses recent selections"| node_search_history
node_home -.->|"monitors vehicles"| node_live_hook
node_home -.->|"monitors stop"| node_radar_hook
node_line_screen -.->|"shows route options"| node_line_container
node_line_screen -.->|"shows fares"| node_fares
node_favorites_screen -.->|"loads favorites"| node_favorites_hook

click node_home "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/index.tsx"
click node_line_screen "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/linhas.tsx"
click node_favorites_screen "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/favoritos.tsx"
click node_settings "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/configuracao.tsx"
click node_map_host "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapOSM/mapOSM.tsx"
click node_map_markup "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapOSM/webview/mapHtml.tsx"
click node_map_script "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapOSM/webview/mapScript.ts"
click node_line_container "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapaComponents/linhasContainer.tsx"
click node_search_ui "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/searchSections.tsx"
click node_search_logic "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/searchPresentation.ts"
click node_search_history "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/searchHistory.ts"
click node_live_hook "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/hooks/useMobilidadeRio.ts"
click node_gps "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/gpsHub.ts"
click node_structure "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/estruturaV2.ts"
click node_radar_hook "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/hooks/useRadarParada.ts"
click node_stop_events "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/eventosParada.ts"
click node_api "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/api.ts"
click node_vehicle_data "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/veiculosMapa.ts"
click node_rail_data "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/railRealtime.ts"
click node_favorites_hook "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/hooks/useFavoritos.ts"
click node_favorites_store "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/favoritos.ts"
click node_indicators "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/constants/indicadores.ts"
click node_indicator_provider "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/context/ProvedorIndicadores.tsx"
click node_fares "https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/linhasComponents/tarifas.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_home,node_line_screen,node_favorites_screen,node_settings,node_fares toneBlue
class node_map_host,node_map_markup,node_map_script,node_line_container toneAmber
class node_live_hook,node_gps,node_structure,node_radar_hook,node_stop_events,node_api,node_vehicle_data,node_rail_data toneMint
class node_search_ui,node_search_logic,node_search_history,node_favorites_hook,node_favorites_store,node_indicators,node_indicator_provider toneRose
class node_user toneIndigo
```

## Components

### App screens

- [Transit map](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/index.tsx): `NoPonto/app/index.tsx`
- [Line details](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/linhas.tsx): `NoPonto/app/linhas.tsx`
- [Favorites screen](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/favoritos.tsx): `NoPonto/app/favoritos.tsx`
- [Settings](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/app/configuracao.tsx): `NoPonto/app/configuracao.tsx`
- [Fare display](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/linhasComponents/tarifas.tsx): `NoPonto/src/components/linhasComponents/tarifas.tsx`

### Map and routes

- [Map host](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapOSM/mapOSM.tsx): `NoPonto/src/components/mapOSM/mapOSM.tsx`
- [WebView markup](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapOSM/webview/mapHtml.tsx): `NoPonto/src/components/mapOSM/webview/mapHtml.tsx`
- [Map renderer](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapOSM/webview/mapScript.ts): `NoPonto/src/components/mapOSM/webview/mapScript.ts`
- [Line explorer](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/mapaComponents/linhasContainer.tsx): `NoPonto/src/components/mapaComponents/linhasContainer.tsx`

### Live transit

- [Transit realtime hook](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/hooks/useMobilidadeRio.ts): `NoPonto/src/hooks/useMobilidadeRio.ts`
- [GPS subscriptions](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/gpsHub.ts): `NoPonto/src/services/gpsHub.ts`
- [Route structure](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/estruturaV2.ts): `NoPonto/src/services/estruturaV2.ts`
- [Stop radar hook](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/hooks/useRadarParada.ts): `NoPonto/src/hooks/useRadarParada.ts`
- [Stop event service](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/eventosParada.ts): `NoPonto/src/services/eventosParada.ts`
- [Transit API client](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/api.ts): `NoPonto/src/services/api.ts`
- [Vehicle map data](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/veiculosMapa.ts): `NoPonto/src/services/veiculosMapa.ts`
- [Rail realtime](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/railRealtime.ts): `NoPonto/src/services/railRealtime.ts`

### Search and preferences

- [Search sections](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/components/searchSections.tsx): `NoPonto/src/components/searchSections.tsx`
- [Search presentation](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/searchPresentation.ts): `NoPonto/src/services/searchPresentation.ts`
- [Search history](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/searchHistory.ts): `NoPonto/src/services/searchHistory.ts`
- [Favorites hook](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/hooks/useFavoritos.ts): `NoPonto/src/hooks/useFavoritos.ts`
- [Favorites collection](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/services/favoritos.ts): `NoPonto/src/services/favoritos.ts`
- [Vehicle indicators](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/constants/indicadores.ts): `NoPonto/src/constants/indicadores.ts`
- [Indicator preferences](https://github.com/uvaestudantes/noponto-frontend/blob/main/NoPonto/src/context/ProvedorIndicadores.tsx): `NoPonto/src/context/ProvedorIndicadores.tsx`

### Other components

- **Rider**

## Connections

- Map host → WebView markup: loads (evidence: `NoPonto/src/components/mapOSM/mapOSM.tsx`)
- WebView markup → Map renderer: embeds (evidence: `NoPonto/src/components/mapOSM/webview/mapHtml.tsx`)
- Map renderer → Vehicle indicators: uses assets (evidence: `NoPonto/src/components/mapOSM/webview/mapScript.ts`)
- Transit realtime hook → GPS subscriptions: updates subscriptions (evidence: `NoPonto/src/hooks/useMobilidadeRio.ts`)
- Transit realtime hook → Route structure: loads itineraries (evidence: `NoPonto/src/hooks/useMobilidadeRio.ts`)
- Stop radar hook → Stop event service: fetches arrivals (evidence: `NoPonto/src/hooks/useRadarParada.ts`)
- Stop radar hook → Transit API client: requests metadata
- Stop event service → Transit API client: requests events (evidence: `NoPonto/src/services/eventosParada.ts`)
- Stop event service → Vehicle map data: uses vehicle types (evidence: `NoPonto/src/services/eventosParada.ts`)
- Stop event service → Rail realtime: uses rail types (evidence: `NoPonto/src/services/eventosParada.ts`)
- Favorites hook → Favorites collection: hydrates and updates (evidence: `NoPonto/src/hooks/useFavoritos.ts`)
- Search history → Search presentation: formats selections (evidence: `NoPonto/src/services/searchHistory.ts`)
- Indicator preferences → Vehicle indicators: uses preferences
- Rider → Transit map: opens map
- Rider → Line details: opens line
- Rider → Favorites screen: views favorites
- Rider → Settings: configures app
- Transit map → Map host: displays map
- Transit map → Search sections: offers search
- Search sections → Search presentation: presents results
- Search presentation → Search history: uses recent selections (evidence: `NoPonto/src/services/searchHistory.ts`)
- Transit map → Transit realtime hook: monitors vehicles
- Transit map → Stop radar hook: monitors stop
- Line details → Line explorer: shows route options
- Line details → Fare display: shows fares
- Favorites screen → Favorites hook: loads favorites
