# camilahad/client-web-angular architecture

> Architecture diagram of the GitHub repository camilahad/client-web-angular, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/camilahad/client-web-angular
- Repository: https://github.com/camilahad/client-web-angular

## Overview

1. **Overall shape**
   - This is an Angular 15 single-page application.
   - The architecture is component- and feature-module-based, with the usual Angular split between shell, routed features, services, models, and environment config.

2. **Application shell**
   - `AppComponent` is the top-level shell, backed by `app.module.ts` and `app-routing.module.ts`.
   - The root shell likely hosts the main layout and the router outlet where feature pages are rendered.

3. **Routing boundaries**
   - Navigation is centralized in the root routing module, with a dedicated routing module for the `medico` feature.
   - This suggests route-driven screen composition, where pages are swapped by the Angular Router rather than by manual view management.

4. **Feature modules**
   - The repo is organized into feature areas under `src/app/components/`:
     - `home`
     - `medico`
     - `paciente`
     - `mensagem`
     - `menu`
   - `medico` and `paciente` each have their own Angular module, indicating bounded feature areas rather than one flat component set.

5. **Medico subsystem**
   - The `medico` feature is the most complete and looks CRUD-oriented:
     - `medico-index` for listing
     - `medico-create` for creation
     - `medico-edit` for editing
   - There is also a `medico-routing.module.ts`, which likely ties these screens together under a feature route namespace.
   - This feature is the clearest example of the app’s data-driven workflow: list → create/edit → persist.

6. **Paciente subsystem**
   - `paciente` currently has `paciente-index` and `paciente-create`, plus its own module.
   - Compared with `medico`, it appears partially implemented or simpler in scope, with no dedicated edit component visible in the tree.
   - Architecturally, it mirrors the same feature-based screen pattern.

7. **Shared UI / navigation**
   - `menu.component` is a shared navigation element, likely used by the app shell to move between home and feature routes.
   - `mensagem-erro404` is a reusable error/message page component, probably used as the fallback route for unknown URLs.

8. **Data model layer**
   - The explicit model layer is small: `models/medico.model.ts`.
   - This indicates domain data is represented with TypeScript interfaces/classes rather than being embedded directly in components.
   - The presence of a single model file suggests the domain model is still narrow or only partially extracted.

9. **Service layer and external data access**
   - There is a `services/medico/medico.service.ts`, which is the main boundary between UI and data access.
   - Even without the implementation, this strongly suggests `medico` data is fetched/persisted through a service abstraction, likely via HTTP to a backend API.
   - No equivalent patient service is visible, so `paciente` may be using inline/local logic or the service is not present in this tree.

10. **Environment and deployment configuration**
   - `src/environments/environment.ts` and `environment.prod.ts` show standard Angular environment-based configuration.
   - This is the main switch point for environment-specific values such as API base URLs, build behavior, or feature flags.

11. **Runtime entry points**
   - `main.ts`, `index.html`, and `polyfills.ts` are standard Angular bootstrap files.
   - `styles.css` and per-component CSS files indicate styling is mostly component-scoped with a global stylesheet for app-wide rules.

12. **Testing and build**
   - Each major component and the service have `.spec.ts` files, so unit testing is set up around UI and service boundaries.
   - The project uses the Angular CLI toolchain (`angular.json`, `package.json`, Karma-based tests per README) for build, serve, and test workflows.

13. **Diagramming summary**
   - A good architecture diagram would show:
     - the Angular shell at the center,
     - router-driven feature modules around it,
     - shared menu/navigation across the top,
     - `medico` as a CRUD feature with a service/model-backed data path,
     - `paciente` as a parallel feature area,
     - and a fallback 404/message component for invalid routes.

