# leandrofochesatto/meu-projeto-x architecture

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

- Interactive diagram: https://gitdiagram.com/leandrofochesatto/meu-projeto-x
- Repository: https://github.com/leandrofochesatto/meu-projeto-x

## Overview

This Ionic/Angular mobile app provides a home screen and four demos: JSONPlaceholder-backed posts and photos, a WebSocket messaging page, and an MQTT temperature client. Users enter through the app router, which lazy-loads pages; data pages call their services and render returned models, while messaging pages interact with their respective connection services. The source excerpts establish page-to-service calls and MQTT broker configuration. The WebSocket service endpoints and the details of the posts/photo HTTP requests were not shown, so those external connections are marked unverified.

Main entry points: [`src/app/app-routing.module.ts`](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/app-routing.module.ts) (App routing), [`src/app/services/post.service.ts`](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/post.service.ts) (Post service), [`src/app/services/photo.service.ts`](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/photo.service.ts) (Photo service), [`src/app/pages/posts/posts.page.ts`](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/posts/posts.page.ts) (Posts page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_appmodule["App module<br/>[app.module.ts]"]
  node_routing["App routing"]
  node_home["Home page<br/>[home.page.ts]"]
end

subgraph group_content["Content Browsing"]
  node_posts["Posts page<br/>[posts.page.ts]"]
  node_photos["Photos page<br/>[photos.page.ts]"]
end

subgraph group_realtime["Realtime Demos"]
  node_wsdemo["WebSocket page"]
  node_wsservice["WebSocket service"]
  node_nativews["Native WebSocket"]
  node_mqttpage["MQTT test page<br/>[mqtt-test.page.ts]"]
  node_mqttservice["MQTT service<br/>[mqtt.service.ts]"]
end

subgraph group_support["Data Services"]
  node_postmodel["Post model<br/>[post.ts]"]
  node_photomodel["Photo model<br/>[photo.ts]"]
  node_postservice["Post service<br/>[post.service.ts]"]
  node_photoservice["Photo service<br/>[photo.service.ts]"]
  node_environment["API config<br/>[environment.ts]"]
end

node_user(("App user"))
node_api["JSONPlaceholder API"]
node_wsserver["WebSocket server"]
node_broker["HiveMQ broker"]

node_user -->|"opens app"| node_routing
node_appmodule -->|"loads routes"| node_routing
node_routing -->|"routes to"| node_home
node_routing -->|"routes to"| node_posts
node_routing -->|"routes to"| node_photos
node_routing -->|"routes to"| node_wsdemo
node_routing -->|"routes to"| node_mqttpage
node_posts -->|"requests posts"| node_postservice
node_photos -->|"requests photos"| node_photoservice
node_postservice -->|"uses model"| node_postmodel
node_photoservice -->|"uses model"| node_photomodel
node_posts -->|"renders data"| node_postmodel
node_photos -->|"filters data"| node_photomodel
node_postservice -->|"reads config"| node_environment
node_photoservice -->|"reads config"| node_environment
node_postservice -.->|"fetches posts"| node_api
node_photoservice -.->|"fetches photos"| node_api
node_wsdemo -->|"connects and sends"| node_wsservice
node_wsdemo -->|"optional client"| node_nativews
node_wsservice -.->|"exchanges messages"| node_wsserver
node_nativews -.->|"exchanges messages"| node_wsserver
node_mqttpage -->|"uses client"| node_mqttservice
node_mqttservice -->|"connects and publishes"| node_broker

click node_appmodule "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/app.module.ts"
click node_routing "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/app-routing.module.ts"
click node_home "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/home/home.page.ts"
click node_posts "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/posts/posts.page.ts"
click node_photos "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/photos/photos.page.ts"
click node_postmodel "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/models/post.ts"
click node_photomodel "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/models/photo.ts"
click node_postservice "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/post.service.ts"
click node_photoservice "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/photo.service.ts"
click node_environment "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/environments/environment.ts"
click node_wsdemo "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/websocket-demo/websocket-demo.page.ts"
click node_wsservice "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/websocket.service.ts"
click node_nativews "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/websocket-nativo.service.ts"
click node_mqttpage "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/mqtt-test/mqtt-test.page.ts"
click node_mqttservice "https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/mqtt.service.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_appmodule,node_routing,node_home,node_user toneBlue
class node_posts,node_photos toneAmber
class node_wsdemo,node_wsservice,node_nativews,node_mqttpage,node_mqttservice,node_api,node_wsserver toneMint
class node_postmodel,node_photomodel,node_postservice,node_photoservice,node_environment toneRose
class node_broker toneIndigo
```

## Components

### App Shell

- [App module](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/app.module.ts): `src/app/app.module.ts`
- [App routing](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/app-routing.module.ts): `src/app/app-routing.module.ts`
- [Home page](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/home/home.page.ts): `src/app/pages/home/home.page.ts`

### Content Browsing

- [Posts page](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/posts/posts.page.ts): `src/app/pages/posts/posts.page.ts`
- [Photos page](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/photos/photos.page.ts): `src/app/pages/photos/photos.page.ts`

### Realtime Demos

- [WebSocket page](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/websocket-demo/websocket-demo.page.ts): `src/app/pages/websocket-demo/websocket-demo.page.ts`
- [WebSocket service](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/websocket.service.ts): `src/app/services/websocket.service.ts`
- [Native WebSocket](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/websocket-nativo.service.ts): `src/app/services/websocket-nativo.service.ts`
- [MQTT test page](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/pages/mqtt-test/mqtt-test.page.ts): `src/app/pages/mqtt-test/mqtt-test.page.ts`
- [MQTT service](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/mqtt.service.ts): `src/app/services/mqtt.service.ts`

### Data Services

- [Post model](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/models/post.ts): `src/app/models/post.ts`
- [Photo model](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/models/photo.ts): `src/app/models/photo.ts`
- [Post service](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/post.service.ts): `src/app/services/post.service.ts`
- [Photo service](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/app/services/photo.service.ts): `src/app/services/photo.service.ts`
- [API config](https://github.com/leandrofochesatto/meu-projeto-x/blob/main/src/environments/environment.ts): `src/environments/environment.ts`

### Other components

- **App user**
- **JSONPlaceholder API**
- **WebSocket server**
- **HiveMQ broker**

## Connections

- App user → App routing: opens app
- App module → App routing: loads routes (evidence: `src/app/app.module.ts`)
- App routing → Home page: routes to (evidence: `src/app/app-routing.module.ts`)
- App routing → Posts page: routes to (evidence: `src/app/app-routing.module.ts`)
- App routing → Photos page: routes to (evidence: `src/app/app-routing.module.ts`)
- App routing → WebSocket page: routes to (evidence: `src/app/app-routing.module.ts`)
- App routing → MQTT test page: routes to (evidence: `src/app/app-routing.module.ts`)
- Posts page → Post service: requests posts (evidence: `src/app/pages/posts/posts.page.ts`)
- Photos page → Photo service: requests photos (evidence: `src/app/pages/photos/photos.page.ts`)
- Post service → Post model: uses model (evidence: `src/app/services/post.service.ts`)
- Photo service → Photo model: uses model (evidence: `src/app/services/photo.service.ts`)
- Posts page → Post model: renders data (evidence: `src/app/pages/posts/posts.page.ts`)
- Photos page → Photo model: filters data (evidence: `src/app/pages/photos/photos.page.ts`)
- Post service → API config: reads config (evidence: `src/app/services/post.service.ts`)
- Photo service → API config: reads config (evidence: `src/app/services/photo.service.ts`)
- Post service → JSONPlaceholder API: fetches posts
- Photo service → JSONPlaceholder API: fetches photos
- WebSocket page → WebSocket service: connects and sends (evidence: `src/app/pages/websocket-demo/websocket-demo.page.ts`)
- WebSocket page → Native WebSocket: optional client (evidence: `src/app/pages/websocket-demo/websocket-demo.page.ts`)
- WebSocket service → WebSocket server: exchanges messages
- Native WebSocket → WebSocket server: exchanges messages
- MQTT test page → MQTT service: uses client (evidence: `src/app/pages/mqtt-test/mqtt-test.page.ts`)
- MQTT service → HiveMQ broker: connects and publishes (evidence: `src/app/services/mqtt.service.ts`)
