# silascunha97/passaro-urbano architecture

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

- Interactive diagram: https://gitdiagram.com/silascunha97/passaro-urbano
- Repository: https://github.com/silascunha97/passaro-urbano

## Overview

##### Project type and purpose
- This is an Angular single-page application with server-side rendering (SSR) enabled via Angular Universal.
- Purpose: A client-facing web app (“PassaroUrbano”) that displays “ofertas” (offers) and static pages (restaurantes, diversão), reading data from a JSON “banco-de-dados.json” and serving both client and server bundles.

##### File structure
- Top-level build/config files: angular.json, tsconfig*.json, package.json
- “public/” – static assets and JSON database
- “src/server.ts”, “src/main.server.ts”, “src/app/app.module.server.ts”, “src/app/app.routes.server.ts” – Node.js entrypoint and server module for SSR
- “src/main.ts” – client bootstrap
- “src/app/” – Angular modules, routing, components, services, API adapters, interfaces
- “src/app/components/ui” – UI component hierarchy (buttons, pages, header, footer)
- “src/app/components/service” – business logic (OfertasService)
- “src/app/components/api” – HTTP wrappers (app.api.ts)

##### README for additional insights
- Standard Angular CLI project, with `ng serve`, `ng build`, `ng test`, `ng e2e`
- No custom architecture docs, so we rely on file structure to infer SSR, service layers, UI hierarchy.

##### Elements
- HTTP request/response flow
- Data requests from service to JSON file
- Client hydration sequence

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Server Side"
        USRQ["User HTTP GET"]:::external
        EXPRESS["Express Server"]:::server
        MSERVER["Angular Universal Bootstrap"]:::server
        SSR_MOD["Server Module (SSR)"]:::server
        SSR_ROUTES["SSR Routes"]:::server
        SERVICE["OfertasService"]:::service
        API["API Adapter"]:::service
        INTF["Data Interfaces"]:::service

        USRQ -->|"requests"| EXPRESS
        EXPRESS -->|"boots"| MSERVER
        MSERVER -->|"loads"| SSR_MOD
        SSR_MOD -->|"configures"| SSR_ROUTES
        SSR_MOD -->|"uses"| SERVICE
        SERVICE -->|"calls"| API
        API -->|"reads"| INTF
    end

    DB["banco-de-dados.json"]:::data
    ASSETS["public/"]:::data
    API -->|"fetch data"| DB
    SSR_MOD -->|"serves assets"| ASSETS

    SSR_MOD -->|"renders HTML"| BROWSER

    subgraph "Client Side"
        BROWSER["Browser"]:::external
        CLIENT_BOOT["Client Bootstrap"]:::client
        APP_MOD["App Module"]:::client
        ROUTING["Routing Module"]:::client

        BROWSER -->|"hydrates"| CLIENT_BOOT
        CLIENT_BOOT -->|"imports"| APP_MOD
        APP_MOD -->|"registers"| ROUTING
        APP_MOD -->|"injects"| SERVICE
        ROUTING -->|"navigates"| HOME
        ROUTING -->|"navigates"| PAGESD
        ROUTING -->|"navigates"| PAGESR
        SERVICE -->|"calls"| API
        API -->|"reads"| DB
    end

    subgraph "UI Components"
        HEADER["Header"]:::client
        FOOTER["Footer"]:::client
        HOME["Home Page"]:::client
        BTN["Oferta Button"]:::client
        COM["Como Usar"]:::client
        OND["Onde Fica"]:::client
        PAGESD["Diversão Page"]:::client
        PAGESR["Restaurantes Page"]:::client

        BTN -->|"expands"| COM
        BTN -->|"expands"| OND
    end

    classDef server fill:#cccccc,stroke:#333333,color:#000000;
    classDef client fill:#bbddff,stroke:#333333,color:#000000;
    classDef data fill:#ccffcc,stroke:#333333,color:#000000;
    classDef service fill:#ffe699,stroke:#333333,color:#000000;
    classDef external fill:#eeeeee,stroke:#666666,color:#000000;

    click EXPRESS "https://github.com/silascunha97/passaro-urbano/blob/main/src/server.ts"
    click MSERVER "https://github.com/silascunha97/passaro-urbano/blob/main/src/main.server.ts"
    click SSR_MOD "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/app.module.server.ts"
    click SSR_ROUTES "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/app.routes.server.ts"
    click CLIENT_BOOT "https://github.com/silascunha97/passaro-urbano/blob/main/src/main.ts"
    click APP_MOD "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/app.module.ts"
    click ROUTING "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/app-routing.module.ts"
    click DB "https://github.com/silascunha97/passaro-urbano/blob/main/banco-de-dados.json"
    click ASSETS "https://github.com/silascunha97/passaro-urbano/tree/main/public/"
    click SERVICE "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/service/ofertas.service.ts"
    click API "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/api/app.api.ts"
    click INTF "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/interfaces/ofertas.interface.ts"
    click HEADER "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/topo/topo.component.ts"
    click FOOTER "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/rodape/rodape.component.ts"
    click HOME "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/home/home.component.ts"
    click BTN "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/buttons/oferta/oferta.component.ts"
    click COM "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/buttons/oferta/como-usar/como-usar.component.ts"
    click OND "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/buttons/oferta/onde-fica/onde-fica.component.ts"
    click PAGESD "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/pages/diversao/diversao.component.ts"
    click PAGESR "https://github.com/silascunha97/passaro-urbano/blob/main/src/app/components/ui/pages/restaurantes/restaurantes.component.ts"
```
