# pedromancini/agropecuaria-polar architecture

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

- Interactive diagram: https://gitdiagram.com/pedromancini/agropecuaria-polar
- Repository: https://github.com/pedromancini/agropecuaria-polar

## Overview

##### Project type and purpose
- This is a static, multi-page front-end web application called “Agropecuária Polar.”
- Purpose: allow users to register/login, manage (CRUD) pet records, select agro-services and schedule appointments.

##### File structure
- Top-level HTML pages grouped by feature:
- Authentication: LoginRegistro.html, PaginaDeCadastro.html, ContaCriadaComSucesso.html, ContaLogadaComSucesso.html
- Pet management: CadastraPet.html, PetsCadastrados.html
- Service scheduling: SelecionaServico.html, agendamento.html
- Entry point: index.html
- Shared assets:
- css/ (all page styles + navbar/cards)
- img/ (static images)
- JS scripts: cadastrapet.js (pet registration logic), script.js (global UI behavior)
- No server-side code in the repo—assumes a static file server or GitHub Pages host.

##### Key insights from README
- Entirely HTML5, CSS3, JavaScript.
- No mention of a backend API or database; likely uses browser storage (e.g., localStorage) or a placeholder for a future service.

##### Main components
a. User (actor)
b. Web Browser (client)
- UI layer (HTML pages + CSS styles)
- Client-side logic (script.js, cadastrapet.js)
- Data storage (localStorage or stubbed remote API)
c. Static File Server (or CDN host)
- Serves HTML, CSS, JS, images

##### Relationships and data flow
- User ↔ Browser (interacts with UI forms & views)
- Browser → Static Server (HTTP GET for HTML/CSS/JS assets)
- Browser (JS) ↔ localStorage or remote API
- On registration/login pages: store or validate user credentials
- On CadastraPet: save new pet records
- On PetsCadastrados: retrieve & display saved pets
- On SelecionaServico/agendamento: manage service-booking data

##### Architectural patterns & design principles
- Client-driven, page-based navigation (multi-page app)
- Separation of concerns:
- Presentation (HTML/CSS)
- Behavior (modular JS files)
- Assets (images, shared styles)
- Feature grouping by directory/page naming

##### Technologies & frameworks
- HTML5 (structure)
- CSS3 (layout, responsive design via cards/navbar)
- Vanilla JavaScript (DOM manipulation, event handling, storage)

