# igcpollotto/app-treino architecture

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

- Interactive diagram: https://gitdiagram.com/igcpollotto/app-treino
- Repository: https://github.com/igcpollotto/app-treino

## Overview

#### Purpose and Runtime
This is an Expo/React Native universal mobile application, likely centered on muscle-group content based on the domain-specific routing and data names. It runs through Expo on Android, iOS, and web, using Expo Router’s filesystem routing. Project metadata is in `app.json`; dependencies and scripts are defined in `package.json`.

#### Application Entry and Navigation Shell
Expo Router begins at the root layout, which establishes the app-wide navigation hierarchy. The root route structure includes a tab navigator plus standalone screens for home, registration, modal content, and group detail.
- `app/_layout.tsx`
- `app/(tabs)/_layout.tsx`
- `app/home.tsx`

#### Tab-Based Primary Experience
The `(tabs)` route group contains the persistent tab navigation experience. Its current route surface has an index screen and an exploration screen; these are logical primary destinations without appearing in the public URL hierarchy as a path segment.
- `app/(tabs)/index.tsx`
- `app/(tabs)/explore.tsx`
- `app/(tabs)/_layout.tsx`

#### Group Detail Routing
Muscle-group navigation is modeled as a dynamic route parameter: a selected group name becomes the `[nome]` path segment. This is the principal content-detail boundary and should receive data through route parameters or resolve it from the shared group dataset/service layer.
- `app/grupo/[nome].tsx`
- `src/data/gruposMusculares.ts`

#### Domain Data Layer
The repository has a dedicated static data module for muscle groups, separating domain content from route components. Screens should consume this module rather than embed group definitions in UI code.
- `src/data/gruposMusculares.ts`
- `app/grupo/[nome].tsx`

#### Backend Service Boundary
Firebase is isolated behind a service module, providing the intended boundary for remote persistence, authentication, or cloud-backed data access. UI routes should depend on this service layer rather than directly initialize Firebase.
- `src/services/firebase.ts`
- `app/cadastro.tsx`

#### Shared UI and Presentation System
Reusable visual primitives, themed wrappers, and platform-aware controls live outside route files. Theme resolution is centralized through constants and hooks, allowing route screens to remain focused on composition and navigation.
- `components/themed-view.tsx`
- `components/themed-text.tsx`
- `constants/theme.ts`

