# reginadiana/globoplay architecture

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

- Interactive diagram: https://gitdiagram.com/reginadiana/globoplay
- Repository: https://github.com/reginadiana/globoplay

## Overview

##### Project Type and Purpose
- This is a single-page application (SPA) frontend project built with Vue.js.
- Its sole responsibility is to fetch data from the Studio Ghibli films API, allow search and pagination, and render film cards grouped by score.

##### File Structure Analysis
- Top level:
- Dockerfile + docker-compose.yml – containerize & serve the app
- public/index.html – SPA host page
- src/main.js + App.vue – Vue app entrypoint & root component
- src/components/… – reusable Vue components (Header, Footer, Categories, Tabs, Explore, etc.)
- src/assets/… – static images used by various components
- src/styles/index.scss – global styles
- package.json, babel.config.js – build & dependency configs
- No backend source, so all business logic and data fetching lives in the client.

##### README Insights
- The app performs a fetch() to https://ghibliapi.herokuapp.com/films
- Features: search by title, list top-score films, “load more” pagination
- Responsive design, containerized with Docker

a. Browser / Client UI
- Shows App.vue as the root, containing child components (Header, Explore/Search, FilmList, Footer)
- Which components handle state (e.g., search input, current page, loaded films) vs. purely presentational
b. Static Asset Server
- In Docker: an Nginx or Node static-file server that serves index.html, JS bundles, CSS, images
- Locally: yarn dev server for hot-reload
c. Vue.js SPA
- Entry: main.js → mounts App.vue
- Component tree: App.vue → Tabs.vue, Explore.vue, Categories.vue, Category.vue, Channels.vue, Podcasts.vue, Footer.vue
- Styles: index.scss imported at the root
d. External Service
- Studio Ghibli Films API (REST endpoint)
- Request/response flow (fetch request, JSON payload)
e. Docker / Deployment
- docker-compose service “app”
- Build → container image → exposes port 3001 → maps to host

##### Relationships & Data Flows
- Browser → HTTP GET / → static server → index.html + JS/CSS/images → browser parses → Vue runtime loads
- Vue runtime (in-memory) executes fetch calls to the Ghibli API
- API returns JSON → Vue state updated → props flow down to presentational components → UI re-renders
- “Load more” triggers additional fetch calls

##### Architectural Patterns
- Component-based UI composition
- Unidirectional data flow: fetch → root state → props → child components
- Separation of concerns: styling (SCSS), assets, logic (JavaScript), markup (Vue templates)
- Containerization for consistent environment

##### Essential Details to Capture
- The component hierarchy under App.vue
- The SCSS stylesheet import at the root
- The Docker service build → expose → run cycle
- The “load more” pagination loop (multiple fetch calls)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser and UI Layer
    subgraph "Browser / Client UI"
        browser["Browser"]:::ui
    end

    %% Static Server in Docker
    subgraph "Static Asset Server (Docker Container)"
        server["Nginx / Static Server"]:::infra
        index["index.html"]:::infra
    end

    %% Build & Config Files
    subgraph "Build & Configuration"
        compose["docker-compose.yml"]:::infra
        dockerfile["Dockerfile"]:::infra
        package["package.json"]:::infra
        babel["babel.config.js"]:::infra
        assets["src/assets/"]:::infra
    end

    %% Vue SPA Runtime and Components
    browser -->|"HTTP GET /"| server
    server -->|"serves files"| browser
    server --> index
    index --> browser
    compose -->|"configures"| server
    dockerfile -->|"builds image"| server
    browser -->|"loads Vue runtime"| vueRuntime["Vue.js Runtime"]:::infra

    subgraph "Vue.js SPA"
        entry["main.js"]:::infra
        styles["index.scss"]:::infra
        app["App.vue"]:::ui
        header["Header.vue"]:::ui
        explore["Explore.vue"]:::ui
        tabs["Tabs.vue"]:::ui
        categories["Categories.vue"]:::ui
        category["Category.vue"]:::ui
        channels["Channels.vue"]:::ui
        podcasts["Podcasts.vue"]:::ui

        vueRuntime --> entry
        entry -->|"mounts"| app
        entry -->|"imports styles"| styles

        app --> header
        app --> explore
        app --> tabs
        app --> categories
        categories --> category
        app --> channels
        app --> podcasts
    end

    %% External API
    app -->|"fetch() JSON"| api["Studio Ghibli Films API"]:::external
    api -->|"JSON response"| app

    %% Click Events
    click server "https://github.com/reginadiana/globoplay/tree/master/Dockerfile"
    click compose "https://github.com/reginadiana/globoplay/blob/master/docker-compose.yml"
    click index "https://github.com/reginadiana/globoplay/blob/master/public/index.html"
    click entry "https://github.com/reginadiana/globoplay/blob/master/src/main.js"
    click app "https://github.com/reginadiana/globoplay/blob/master/src/App.vue"
    click styles "https://github.com/reginadiana/globoplay/blob/master/src/styles/index.scss"
    click header "https://github.com/reginadiana/globoplay/blob/master/src/components/Header.vue"
    click explore "https://github.com/reginadiana/globoplay/blob/master/src/components/Explore.vue"
    click tabs "https://github.com/reginadiana/globoplay/blob/master/src/components/Tabs.vue"
    click categories "https://github.com/reginadiana/globoplay/blob/master/src/components/Categories.vue"
    click category "https://github.com/reginadiana/globoplay/blob/master/src/components/Category.vue"
    click channels "https://github.com/reginadiana/globoplay/blob/master/src/components/Channels.vue"
    click podcasts "https://github.com/reginadiana/globoplay/blob/master/src/components/Podcasts.vue"
    click assets "https://github.com/reginadiana/globoplay/tree/master/src/assets/"
    click package "https://github.com/reginadiana/globoplay/blob/master/package.json"
    click babel "https://github.com/reginadiana/globoplay/blob/master/babel.config.js"

    %% Legend
    subgraph Legend
        UI["UI Components"]:::ui
        INFRA["Infrastructure"]:::infra
        EXT["External Service"]:::external
    end

    classDef ui fill:#d4f8d4,stroke:#4caf50
    classDef infra fill:#d0e7ff,stroke:#2196f3
    classDef external fill:#ffe0b2,stroke:#fb8c00
```
