# hugoofilipe/fugaemfamilia-backoffice architecture

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

- Interactive diagram: https://gitdiagram.com/hugoofilipe/fugaemfamilia-backoffice
- Repository: https://github.com/hugoofilipe/fugaemfamilia-backoffice

## Overview

##### Project type and purpose
- This is a single-page front-office web application (“fuga em familia – frontoffice”) built with Vue.js and JavaScript.
- It serves managers to manage clients, bookings, ads, and automated messages. It’s purely a frontend, consuming a separate backend API.

##### File structure
- Top-level config files: .env.*, vue.config.js, babel.config.js, jsconfig.json, package.json.
- Public assets: public/index.html.
- Source code: src/ with App.vue, main.js, a components/ tree, pages/ tree, router.js. Standard Vue CLI MVC-style organization (components vs pages vs assets).
- Build output: dist/ (static HTML, CSS, JS bundles, images) ready to be deployed on a cPanel subdomain.
- CI/CD: .github/workflows/deploy.yml orchestrates build & deploy on push to master.

##### README for additional insights
- Dev: npm run serve → hot-reload local server (localhost:8080).
- Build: npm run build / npm run build:prod → populates dist/.
- Deployment: GitHub Actions auto-deploys on push; manual pull via cPanel.
- Runtime: static files served under subdomain backoffice.huna.pt; the SPA calls backend APIs (e.g. /api/validate) at a separate host (CORS enabled).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build-Time Layer
    subgraph "Build-Time Environment" 
        direction TB
        Dev["Developer Workstation\n(Node.js & NPM)"]:::build
        GitHub["GitHub Repository"]:::build
        CI["GitHub Actions CI/CD"]:::build
        EnvCfg["Environment Config\n(.env.development, .env.production,\nvue.config.js)"]:::build
    end

    %% Deployment Target
    cPanel["cPanel Web Server\n(backoffice.huna.pt)"]:::runtime

    %% Runtime Layer
    subgraph "Client Runtime (Browser)" 
        direction TB
        Browser["Browser / SPA"]:::runtime

        subgraph "SPA Core"
            direction TB
            Main["main.js"]:::spa
            App["App.vue"]:::spa
            Router["router.js"]:::spa
        end

        subgraph "Pages (Vue Router Views)"
            direction TB
            AdsPage["AdsPage.vue"]:::page
            CalendarPage["CalendarPage.vue"]:::page
            GPSPage["gps.vue"]:::page
            RoadMap["roadMap.vue"]:::page
        end

        subgraph "Components"
            direction TB
            DefaultPage["DefaultPage.vue"]:::component
            FormPage["FormPage.vue"]:::component
            HomePage["HomePage.vue"]:::component
            FaqsMessages["FaqsMessages.vue"]:::component
            FinalProposal["FinalProposal.vue"]:::component
            HtmlToPdf["HtmlToPdf.vue"]:::component
            LeaveMessages["LeaveMessages.vue"]:::component
            RequestContact["RequestContact.vue"]:::component
        end

        Assets["src/assets"]:::assets
    end

    %% External Backend
    API["Backend API Service\n(api.huna.pt)"]:::external

    %% Relationships
    Dev -->|push code| GitHub
    GitHub -->|trigger workflow| CI
    CI -->|build assets| EnvCfg
    CI -->|deploy dist/| cPanel
    Browser -->|HTTP GET index.html + bundles| cPanel
    Browser -->|XHR/Fetch| API
    API -->|JSON response| Browser

    %% Click Events
    click Dev "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/package.json"
    click Dev "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/package-lock.json"
    click Dev "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/babel.config.js"
    click Dev "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/jsconfig.json"
    click GitHub "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/.github/workflows/deploy.yml"
    click GitHub "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/.github/workflows/README.md"
    click EnvCfg "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/.env.development"
    click EnvCfg "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/.env.production"
    click EnvCfg "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/vue.config.js"
    click Main "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/main.js"
    click App "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/App.vue"
    click Router "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/router.js"
    click AdsPage "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/pages/AdsPage.vue"
    click CalendarPage "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/pages/CalendarPage.vue"
    click GPSPage "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/pages/gps.vue"
    click RoadMap "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/pages/roadMap.vue"
    click DefaultPage "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/DefaultPage.vue"
    click FormPage "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/FormPage.vue"
    click HomePage "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/HomePage.vue"
    click FaqsMessages "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/FaqsMessages.vue"
    click FinalProposal "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/FinalProposal.vue"
    click HtmlToPdf "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/HtmlToPdf.vue"
    click LeaveMessages "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/LeaveMessages.vue"
    click RequestContact "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/src/components/RequestContact.vue"
    click Assets "https://github.com/hugoofilipe/fugaemfamilia-backoffice/tree/master/src/assets"
    click cPanel "https://github.com/hugoofilipe/fugaemfamilia-backoffice/blob/master/dist/index.html"
    click cPanel "https://github.com/hugoofilipe/fugaemfamilia-backoffice/tree/master/dist/css/"
    click cPanel "https://github.com/hugoofilipe/fugaemfamilia-backoffice/tree/master/dist/js/"
    click cPanel "https://github.com/hugoofilipe/fugaemfamilia-backoffice/tree/master/dist/img/"

    %% Styles
    classDef build fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef runtime fill:#d0ebff,stroke:#333,stroke-width:1px
    classDef spa fill:#ffe699,stroke:#333,stroke-width:1px
    classDef page fill:#cfe2f3,stroke:#333,stroke-width:1px
    classDef component fill:#d9ead3,stroke:#333,stroke-width:1px
    classDef assets fill:#ead1dc,stroke:#333,stroke-width:1px
    classDef external fill:#f9cb9c,stroke:#333,stroke-width:1px
```