##### Elements
- Annotations for key technologies (HTML5, CSS3, JS)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    User("User"):::external
    User -->|interacts with| Browser

    %% Browser Container
    subgraph "Web Browser" 
        direction TB
        subgraph "UI Pages" 
            direction TB
            Login["LoginRegistro.html"]:::featureAuth
            PaginaCadastro["PaginaDeCadastro.html"]:::featureAuth
            ContaCriada["ContaCriadaComSucesso.html"]:::featureAuth
            ContaLogada["ContaLogadaComSucesso.html"]:::featureAuth
            CadastraPet["CadastraPet.html"]:::featurePet
            PetsCadastrados["PetsCadastrados.html"]:::featurePet
            SelecionaServico["SelecionaServico.html"]:::featureSched
            Agendamento["agendamento.html"]:::featureSched
            Index["index.html"]:::frontend
        end
        subgraph "CSS Styles" 
            direction TB
            GlobalCSS["css/style.css"]:::frontend
            NavbarCSS["css/navbar.css"]:::frontend
            CardsCSS["css/cards.css"]:::frontend
            LoginCSS["css/LoginRegistro.css"]:::featureAuth
            PaginaCadastroCSS["css/PaginaDeCadastro.css"]:::featureAuth
            ContaCriadaCSS["css/ContaCriadaComSucesso.css"]:::featureAuth
            ContaLogadaCSS["css/ContaLogadaComSucesso.css"]:::featureAuth
            CadastraPetCSS["css/CadastraPet.css"]:::featurePet
            PetsCadastradosCSS["css/PetsCadastrados.css"]:::featurePet
            SelecionaServicoCSS["css/SelecionaServico.css"]:::featureSched
            AgendamentoCSS["css/agendamento.css"]:::featureSched
            PagAgendamentoCSS["css/pagAgendamento.css"]:::featureSched
        end
        subgraph "JS Logic" 
            direction TB
            ScriptJS["script.js"]:::frontend
            CadastraPetJS["cadastrapet.js"]:::frontend
        end
        subgraph "Data Storage" 
            direction TB
            LocalStorage[(localStorage)]:::storage
        end

        %% Data flows in Browser
        ScriptJS -->|read/write| LocalStorage
        CadastraPetJS -->|read/write| LocalStorage
        Login -->|uses JS| ScriptJS
        PaginaCadastro -->|uses JS| ScriptJS
        CadastraPet -->|uses JS| CadastraPetJS
    end

    %% Server Container
    subgraph "Static File Server / CDN" 
        direction TB
        HTMLFiles["HTML Files"]:::server
        CSSDir["css/"]:::server
        IMGDir["img/"]:::server
        JSDir["js/"]:::server
        Docs["README.MD"]:::server
    end

    Browser -->|HTTP GET assets| HTMLFiles
    Browser -->|HTTP GET assets| CSSDir
    Browser -->|HTTP GET assets| IMGDir
    Browser -->|HTTP GET assets| JSDir

    %% Click events
    click Login "https://github.com/pedromancini/agropecuaria-polar/blob/master/LoginRegistro.html"
    click PaginaCadastro "https://github.com/pedromancini/agropecuaria-polar/blob/master/PaginaDeCadastro.html"
    click ContaCriada "https://github.com/pedromancini/agropecuaria-polar/blob/master/ContaCriadaComSucesso.html"
    click ContaLogada "https://github.com/pedromancini/agropecuaria-polar/blob/master/ContaLogadaComSucesso.html"
    click CadastraPet "https://github.com/pedromancini/agropecuaria-polar/blob/master/CadastraPet.html"
    click PetsCadastrados "https://github.com/pedromancini/agropecuaria-polar/blob/master/PetsCadastrados.html"
    click SelecionaServico "https://github.com/pedromancini/agropecuaria-polar/blob/master/SelecionaServico.html"
    click Agendamento "https://github.com/pedromancini/agropecuaria-polar/blob/master/agendamento.html"
    click Index "https://github.com/pedromancini/agropecuaria-polar/blob/master/index.html"
    click ScriptJS "https://github.com/pedromancini/agropecuaria-polar/blob/master/script.js"
    click CadastraPetJS "https://github.com/pedromancini/agropecuaria-polar/blob/master/cadastrapet.js"
    click GlobalCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/style.css"
    click NavbarCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/navbar.css"
    click CardsCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/cards.css"
    click LoginCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/LoginRegistro.css"
    click PaginaCadastroCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/PaginaDeCadastro.css"
    click ContaCriadaCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/ContaCriadaComSucesso.css"
    click ContaLogadaCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/ContaLogadaComSucesso.css"
    click CadastraPetCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/CadastraPet.css"
    click PetsCadastradosCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/PetsCadastrados.css"
    click SelecionaServicoCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/SelecionaServico.css"
    click AgendamentoCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/agendamento.css"
    click PagAgendamentoCSS "https://github.com/pedromancini/agropecuaria-polar/blob/master/css/pagAgendamento.css"
    click IMGDir "https://github.com/pedromancini/agropecuaria-polar/tree/master/img/"
    click Docs "https://github.com/pedromancini/agropecuaria-polar/blob/master/README.MD"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef server fill:#d4edda,stroke:#155724,color:#155724
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24
    classDef storage fill:#ffeeba,stroke:#856404,color:#856404
    classDef featureAuth fill:#fff3cd,stroke:#856404,color:#856404
    classDef featurePet fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef featureSched fill:#d1ecf1,stroke:#0c5460,color:#0c5460
```