Main entry points: [`src/app/services/medico/medico.service.ts`](https://github.com/camilahad/client-web-angular/blob/main/src/app/services/medico/medico.service.ts) (Medico service), [`src/app/app-routing.module.ts`](https://github.com/camilahad/client-web-angular/blob/main/src/app/app-routing.module.ts) (App routing), [`src/app/components/medico/medico-routing.module.ts`](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-routing.module.ts) (Medico routing), [`src/app/app.module.ts`](https://github.com/camilahad/client-web-angular/blob/main/src/app/app.module.ts) (App module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Shell"]
  node_app_module["App module<br/>Angular module<br/>[app.module.ts]"]
  node_app_routing["App routing<br/>Router config"]
  node_app_component["App shell<br/>Root component<br/>[app.component.ts]"]
end

subgraph group_g2["Features"]
  node_home_component["Home<br/>Landing page<br/>[home.component.ts]"]
  node_medico_module["Medico module<br/>Feature module<br/>[medico.module.ts]"]
  node_medico_routing["Medico routing<br/>Feature routes"]
  node_medico_index["Medico list<br/>List screen"]
  node_medico_create["Medico create<br/>Form screen"]
  node_medico_edit["Medico edit<br/>Form screen"]
  node_paciente_module["Paciente module<br/>Feature module<br/>[paciente.module.ts]"]
  node_paciente_index["Paciente list<br/>List screen"]
  node_paciente_create["Paciente create<br/>Form screen"]
end

subgraph group_g3["Shared"]
  node_menu_component["Menu<br/>Nav component<br/>[menu.component.ts]"]
  node_erro404_component["404 message<br/>Fallback page"]
end

subgraph group_g4["Data"]
  node_medico_model["Medico model<br/>Domain model<br/>[medico.model.ts]"]
  node_medico_service["Medico service<br/>API service<br/>[medico.service.ts]"]
end

subgraph group_g5["Runtime"]
  node_main_ts(("Bootstrap<br/>Entry point<br/>[main.ts]"))
  node_index_html["Index page<br/>Host page<br/>[index.html]"]
  node_env_dev["Env dev<br/>Config<br/>[environment.ts]"]
  node_env_prod["Env prod<br/>Config"]
end

node_main_ts -->|"bootstraps"| node_app_module
node_index_html -->|"loads"| node_main_ts
node_app_module -->|"declares"| node_app_component
node_app_module -->|"imports"| node_app_routing
node_app_component -->|"uses"| node_menu_component
node_app_component -->|"hosts"| node_home_component
node_app_routing -->|"routes to"| node_home_component
node_app_routing -->|"lazy/feature route"| node_medico_routing
node_app_routing -->|"feature route"| node_paciente_module
node_app_routing -->|"fallback"| node_erro404_component
node_medico_module -->|"imports"| node_medico_routing
node_medico_routing -->|"lists"| node_medico_index
node_medico_routing -->|"creates"| node_medico_create
node_medico_routing -->|"edits"| node_medico_edit
node_medico_index -->|"reads"| node_medico_service
node_medico_create -->|"writes"| node_medico_service
node_medico_edit -->|"updates"| node_medico_service
node_medico_service -->|"uses"| node_medico_model
node_medico_service -.->|"configures"| node_env_dev
node_medico_service -.->|"configures"| node_env_prod
node_paciente_module -->|"declares"| node_paciente_index
node_paciente_module -->|"declares"| node_paciente_create

click node_app_module "https://github.com/camilahad/client-web-angular/blob/main/src/app/app.module.ts"
click node_app_routing "https://github.com/camilahad/client-web-angular/blob/main/src/app/app-routing.module.ts"
click node_app_component "https://github.com/camilahad/client-web-angular/blob/main/src/app/app.component.ts"
click node_home_component "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/home/home.component.ts"
click node_medico_module "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico.module.ts"
click node_medico_routing "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-routing.module.ts"
click node_medico_index "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-index/medico-index.component.ts"
click node_medico_create "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-create/medico-create.component.ts"
click node_medico_edit "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-edit/medico-edit.component.ts"
click node_paciente_module "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/paciente/paciente.module.ts"
click node_paciente_index "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/paciente/paciente-index/paciente-index.component.ts"
click node_paciente_create "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/paciente/paciente-create/paciente-create.component.ts"
click node_menu_component "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/menu/menu.component.ts"
click node_erro404_component "https://github.com/camilahad/client-web-angular/blob/main/src/app/components/mensagem/mensagem-erro404/mensagem-erro404.component.ts"
click node_medico_model "https://github.com/camilahad/client-web-angular/blob/main/src/app/models/medico.model.ts"
click node_medico_service "https://github.com/camilahad/client-web-angular/blob/main/src/app/services/medico/medico.service.ts"
click node_main_ts "https://github.com/camilahad/client-web-angular/blob/main/src/main.ts"
click node_index_html "https://github.com/camilahad/client-web-angular/blob/main/src/index.html"
click node_env_dev "https://github.com/camilahad/client-web-angular/blob/main/src/environments/environment.ts"
click node_env_prod "https://github.com/camilahad/client-web-angular/blob/main/src/environments/environment.prod.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_app_module,node_app_routing,node_app_component toneBlue
class node_home_component,node_medico_module,node_medico_routing,node_medico_index,node_medico_create,node_medico_edit,node_paciente_module,node_paciente_index,node_paciente_create toneAmber
class node_menu_component,node_erro404_component toneMint
class node_medico_model,node_medico_service toneRose
class node_main_ts,node_index_html,node_env_dev,node_env_prod toneIndigo
```

## Components

### Shell

Top-level application bootstrap and routing

- [App module](https://github.com/camilahad/client-web-angular/blob/main/src/app/app.module.ts): Angular module · Root module that assembles the application · `src/app/app.module.ts`
- [App routing](https://github.com/camilahad/client-web-angular/blob/main/src/app/app-routing.module.ts): Router config · Top-level route definitions and feature entry points · `src/app/app-routing.module.ts`
- [App shell](https://github.com/camilahad/client-web-angular/blob/main/src/app/app.component.ts): Root component · Main application shell hosting routed content · `src/app/app.component.ts`

### Features

Route-driven feature areas

- [Home](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/home/home.component.ts): Landing page · Default home screen · `src/app/components/home/home.component.ts`
- [Medico module](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico.module.ts): Feature module · Medical practitioner feature area · `src/app/components/medico/medico.module.ts`
- [Medico routing](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-routing.module.ts): Feature routes · Routes for medico screens · `src/app/components/medico/medico-routing.module.ts`
- [Medico list](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-index/medico-index.component.ts): List screen · Displays medicos and entry actions · `src/app/components/medico/medico-index/medico-index.component.ts`
- [Medico create](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-create/medico-create.component.ts): Form screen · Creates a medico record · `src/app/components/medico/medico-create/medico-create.component.ts`
- [Medico edit](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/medico/medico-edit/medico-edit.component.ts): Form screen · Edits an existing medico record · `src/app/components/medico/medico-edit/medico-edit.component.ts`
- [Paciente module](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/paciente/paciente.module.ts): Feature module · Patient feature area · `src/app/components/paciente/paciente.module.ts`
- [Paciente list](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/paciente/paciente-index/paciente-index.component.ts): List screen · Displays patients and entry actions · `src/app/components/paciente/paciente-index/paciente-index.component.ts`
- [Paciente create](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/paciente/paciente-create/paciente-create.component.ts): Form screen · Creates a patient record · `src/app/components/paciente/paciente-create/paciente-create.component.ts`

### Shared

Reusable UI and message components

- [Menu](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/menu/menu.component.ts): Nav component · Shared navigation across the app · `src/app/components/menu/menu.component.ts`
- [404 message](https://github.com/camilahad/client-web-angular/blob/main/src/app/components/mensagem/mensagem-erro404/mensagem-erro404.component.ts): Fallback page · Unknown-route or error message screen · `src/app/components/mensagem/mensagem-erro404/mensagem-erro404.component.ts`

### Data

Domain model and service layer

- [Medico model](https://github.com/camilahad/client-web-angular/blob/main/src/app/models/medico.model.ts): Domain model · Medico data shape used across the app · `src/app/models/medico.model.ts`
- [Medico service](https://github.com/camilahad/client-web-angular/blob/main/src/app/services/medico/medico.service.ts): API service · Data access boundary for medico records · `src/app/services/medico/medico.service.ts`

### Runtime

Angular entry and environment files

- [Bootstrap](https://github.com/camilahad/client-web-angular/blob/main/src/main.ts): Entry point · Angular application bootstrap · `src/main.ts`
- [Index page](https://github.com/camilahad/client-web-angular/blob/main/src/index.html): Host page · Browser host document for the SPA · `src/index.html`
- [Env dev](https://github.com/camilahad/client-web-angular/blob/main/src/environments/environment.ts): Config · Development environment settings · `src/environments/environment.ts`
- [Env prod](https://github.com/camilahad/client-web-angular/blob/main/src/environments/environment.prod.ts): Config · Production environment settings · `src/environments/environment.prod.ts`

## Connections

- Bootstrap → App module: bootstraps · Angular bootstraps the root module
- Index page → Bootstrap: loads · Browser loads the SPA entry bundle
- App module → App shell: declares · Root module declares the shell component
- App module → App routing: imports · Root module wires in routing
- App shell → Menu: uses · Shell renders shared navigation
- App shell → Home: hosts · Shell provides outlet for the home screen
- App routing → Home: routes to · Default route goes to home
- App routing → Medico routing: lazy/feature route · Routes into the medico feature
- App routing → Paciente module: feature route · Routes into the paciente feature
- App routing → 404 message: fallback · Unknown routes resolve to the 404 message page
- Medico module → Medico routing: imports · Feature module wires its own routes
- Medico routing → Medico list: lists · Feature route opens the index screen
- Medico routing → Medico create: creates · Feature route opens the create form
- Medico routing → Medico edit: edits · Feature route opens the edit form
- Medico list → Medico service: reads · List screen fetches medico data
- Medico create → Medico service: writes · Create form persists medico data
- Medico edit → Medico service: updates · Edit form persists medico changes
- Medico service → Medico model: uses · Service operates on medico domain objects
- Medico service → Env dev: configures · Service behavior is environment-driven
- Medico service → Env prod: configures · Production settings alter service/runtime configuration
- Paciente module → Paciente list: declares · Paciente module includes its list screen
- Paciente module → Paciente create: declares · Paciente module includes its create screen
