# joao-henrique5557/easy-health architecture

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

- Interactive diagram: https://gitdiagram.com/joao-henrique5557/easy-health
- Repository: https://github.com/joao-henrique5557/easy-health

## Overview

Easy Health is a mobile health hub: users find care, review availability and book appointments, while also accessing emergency guidance, first-aid information, and personal health records. The frontend exposes these journeys through navigation, screens, and API services; a Spring backend provides catalog, booking, account, and personal-data endpoints. The README documents product capabilities and the user-facing flow; sampled backend and service excerpts confirm selected implementation links. Several frontend screens and backend routes were not sampled, so their connections are shown only where documented.

Main entry points: [`backend/src/main/java/br/com/easyhealth/service/AuthService.java`](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/service/AuthService.java) (Authentication service), [`frontend/src/screens`](https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens) (Care screens), [`frontend/src/navigation/RootNavigator.jsx`](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/navigation/RootNavigator.jsx) (App navigation), [`frontend/src/services/api.js`](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/api.js) (HTTP API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mobile experience"]
  node_navigation["App navigation<br/>[RootNavigator.jsx]"]
  node_care_screens["Care screens"]
  node_personal_screens["Personal health screens"]
  node_assistant["Assistant panel<br/>[AssistantPanel.jsx]"]
  node_auth_ui["Account screens"]
  node_api_client["HTTP API client<br/>[api.js]"]
  node_token_storage[("Token storage<br/>[tokenStorage.js]")]
end

subgraph group_care["Care discovery"]
  node_care_api["Care API services"]
  node_catalog["Care and guide catalog"]
  node_availability["Appointment availability"]
  node_booking["Booking and personal data"]
  node_emergency["Emergency support"]
end

subgraph group_health["Health information"]
  node_first_aid["First-aid content<br/>[firstAidService.js]"]
  node_history["Health history<br/>[historyService.js]"]
  node_profile["Profile management"]
  node_personal_data_ui["Personal data screens"]
end

subgraph group_backend["Backend services"]
  node_auth_service["Authentication service<br/>[AuthService.java]"]
  node_auth_controller["Authentication endpoints"]
  node_user_repo[("User repository")]
  node_token_repo[("Token repository")]
  node_assistant_endpoint["Assistant endpoint"]
end

node_user(("Health app user"))

node_user -->|"uses"| node_navigation
node_navigation -->|"routes to"| node_care_screens
node_navigation -->|"routes to"| node_personal_screens
node_user -->|"registers or signs in"| node_auth_ui
node_auth_ui -->|"submits credentials"| node_auth_service
node_auth_service -->|"sends requests"| node_api_client
node_api_client -->|"reads and saves"| node_token_storage
node_api_client -->|"calls endpoints"| node_auth_controller
node_auth_controller -->|"delegates"| node_auth_service
node_auth_service -->|"reads and writes"| node_user_repo
node_auth_service -->|"stores and checks"| node_token_repo
node_care_screens -->|"requests care"| node_care_api
node_care_api -->|"searches services"| node_catalog
node_catalog -->|"uses availability"| node_availability
node_care_screens -->|"books appointments"| node_booking
node_booking -->|"checks identity"| node_auth_service
node_care_screens -->|"requests emergency help"| node_emergency
node_care_screens -->|"opens guides"| node_first_aid
node_personal_screens -->|"views health history"| node_history
node_personal_screens -->|"updates profile"| node_profile
node_assistant -->|"sends conversation"| node_assistant_endpoint
node_assistant -->|"guides navigation"| node_navigation

click node_navigation "https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/navigation/RootNavigator.jsx"
click node_care_screens "https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens"
click node_personal_screens "https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens"
click node_assistant "https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/components/AssistantPanel.jsx"
click node_care_api "https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/services"
click node_catalog "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/CatalogController.java"
click node_availability "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/service/AppointmentAvailability.java"
click node_booking "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/PersonalDataController.java"
click node_emergency "https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/emergencyService.js"
click node_first_aid "https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/firstAidService.js"
click node_history "https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/historyService.js"
click node_profile "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/UserController.java"
click node_personal_data_ui "https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens"
click node_auth_ui "https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens"
click node_auth_service "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/service/AuthService.java"
click node_auth_controller "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/AuthController.java"
click node_user_repo "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/repository/UserRepository.java"
click node_token_repo "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/repository/TokenRepository.java"
click node_api_client "https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/api.js"
click node_token_storage "https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/tokenStorage.js"
click node_assistant_endpoint "https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/AssistantController.java"

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_navigation,node_care_screens,node_personal_screens,node_assistant,node_auth_ui,node_api_client,node_token_storage,node_user toneBlue
class node_care_api,node_catalog,node_availability,node_booking,node_emergency toneAmber
class node_first_aid,node_history,node_profile,node_personal_data_ui toneMint
class node_auth_service,node_auth_controller,node_user_repo,node_token_repo,node_assistant_endpoint toneRose
```

## Components

### Mobile experience

- [App navigation](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/navigation/RootNavigator.jsx): `frontend/src/navigation/RootNavigator.jsx`
- [Care screens](https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens): `frontend/src/screens`
- [Personal health screens](https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens): `frontend/src/screens`
- [Assistant panel](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/components/AssistantPanel.jsx): `frontend/src/components/AssistantPanel.jsx`
- [Account screens](https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens): `frontend/src/screens`
- [HTTP API client](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Token storage](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/tokenStorage.js): `frontend/src/services/tokenStorage.js`

### Care discovery

- [Care API services](https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/services): `frontend/src/services`
- [Care and guide catalog](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/CatalogController.java): `backend/src/main/java/br/com/easyhealth/controller/CatalogController.java`
- [Appointment availability](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/service/AppointmentAvailability.java): `backend/src/main/java/br/com/easyhealth/service/AppointmentAvailability.java`
- [Booking and personal data](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/PersonalDataController.java): `backend/src/main/java/br/com/easyhealth/controller/PersonalDataController.java`
- [Emergency support](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/emergencyService.js): `frontend/src/services/emergencyService.js`

### Health information

- [First-aid content](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/firstAidService.js): `frontend/src/services/firstAidService.js`
- [Health history](https://github.com/joao-henrique5557/easy-health/blob/master/frontend/src/services/historyService.js): `frontend/src/services/historyService.js`
- [Profile management](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/UserController.java): `backend/src/main/java/br/com/easyhealth/controller/UserController.java`
- [Personal data screens](https://github.com/joao-henrique5557/easy-health/tree/master/frontend/src/screens): `frontend/src/screens`

### Backend services

- [Authentication service](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/service/AuthService.java): `backend/src/main/java/br/com/easyhealth/service/AuthService.java`
- [Authentication endpoints](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/AuthController.java): `backend/src/main/java/br/com/easyhealth/controller/AuthController.java`
- [User repository](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/repository/UserRepository.java): `backend/src/main/java/br/com/easyhealth/repository/UserRepository.java`
- [Token repository](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/repository/TokenRepository.java): `backend/src/main/java/br/com/easyhealth/repository/TokenRepository.java`
- [Assistant endpoint](https://github.com/joao-henrique5557/easy-health/blob/master/backend/src/main/java/br/com/easyhealth/controller/AssistantController.java): `backend/src/main/java/br/com/easyhealth/controller/AssistantController.java`

### Other components

- **Health app user**

## Connections

- Health app user → App navigation: uses
- App navigation → Care screens: routes to
- App navigation → Personal health screens: routes to
- Health app user → Account screens: registers or signs in
- Account screens → Authentication service: submits credentials
- Authentication service → HTTP API client: sends requests
- HTTP API client → Token storage: reads and saves (evidence: `frontend/src/services/api.js`)
- HTTP API client → Authentication endpoints: calls endpoints
- Authentication endpoints → Authentication service: delegates (evidence: `backend/src/main/java/br/com/easyhealth/controller/AuthController.java`)
- Authentication service → User repository: reads and writes (evidence: `backend/src/main/java/br/com/easyhealth/service/AuthService.java`)
- Authentication service → Token repository: stores and checks (evidence: `backend/src/main/java/br/com/easyhealth/service/AuthService.java`)
- Care screens → Care API services: requests care
- Care API services → Care and guide catalog: searches services
- Care and guide catalog → Appointment availability: uses availability (evidence: `backend/src/main/java/br/com/easyhealth/controller/CatalogController.java`)
- Care screens → Booking and personal data: books appointments
- Booking and personal data → Authentication service: checks identity (evidence: `backend/src/main/java/br/com/easyhealth/controller/PersonalDataController.java`)
- Care screens → Emergency support: requests emergency help
- Care screens → First-aid content: opens guides
- Personal health screens → Health history: views health history
- Personal health screens → Profile management: updates profile
- Assistant panel → Assistant endpoint: sends conversation
- Assistant panel → App navigation: guides navigation