Main entry points: [`app/_layout.tsx`](https://github.com/igcpollotto/app-treino/blob/main/app/_layout.tsx) (Root Layout), [`app/(tabs)/_layout.tsx`](https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/_layout.tsx) (Tabs Layout), [`app/grupo/[nome].tsx`](https://github.com/igcpollotto/app-treino/blob/main/app/grupo/%5Bnome%5D.tsx) (Group Detail [nome]), [`app/(tabs)/index.tsx`](https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/index.tsx) (Tab Home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["Expo Router Routes"]
  node_root_layout["Root Layout<br/>router layout<br/>[_layout.tsx]"]
  node_tabs_layout["Tabs Layout<br/>tab navigator<br/>[_layout.tsx]"]
  node_tab_index["Tab Home<br/>route screen<br/>[index.tsx]"]
  node_explore["Explore<br/>route screen<br/>[explore.tsx]"]
  node_home["Home<br/>route screen<br/>[home.tsx]"]
  node_registration["Registration<br/>route screen<br/>[cadastro.tsx]"]
  node_group_detail["Group Detail &#91;nome&#93;<br/>dynamic route<br/>[&#91;nome&#93;.tsx]"]
end

subgraph group_domain["Domain &amp; Services"]
  node_muscle_groups["Muscle Groups<br/>static domain data"]
  node_firebase{{"Firebase Service<br/>backend service<br/>[firebase.ts]"}}
end

subgraph group_ui["Shared UI"]
  node_themed_view["Themed View<br/>UI primitive<br/>[themed-view.tsx]"]
  node_themed_text["Themed Text<br/>UI primitive<br/>[themed-text.tsx]"]
  node_theme["Theme Constants<br/>theme definitions<br/>[theme.ts]"]
end

node_expo{{"Expo Runtime<br/>mobile runtime"}}

node_expo -->|"starts"| node_root_layout
node_root_layout -->|"hosts"| node_tabs_layout
node_root_layout -->|"routes to"| node_home
node_root_layout -->|"routes to"| node_registration
node_root_layout -->|"routes to"| node_group_detail
node_tabs_layout -->|"tab"| node_tab_index
node_tabs_layout -->|"tab"| node_explore
node_group_detail -->|"loads group"| node_muscle_groups
node_registration -->|"uses"| node_firebase
node_themed_view -->|"uses"| node_theme
node_themed_text -->|"uses"| node_theme
node_home -.->|"composes"| node_themed_view
node_tab_index -.->|"composes"| node_themed_text
node_explore -->|"navigates to"| node_group_detail

click node_root_layout "https://github.com/igcpollotto/app-treino/blob/main/app/_layout.tsx"
click node_tabs_layout "https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/_layout.tsx"
click node_tab_index "https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/index.tsx"
click node_explore "https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/explore.tsx"
click node_home "https://github.com/igcpollotto/app-treino/blob/main/app/home.tsx"
click node_registration "https://github.com/igcpollotto/app-treino/blob/main/app/cadastro.tsx"
click node_group_detail "https://github.com/igcpollotto/app-treino/blob/main/app/grupo/%5Bnome%5D.tsx"
click node_muscle_groups "https://github.com/igcpollotto/app-treino/blob/main/src/data/gruposMusculares.ts"
click node_firebase "https://github.com/igcpollotto/app-treino/blob/main/src/services/firebase.ts"
click node_themed_view "https://github.com/igcpollotto/app-treino/blob/main/components/themed-view.tsx"
click node_themed_text "https://github.com/igcpollotto/app-treino/blob/main/components/themed-text.tsx"
click node_theme "https://github.com/igcpollotto/app-treino/blob/main/constants/theme.ts"

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_root_layout,node_tabs_layout,node_tab_index,node_explore,node_home,node_registration,node_group_detail toneBlue
class node_muscle_groups,node_firebase toneAmber
class node_themed_view,node_themed_text,node_theme toneMint
class node_expo toneNeutral
```

## Components

### Expo Router Routes

Filesystem routes and navigation layouts.

- [Root Layout](https://github.com/igcpollotto/app-treino/blob/main/app/_layout.tsx): router layout · Establishes the app-wide navigation hierarchy. · `app/_layout.tsx`
- [Tabs Layout](https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/_layout.tsx): tab navigator · Provides persistent primary navigation. · `app/(tabs)/_layout.tsx`
- [Tab Home](https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/index.tsx): route screen · `app/(tabs)/index.tsx`
- [Explore](https://github.com/igcpollotto/app-treino/blob/main/app/(tabs)/explore.tsx): route screen · `app/(tabs)/explore.tsx`
- [Home](https://github.com/igcpollotto/app-treino/blob/main/app/home.tsx): route screen · `app/home.tsx`
- [Registration](https://github.com/igcpollotto/app-treino/blob/main/app/cadastro.tsx): route screen · Uses the backend service boundary. · `app/cadastro.tsx`
- [Group Detail [nome]](https://github.com/igcpollotto/app-treino/blob/main/app/grupo/%5Bnome%5D.tsx): dynamic route · Resolves the selected muscle group from the route parameter. · `app/grupo/[nome].tsx`

### Domain & Services

Shared content and backend boundary.

- [Muscle Groups](https://github.com/igcpollotto/app-treino/blob/main/src/data/gruposMusculares.ts): static domain data · Shared muscle-group content. · `src/data/gruposMusculares.ts`
- [Firebase Service](https://github.com/igcpollotto/app-treino/blob/main/src/services/firebase.ts): backend service · Encapsulates Firebase access for persistence or authentication. · `src/services/firebase.ts`

### Shared UI

Reusable themed presentation primitives.

- [Themed View](https://github.com/igcpollotto/app-treino/blob/main/components/themed-view.tsx): UI primitive · `components/themed-view.tsx`
- [Themed Text](https://github.com/igcpollotto/app-treino/blob/main/components/themed-text.tsx): UI primitive · `components/themed-text.tsx`
- [Theme Constants](https://github.com/igcpollotto/app-treino/blob/main/constants/theme.ts): theme definitions · Central theme values and resolution. · `constants/theme.ts`

### Other components

- **Expo Runtime**: mobile runtime · Runs the app on Android, iOS, and web.

## Connections

- Expo Runtime → Root Layout: starts
- Root Layout → Tabs Layout: hosts
- Root Layout → Home: routes to
- Root Layout → Registration: routes to
- Root Layout → Group Detail [nome]: routes to
- Tabs Layout → Tab Home: tab
- Tabs Layout → Explore: tab
- Group Detail [nome] → Muscle Groups: loads group
- Registration → Firebase Service: uses
- Themed View → Theme Constants: uses
- Themed Text → Theme Constants: uses
- Home → Themed View: composes
- Tab Home → Themed Text: composes
- Explore → Group Detail [nome]: navigates to
