# dev-vinicius-borges/clinicare architecture

> Architecture diagram of the GitHub repository dev-vinicius-borges/clinicare, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dev-vinicius-borges/clinicare
- Repository: https://github.com/dev-vinicius-borges/clinicare

## Overview

##### Project type and purpose
- This is a cross-platform Flutter application (“Clini_Care”) targeting Android, iOS, Linux, macOS, Windows and Web.
- Its core functionality is user registration/login, client profile management, and medical appointment scheduling.
- The “lib/server” folder contains a lightweight client-side API layer (DTOs, interfaces, models, services) that calls a RESTful backend. The “diagramas/tabelas.sql” hints at a relational database schema on the server side.

##### File structure
- Top-level platform directories (android, ios, linux, macos, windows, web) are all auto-generated Flutter hosts.
- lib/ holds your application code:
- components/ – reusable UI widgets (navigation bars, forms, cards, bottom sheets)
- pages/      – screen layout and navigation (LoginPage, IndexPage, AgendamentosPage, etc.)
- server/     – client-side API layer:
– Dtos/        – request/response payload definitions
– abstracts/   – interface definitions (IClienteInterface, IConsultaInterface, etc.)
– models/      – domain/data models (ClienteModel, ConsultaModel, etc.)
– services/    – concrete implementations that talk over HTTP (ClienteService, ConsultaService, StorageService, etc.)
– session/     – configuration (base URLs, authentication token handling)
- assets/images holds static assets.
- diagramas/tabelas.sql shows the server’s database schema.

##### README for additional insights
- The README only calls out the AGPL-3.0 license. No architectural specifics are documented there, so we infer conventions from the code.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main entry
    Main["Main Application Entry Point\n(main.dart)"]:::frontend

    subgraph "Flutter Application"
        direction TB
        subgraph "Presentation Layer"
            direction TB
            Components["UI Components"]:::frontend
            Pages["Screens/Pages"]:::frontend
        end

        subgraph "Domain Layer"
            direction TB
            Models["Domain Models"]:::domain
            DTOs["Data Transfer Objects (DTOs)"]:::domain
        end

        subgraph "API Client Layer"
            direction TB
            Abstracts["Abstract Interfaces"]:::infra
            Services["API Client Services"]:::infra
            Session["Session Configuration"]:::infra
        end
    end

    RESTAPI["External REST API"]:::external
    DB["Relational Database"]:::database

    %% Relationships
    Main -->|launches| Pages
    Pages -->|uses| Components
    Pages -->|invokes| Services
    Services -->|implements| Abstracts
    Services -->|uses| DTOs
    Services -->|stores token| Session
    Services -->|HTTP calls| RESTAPI
    DTOs -->|serialization| Services
    RESTAPI -->|reads/writes| DB

    %% Click Events
    click Components "https://github.com/dev-vinicius-borges/clinicare/tree/main/lib/components"
    click Pages "https://github.com/dev-vinicius-borges/clinicare/tree/main/lib/pages"
    click Models "https://github.com/dev-vinicius-borges/clinicare/tree/main/lib/server/models"
    click DTOs "https://github.com/dev-vinicius-borges/clinicare/tree/main/lib/server/Dtos"
    click Abstracts "https://github.com/dev-vinicius-borges/clinicare/tree/main/lib/server/abstracts"
    click Services "https://github.com/dev-vinicius-borges/clinicare/tree/main/lib/server/services"
    click Session "https://github.com/dev-vinicius-borges/clinicare/blob/main/lib/server/session/configuracao.dart"
    click Main "https://github.com/dev-vinicius-borges/clinicare/blob/main/lib/main.dart"
    click DB "https://github.com/dev-vinicius-borges/clinicare/blob/main/diagramas/tabelas.sql"

    %% Styles
    classDef frontend fill:#B3CDE3,stroke:#333,stroke-width:1px
    classDef domain fill:#CCEBC5,stroke:#333,stroke-width:1px
    classDef infra fill:#FDD0A2,stroke:#333,stroke-width:1px
    classDef external fill:#FED9A6,stroke:#333,stroke-width:1px
    classDef database fill:#D9D9D9,stroke:#333,stroke-width:1px
    class DB database
    class RESTAPI external
    class Main,Components,Pages frontend
    class Models,DTOs domain
    class Abstracts,Services,Session infra
```
