# taipei-doit/taipei-city-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/taipei-doit/taipei-city-dashboard
- Repository: https://github.com/taipei-doit/taipei-city-dashboard

## Overview

##### Project type and purpose
- This is a comprehensive full-stack data visualization platform with three main domains:
- Taipei-City-Dashboard-FE (frontend SPA in Vue/Vite served via Nginx)
- Taipei-City-Dashboard-BE (Golang REST API with Redis cache, SQL database)
- Taipei-City-Dashboard-DE (Python-based Airflow-style DAGs deployed to Cloud Composer for ETL)

##### File structure
- Top-level folders:
- Taipei-City-Dashboard-FE → the Vue.js single-page frontend (src, public, assets, Dockerfile, Nginx)
- Taipei-City-Dashboard-BE → the Go backend (app/controllers, models, routes, middleware, cache, util), plus Dockerfiles, Cloud Build config, GitHub Actions
- Taipei-City-Dashboard-DE → data engineering pipelines (dags/proj_city_dashboard, utils, cicd, local_env for local Airflow testing)
- docker & local_env → Docker Compose configs for local orchestration (DB, init scripts, environment files)
- db-sample-data → sample SQL dumps
- CI/CD:
- .github/workflows/go.yml & node.js.yml for build/test/deploy
- Cloud Build YAML in BE and FE
- Configuration:
- .env templates, Dockerfiles, cloudbuild.yaml, composer DAG configs.

##### README for additional insights
- Confirms FE is Vue-based data visualization tool, BE is public REST API, DE pipelines run on Cloud Composer
- Project is open-source, encourages contributions and CI/CD integration.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "CI/CD Pipelines"
        GH["GitHub Actions"]:::cicd
        FE_CB["FE Cloud Build"]:::cicd
        BE_CB["BE Cloud Build"]:::cicd
        DE_CB["DE Composer Build"]:::cicd
    end
    GH --> FE_CB
    GH --> BE_CB
    GH --> DE_CB

    FE_CB --> CR_FE["Cloud Run (FE)"]:::infra
    BE_CB --> CR_BE["Cloud Run (BE)"]:::infra
    DE_CB --> Composer["Cloud Composer"]:::data

    subgraph "Runtime Environment"
        Frontend["Vue SPA\n(Nginx)"]:::frontend
        Backend["Go REST API"]:::backend
        Redis["Redis Cache"]:::backend
        Database["SQL Database"]:::backend
        External["External Data Sources"]:::data
    end

    CR_FE --> Frontend
    CR_BE --> Backend

    Frontend -->|"HTTP Requests"| Backend
    Backend -->|"Cache GET/SET"| Redis
    Backend -->|"SQL Queries"| Database

    Composer --> External
    Composer --> Database

    subgraph "Local Dev (Docker Compose)"
        LocalCompose["Docker Compose"]:::infra
    end
    LocalCompose --> Frontend
    LocalCompose --> Backend
    LocalCompose --> Database

    click GH "https://github.com/taipei-doit/taipei-city-dashboard/blob/develop/.github/workflows/go.yml"
    click FE_CB "https://github.com/taipei-doit/taipei-city-dashboard/blob/develop/Taipei-City-Dashboard-FE/cloudbuild.yaml"
    click BE_CB "https://github.com/taipei-doit/taipei-city-dashboard/blob/develop/Taipei-City-Dashboard-BE/cloudbuild.yaml"
    click DE_CB "https://github.com/taipei-doit/taipei-city-dashboard/blob/develop/Taipei-City-Dashboard-DE/cicd/add-dags-to-composer.cloudbuild.yaml"
    click Frontend "https://github.com/taipei-doit/taipei-city-dashboard/tree/develop/Taipei-City-Dashboard-FE/"
    click Backend "https://github.com/taipei-doit/taipei-city-dashboard/tree/develop/Taipei-City-Dashboard-BE/"
    click Redis "https://github.com/taipei-doit/taipei-city-dashboard/blob/develop/Taipei-City-Dashboard-BE/app/cache/redis.go"
    click Database "https://github.com/taipei-doit/taipei-city-dashboard/blob/develop/Taipei-City-Dashboard-BE/app/models/database.go"
    click LocalCompose "https://github.com/taipei-doit/taipei-city-dashboard/blob/develop/docker/docker-compose.yaml"
    click Composer "https://github.com/taipei-doit/taipei-city-dashboard/tree/develop/Taipei-City-Dashboard-DE/dags/proj_city_dashboard/"
    click External "https://github.com/taipei-doit/taipei-city-dashboard/tree/develop/Taipei-City-Dashboard-DE/dags/utils/"

    classDef frontend fill:#D0E8FF,stroke:#004080
    classDef backend fill:#DFFFD8,stroke:#008000
    classDef data fill:#FFF4DD,stroke:#FF8000
    classDef cicd fill:#E8E8E8,stroke:#666666
    classDef infra fill:#F0F0F0,stroke:#999999
```
