# aluxey/webproject_efrei_s6 architecture

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

- Interactive diagram: https://gitdiagram.com/aluxey/webproject_efrei_s6
- Repository: https://github.com/aluxey/webproject_efrei_s6

## Overview

##### Project type and purpose
- Key features: interactive pages (FlightsMap, dashboards), external API integrations (Climatiq, custom emission service), OAuth sign-in (Google, Microsoft via MSAL), Firebase support.

##### File structure
- Top level:
- public/ → static assets (airports.geojson, index.html)
- src/ → application source
- config files (vite.config.js, jsconfig.json, etc.)
- src/api/ → HTTP wrappers for external services (climatiq.js, emissionService.js, msal.js, useGoogleAuth.js)
- src/components/ → reusable Vue components (buttons, layout, map)
- src/pages/ → route-level views (HomePage, FlightsPage, EnergyPage, etc.)
- src/router/index.js → vue-router setup
- src/stores/ → Pinia stores for user and emissions state
- src/assets/style.css → global styling
- src/firebase.js → Firebase initialization
- src/main.js & src/App.vue → application bootstrap and root component

##### README for insights
- Confirms API wrappers, layouts, pages, Pinia stores, utils.
- Emphasizes starting point for Vue 3 + Vite.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer (UI)
    subgraph "Presentation Layer" 
        direction TB
        BaseLayout["BaseLayout"]:::ui
        BaseHeader["BaseHeader"]:::ui
        BaseFooter["BaseFooter"]:::ui
        BaseButton["BaseButton"]:::ui
        AsyncButton["AsyncButton"]:::ui
        FlightsMap["FlightsMap"]:::ui
        Dashboard["Dashboard"]:::ui
        NotReady["NotReady"]:::ui
        AuthButtons["AuthButtons"]:::ui
        SigninButtonGoogle["SigninButtonGoogle"]:::ui
        SigninButtonMicrosoft["SigninButtonMicrosoft"]:::ui

        subgraph "Pages" 
            direction TB
            HomePage["HomePage"]:::ui
            FlightsPage["FlightsPage"]:::ui
            EnergyPage["EnergyPage"]:::ui
            CloudPage["CloudPage"]:::ui
            FreightPage["FreightPage"]:::ui
            CustomPage["CustomPage"]:::ui
            HistoryPage["HistoryPage"]:::ui
        end
    end

    %% State & Routing Layer
    subgraph "State & Routing" 
        direction TB
        Router["Router & Navigation"]:::state
        UserStore["Pinia: User Store"]:::state
        EmissionsStore["Pinia: Emissions Store"]:::state
    end

    %% Data Layer (API Wrappers)
    subgraph "API Layer" 
        direction TB
        ClimatiqWrapper["Climatiq API Wrapper"]:::api
        EmissionServiceWrapper["EmissionService API Wrapper"]:::api
        MSALWrapper["Microsoft OAuth (MSAL)"]:::api
        GoogleAuthWrapper["Google OAuth Helper"]:::api
    end

    %% External Services
    subgraph "External Services"
        direction TB
        ClimatiqAPI["Climatiq API"]:::external
        CustomEmissionAPI["Custom EmissionService API"]:::external
        GoogleOAuth["Google OAuth"]:::external
        MSAzureAD["Microsoft Azure AD"]:::external
        FirebaseSDK["Firebase SDK"]:::external
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        Vite["Vite (Dev Server & Bundler)"]:::build
        StaticHTML["Static HTML Template"]:::build
    end

    %% Interactions
    HomePage -->|"dispatch action"| EmissionsStore
    FlightsPage -->|"dispatch action"| EmissionsStore
    EnergyPage -->|"dispatch action"| EmissionsStore
    CloudPage -->|"dispatch action"| EmissionsStore
    FreightPage -->|"dispatch action"| EmissionsStore
    CustomPage -->|"dispatch action"| EmissionsStore
    HistoryPage -->|"dispatch action"| EmissionsStore

    AuthButtons -->|"user clicks"| GoogleAuthWrapper
    AuthButtons -->|"user clicks"| MSALWrapper
    SigninButtonGoogle -->|"invoke"| GoogleAuthWrapper
    SigninButtonMicrosoft -->|"invoke"| MSALWrapper

    EmissionsStore -->|"fetchEmissions()"| ClimatiqWrapper
    EmissionsStore -->|"fetchCustomEmissions()"| EmissionServiceWrapper
    UserStore -->|"initAuth()"| MSALWrapper
    UserStore -->|"initAuth()"| GoogleAuthWrapper

    ClimatiqWrapper -->|"HTTPS request"| ClimatiqAPI
    EmissionServiceWrapper -->|"HTTPS request"| CustomEmissionAPI
    MSALWrapper -->|"OAuth flow"| MSAzureAD
    GoogleAuthWrapper -->|"OAuth flow"| GoogleOAuth

    ClimatiqAPI -->|"API response"| EmissionsStore
    CustomEmissionAPI -->|"API response"| EmissionsStore
    GoogleOAuth -->|"token response"| UserStore
    MSAzureAD -->|"token response"| UserStore

    UserStore -->|"reactive update"| AuthButtons
    EmissionsStore -->|"reactive update"| Dashboard
    EmissionsStore -->|"reactive update"| FlightsMap

    FirebaseSDK -->|"session persistence"| UserStore

    %% Router connections
    Router --> HomePage
    Router --> FlightsPage
    Router --> EnergyPage
    Router --> CloudPage
    Router --> FreightPage
    Router --> CustomPage
    Router --> HistoryPage

    %% Build & Deployment flows
    Vite -->|"serves"| StaticHTML
    StaticHTML -->|"loads"| BaseLayout
    Vite -->|"bundles"| App

    %% Click Events
    click Router "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/router/index.js"
    click HomePage "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/pages/HomePage.vue"
    click FlightsPage "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/pages/FlightsPage.vue"
    click EnergyPage "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/pages/EnergyPage.vue"
    click CloudPage "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/pages/CloudPage.vue"
    click FreightPage "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/pages/FreightPage.vue"
    click CustomPage "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/pages/CustomPage.vue"
    click HistoryPage "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/pages/HistoryPage.vue"
    click BaseLayout "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/BaseLayout.vue"
    click BaseHeader "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/BaseHeader.vue"
    click BaseFooter "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/BaseFooter.vue"
    click BaseButton "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/BaseButton.vue"
    click AsyncButton "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/AsyncButton.vue"
    click FlightsMap "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/FlightsMap.vue"
    click Dashboard "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/Dashboard.vue"
    click NotReady "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/NotReady.vue"
    click AuthButtons "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/AuthButtons.vue"
    click SigninButtonGoogle "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/SigninButtonGoogle.vue"
    click SigninButtonMicrosoft "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/components/SigninButtonMicrosoft.vue"
    click UserStore "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/stores/user.js"
    click EmissionsStore "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/stores/emissions.js"
    click ClimatiqWrapper "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/api/climatiq.js"
    click EmissionServiceWrapper "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/api/emissionService.js"
    click MSALWrapper "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/api/msal.js"
    click GoogleAuthWrapper "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/api/useGoogleAuth.js"
    click FirebaseSDK "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/firebase.js"
    click App "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/App.vue"
    click Main "https://github.com/aluxey/webproject_efrei_s6/blob/main/src/main.js"
    click Vite "https://github.com/aluxey/webproject_efrei_s6/blob/main/vite.config.js"
    click StaticHTML "https://github.com/aluxey/webproject_efrei_s6/blob/main/public/index.html"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,color:#004085
    classDef state fill:#d4edda,stroke:#155724,color:#155724
    classDef api fill:#ffe5b4,stroke:#cc8400,color:#663c00
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#383d41
    classDef build fill:#fff3cd,stroke:#856404,color:#856404
```
