Astound Google Review Tracker - Technical Documentation

Overview

The Astound Google Review Tracker is a Single Page Application (SPA) designed to track, visualize, and benchmark Google Review ratings for Astound Broadband locations across multiple regions. It uses a Serverless Architecture to securely fetch data from the Yext API while serving the frontend as static assets.

System Architecture

Frontend (Client-Side)

Backend (Serverless)

how it Works (Data Flow)

  1. User Access: User visits the deployed URL (frontend).
  2. Initialization:
  3. Data Fetching:
  4. API Proxy:
  5. UI Update:
  6. Competitor Data:

Visual Flow Chart

sequenceDiagram
    participant User
    participant Browser (dynamic.js)
    participant Proxy (Netlify Function)
    participant YextAPI
    participant StaticData (competitors.js)

    User->>Browser: Opens Dashboard
    Browser->>StaticData: Load Competitor Data (Hardcoded)
    Browser->>Browser: Render Dashboard Structure
    loop For Each Location & Month
        Browser->>Proxy: Fetch Rating (EntityID, Date)
        Proxy->>YextAPI: Request Review Data (with Secret Key)
        YextAPI-->>Proxy: Return JSON Data
        Proxy-->>Browser: Return JSON Data
        Browser->>Browser: Update Table Cell
    end
    Browser->>User: Display Full Report

Simplified Data Flow

graph TD
    %% Nodes
    Browser[("Browser / Dashboard\n(User Interface)")]
    StaticData[("Static Files\n(Competitors.js & Locations)")]
    Proxy[("Netlify Serverless Function\n(Security Layer)")]
    Yext[("Yext API\n(Live Astound Reviews)")]

    %% Styles
    style Browser fill:#f9f,stroke:#333,stroke-width:2px
    style StaticData fill:#eee,stroke:#333,stroke-width:1px
    style Proxy fill:#bbf,stroke:#333,stroke-width:1px
    style Yext fill:#bfb,stroke:#333,stroke-width:1px

    %% Connections
    Browser -- "1. Loads hardcoded data directly" --> StaticData
    Browser -- "2. Requests review data" --> Proxy
    Proxy -- "3. Authenticates with API Key" --> Yext
    Yext -- "4. Returns live ratings" --> Proxy
    Proxy -- "5. Returns data to dashboard" --> Browser

Data Sources

Data Type Source Implementation Details
Astound Reviews Yext API Fetched dynamically via yext-proxy. Requires entityId.
Competitor Reviews Static File Hardcoded in competitors.js (variable COMPETITOR_MAPPINGS). Does NOT currently use Google Maps API.
Locations Static File Defined in dynamic.js (variable REGIONS).

API Key Management & Configuration Locations

CRITICAL: There are several locations where API keys are defined. For the application to work securely and correctly, you must update these locations or ensure Environment Variables are set.

1. Yext API Key

Used to authenticate with Yext to get review data.

2. Google Maps API Key

Intended for fetching competitor data, but currently unused by the active logic.

Updating the App

To Add/Remove Locations:

Edit dynamic.js and modify the REGIONS object.

'Texas': {
    manager: 'Name',
    locations: [
           { address: '...', city: '...', entityId: 'NEW_ID' }
    ]
}

To Update Competitor Data:

Edit competitors.js and manually update the ratings in COMPETITOR_MAPPINGS.

'City-State': {
    verizon: { address: '...', rating: 4.5 }, // Update this value
    // ...
}