# rmanguinho/advanced-flutter architecture

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

- Interactive diagram: https://gitdiagram.com/rmanguinho/advanced-flutter
- Repository: https://github.com/rmanguinho/advanced-flutter

## Overview

This is a Flutter mobile app organized around displaying a group’s next event and its players, with a small Express backend exposing sample event data. The tree indicates a presentation-to-domain-to-infrastructure design, including API loading and cache fallback; source excerpts do not show the Dart runtime wiring, so those relationships are shown as unverified. The backend excerpt confirms its endpoint and response shape, but not a connection from the app.

Main entry points: [`lib/presentation/presenters/next_event_presenter.dart`](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/presentation/presenters/next_event_presenter.dart) (Event Presenter), [`lib/ui/pages/next_event_page.dart`](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/ui/pages/next_event_page.dart) (Next Event Page), [`lib/presentation/viewmodels`](https://github.com/rmanguinho/advanced-flutter/tree/master/lib/presentation/viewmodels) (Event View Models), [`lib/infra/respositories/load_next_event_from_api_with_cache_fallback_repo.dart`](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/respositories/load_next_event_from_api_with_cache_fallback_repo.dart) (API Cache Fallback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_page["Next Event Page"]
  node_components["Player Components"]
  node_presenter["Event Presenter"]
  node_rxpresenter["Reactive Presenter"]
  node_viewmodels["Event View Models"]
end

subgraph group_domain["Event Domain"]
  node_event["Next Event<br/>[next_event.dart]"]
  node_player["Event Player"]
  node_errors["Domain Errors<br/>[errors.dart]"]
end

subgraph group_infrastructure["Data Infrastructure"]
  node_fallback["API Cache Fallback"]
  node_api_repo["API Event Repository"]
  node_http_client["Authorized HTTP Client"]
  node_http_adapter["HTTP Adapter<br/>[http_adapter.dart]"]
  node_api_mapper["Event Mappers"]
  node_cache_repo["Cache Event Repository"]
  node_cache_adapter["Cache Adapter"]
end

subgraph group_services["Backend Service"]
  node_backend["Express Event API<br/>[index.js]"]
end

node_user(("App User"))

node_user -.->|"views"| node_page
node_page -.->|"requests data"| node_presenter
node_page -.->|"renders"| node_components
node_presenter -.->|"uses"| node_rxpresenter
node_presenter -.->|"builds"| node_viewmodels
node_viewmodels -.->|"represents"| node_event
node_viewmodels -.->|"represents"| node_player
node_presenter -.->|"loads event"| node_fallback
node_fallback -.->|"tries API"| node_api_repo
node_fallback -.->|"falls back"| node_cache_repo
node_api_repo -.->|"fetches"| node_http_client
node_http_client -.->|"uses"| node_http_adapter
node_api_repo -.->|"maps response"| node_api_mapper
node_cache_repo -.->|"reads cache"| node_cache_adapter
node_http_client -.->|"requests event"| node_backend

click node_page "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/ui/pages/next_event_page.dart"
click node_components "https://github.com/rmanguinho/advanced-flutter/tree/master/lib/ui/components"
click node_presenter "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/presentation/presenters/next_event_presenter.dart"
click node_rxpresenter "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/presentation/rx/next_event_rx_presenter.dart"
click node_viewmodels "https://github.com/rmanguinho/advanced-flutter/tree/master/lib/presentation/viewmodels"
click node_event "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/domain/entities/next_event.dart"
click node_player "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/domain/entities/next_event_player.dart"
click node_errors "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/domain/entities/errors.dart"
click node_fallback "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/respositories/load_next_event_from_api_with_cache_fallback_repo.dart"
click node_api_repo "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/api/repositories/load_next_event_api_repo.dart"
click node_http_client "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/api/clients/authorized_http_get_client.dart"
click node_http_adapter "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/api/adapters/http_adapter.dart"
click node_api_mapper "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/mappers/next_event_mapper.dart"
click node_cache_repo "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/cache/repositories/load_next_event_cache_repo.dart"
click node_cache_adapter "https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/cache/adapters/cache_manager_adapter.dart"
click node_backend "https://github.com/rmanguinho/advanced-flutter/blob/master/backend/index.js"

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_page,node_components,node_presenter,node_rxpresenter,node_viewmodels,node_user toneBlue
class node_event,node_player,node_errors toneAmber
class node_fallback,node_api_repo,node_http_client,node_http_adapter,node_api_mapper,node_cache_repo,node_cache_adapter toneMint
class node_backend toneRose
```

## Components

### Presentation

- [Next Event Page](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/ui/pages/next_event_page.dart): `lib/ui/pages/next_event_page.dart`
- [Player Components](https://github.com/rmanguinho/advanced-flutter/tree/master/lib/ui/components): `lib/ui/components`
- [Event Presenter](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/presentation/presenters/next_event_presenter.dart): `lib/presentation/presenters/next_event_presenter.dart`
- [Reactive Presenter](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/presentation/rx/next_event_rx_presenter.dart): `lib/presentation/rx/next_event_rx_presenter.dart`
- [Event View Models](https://github.com/rmanguinho/advanced-flutter/tree/master/lib/presentation/viewmodels): `lib/presentation/viewmodels`

### Event Domain

- [Next Event](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/domain/entities/next_event.dart): `lib/domain/entities/next_event.dart`
- [Event Player](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/domain/entities/next_event_player.dart): `lib/domain/entities/next_event_player.dart`
- [Domain Errors](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/domain/entities/errors.dart): `lib/domain/entities/errors.dart`

### Data Infrastructure

- [API Cache Fallback](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/respositories/load_next_event_from_api_with_cache_fallback_repo.dart): `lib/infra/respositories/load_next_event_from_api_with_cache_fallback_repo.dart`
- [API Event Repository](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/api/repositories/load_next_event_api_repo.dart): `lib/infra/api/repositories/load_next_event_api_repo.dart`
- [Authorized HTTP Client](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/api/clients/authorized_http_get_client.dart): `lib/infra/api/clients/authorized_http_get_client.dart`
- [HTTP Adapter](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/api/adapters/http_adapter.dart): `lib/infra/api/adapters/http_adapter.dart`
- [Event Mappers](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/mappers/next_event_mapper.dart): `lib/infra/mappers/next_event_mapper.dart`
- [Cache Event Repository](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/cache/repositories/load_next_event_cache_repo.dart): `lib/infra/cache/repositories/load_next_event_cache_repo.dart`
- [Cache Adapter](https://github.com/rmanguinho/advanced-flutter/blob/master/lib/infra/cache/adapters/cache_manager_adapter.dart): `lib/infra/cache/adapters/cache_manager_adapter.dart`

### Backend Service

- [Express Event API](https://github.com/rmanguinho/advanced-flutter/blob/master/backend/index.js): `backend/index.js`

### Other components

- **App User**

## Connections

- App User → Next Event Page: views
- Next Event Page → Event Presenter: requests data
- Next Event Page → Player Components: renders
- Event Presenter → Reactive Presenter: uses
- Event Presenter → Event View Models: builds
- Event View Models → Next Event: represents
- Event View Models → Event Player: represents
- Event Presenter → API Cache Fallback: loads event
- API Cache Fallback → API Event Repository: tries API
- API Cache Fallback → Cache Event Repository: falls back
- API Event Repository → Authorized HTTP Client: fetches
- Authorized HTTP Client → HTTP Adapter: uses
- API Event Repository → Event Mappers: maps response
- Cache Event Repository → Cache Adapter: reads cache
- Authorized HTTP Client → Express Event API: requests event
