# me-phew/ada-assistant-web architecture

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

- Interactive diagram: https://gitdiagram.com/me-phew/ada-assistant-web
- Repository: https://github.com/me-phew/ada-assistant-web

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) with server-side rendering (SSR) using Nuxt.js (Vue 3).
- It provides a public landing site (home, register, login, forgot/reset password) and a secured area (user dashboard & admin dashboard).

##### File structure
- Top-level Nuxt config and build files: nuxt.config.ts, Dockerfile, GitHub Actions workflows.
- “pages” folder holds route-driven views: index.vue, login.vue, register.vue, admin-dashboard.vue, dashboard.vue, etc.
- “layouts” defines two shell templates: default.vue (public) and dashboard.vue (authenticated).
- “components” contains reusable UI elements (BaseButton, BaseInput, DashboardHeader, AdminDashboardTabs, etc.)
- “composables” houses utility hooks (e.g. register.ts) to encapsulate logic (authentication, form state).
- “assets” holds global styles (SCSS partials, themes), images, and SVGs.
- “i18n” provides localization resources.
- CI/CD: .github/workflows for linting, build, staging & production deployments via Docker or static hosting.

##### README for additional insights
- Standard Nuxt minimal starter with instructions to install dependencies, run dev server, build & preview.
- No backend code—assumes integration with external APIs for authentication, data fetching, calendar integration, etc.

- User / Browser (client)
- CDN / Static hosting (e.g. Netlify, Vercel)
- Nuxt SSR server / Nitro serverless functions
- Public UI routes (pages+layouts)
- Authenticated UI routes (dashboard layouts + components)
- External API Gateway / Microservices (Auth Service, Data Service, Google Calendar API)
- Asset store (CSS/SCSS compiler, static images, SVGs)
- CI/CD pipeline (GitHub Actions → Docker build → Deployment)

- Browser → CDN: fetch static JS/CSS
- Browser → Nuxt SSR server: initial SSR HTML/text and subsequent API calls
- Nuxt SSR/server → External API Gateway: REST/GraphQL for user data, logs, calendar events
- Nuxt → Asset store: SCSS→CSS compilation at build time; images/SVGs served statically
- GitHub → CI/CD workflows → Docker registry → Hosting

c. Architectural patterns & design principles:
- Layered architecture: Presentation (components/pages/layouts) → Composables (business logic) → API layer → External services
- Route-based code splitting (Nuxt pages generate per-route bundles)
- Theming via SCSS partials and CSS variables loaded globally
- i18n at the root, feeding locale data into pages & components

d. Key technologies & libraries:
- Vue 3 / Nuxt 3 (SSR + static generation)
- SCSS modules for styling, SCSS variables & mixins
- @nuxtjs/i18n for localization
- Husky & lint-staged for pre-commit checks, ESLint/Prettier for code quality
- Dockerfile for containerization, GitHub Actions for CI/CD

##### Elements
- Clear, human-readable labels on every node (e.g., “Nuxt SSR Server”, “Auth Service”).
- Blue for frontend components (pages/layouts/components)
- Green for infrastructure (CDN, hosting, Docker, CI/CD)
- Orange for external services (Auth, Calendar, Data APIs)
- Annotations for build vs. runtime flows.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        direction TB
        GH["GitHub Repository"]:::infra
        CL[".github/workflows/commitlint.yaml"]:::code
        SB[".github/workflows/staging-build-deploy.yaml"]:::code
        PB[".github/workflows/prod-build-deploy.yaml"]:::code
        DK["Dockerfile"]:::code
        NUCFG["nuxt.config.ts"]:::code
        GH -->|triggers| CL
        GH -->|triggers| SB
        GH -->|triggers| PB
        SB -->|build image| DK
        PB -->|build image| DK
        DK -->|uses| NUCFG
        DK -->|push to| Registry["Docker Registry"]:::infra
        Registry -->|deploy| Hosting["Hosting Platform (CDN/SSR)"]:::infra
    end

    %% Frontend Application
    subgraph "Frontend Application (Nuxt.js)" 
        direction TB
        APP["app.vue"]:::frontend
        TSCFG["tsconfig.json"]:::code
        ESLINT["eslint.config.mjs"]:::code
        PRETTIER[".prettierrc.json"]:::code
        HUSKY1[".husky/pre-commit"]:::code
        HUSKY2[".husky/commit-msg"]:::code
        APP --> NUCFG
        NUCFG --> TSCFG
        NUCFG --> ESLINT
        NUCFG --> PRETTIER
        NUCFG --> HUSKY1
        NUCFG --> HUSKY2

        subgraph "Layouts" 
            direction TB
            DL["layouts/default.vue"]:::frontend
            DBL["layouts/dashboard.vue"]:::frontend
            CLAY["layouts/custom.vue"]:::frontend
        end

        subgraph "Pages (Routes)" 
            direction TB
            Home["pages/index.vue"]:::frontend
            Login["pages/login.vue"]:::frontend
            Register["pages/register.vue"]:::frontend
            Forgot["pages/forgot-password.vue"]:::frontend
            Reset["pages/reset-password.vue"]:::frontend
            UserDash["pages/dashboard.vue"]:::frontend
            AdminDash["pages/admin-dashboard.vue"]:::frontend
        end

        subgraph "Components"
            direction TB
            BaseBtn["components/BaseButton.vue"]:::frontend
            BaseIn["components/BaseInput.vue"]:::frontend
            BaseHdr["components/BaseHeader.vue"]:::frontend
            BaseFtr["components/BaseFooter.vue"]:::frontend

            subgraph "Dashboard Components"
                direction TB
                DHdr["components/DashboardHeader.vue"]:::frontend
                DTabs["components/DashboardTabs.vue"]:::frontend
                DWelcome["components/DashboardWelcome.vue"]:::frontend
            end

            subgraph "Admin Dashboard Components"
                direction TB
                ADHdr["components/AdminDashboardHeader.vue"]:::frontend
                ADTabs["components/AdminDashboardTabs.vue"]:::frontend
                ADUsers["components/AdminDashboardUsers.vue"]:::frontend
                ADOverview["components/AdminDashboardOverview.vue"]:::frontend
                ADLogs["components/AdminDashboardLogs.vue"]:::frontend
                ADSettings["components/AdminDashboardSettings.vue"]:::frontend
                ADDevices["components/AdminDashboardDevices.vue"]:::frontend
            end

            subgraph "Auth Forms & Utilities"
                direction TB
                LoginForm["components/LoginForm.vue"]:::frontend
                LoginCont["components/LoginContainer.vue"]:::frontend
                RegForm["components/RegisterForm.vue"]:::frontend
                ForgotForm["components/ForgotPasswordForm.vue"]:::frontend
                ResetForm["components/ResetPasswordForm.vue"]:::frontend
                RegComp["composables/register.ts"]:::frontend
            end
        end

        subgraph "Assets & i18n"
            direction TB
            Styles["assets/styles"]:::frontend
            Images["assets/img"]:::frontend
            SVGs["assets/svg"]:::frontend
            I18nEN["i18n/locales/en-US.json"]:::frontend
            I18nPL["i18n/locales/pl-PL.json"]:::frontend
        end

        %% Relationships
        APP --> Layouts
        Layouts --> Pages
        Pages --> Components
        APP --> Assets & i18n
    end

    %% Runtime Layers
    subgraph "Runtime"
        direction TB
        Browser["User Browser / Client"]:::infra
        CDN["CDN / Static Hosting"]:::infra
        SSR["Nuxt SSR Server (Nitro)"]:::infra
        Browser -->|GET JS/CSS| CDN
        Browser -->|initial SSR request| SSR
        SSR -->|serve HTML/CSS| Browser
        SSR -->|hydrate| Browser
        SSR -->|compile SCSS| Styles
        SSR -->|serve assets| Images
        SSR -->|serve assets| SVGs
        SSR -->|calls| API["External API Gateway"]:::external
    end

    %% External Services
    subgraph "External Services"
        direction TB
        AuthSvc["Auth Service"]:::external
        DataSvc["Data Service"]:::external
        CalAPI["Google Calendar API"]:::external
        API -->|"POST /auth/login"| AuthSvc
        API -->|"GET /api/user"| DataSvc
        API -->|"REST/GraphQL"| DataSvc
        API -->|"GET calendar events"| CalAPI
    end

    %% Click Events
    click NUCFG "https://github.com/me-phew/ada-assistant-web/blob/main/nuxt.config.ts"
    click DK "https://github.com/me-phew/ada-assistant-web/tree/main/Dockerfile"
    click CL "https://github.com/me-phew/ada-assistant-web/blob/main/.github/workflows/commitlint.yaml"
    click SB "https://github.com/me-phew/ada-assistant-web/blob/main/.github/workflows/staging-build-deploy.yaml"
    click PB "https://github.com/me-phew/ada-assistant-web/blob/main/.github/workflows/prod-build-deploy.yaml"
    click DL "https://github.com/me-phew/ada-assistant-web/blob/main/layouts/default.vue"
    click DBL "https://github.com/me-phew/ada-assistant-web/blob/main/layouts/dashboard.vue"
    click CLAY "https://github.com/me-phew/ada-assistant-web/blob/main/layouts/custom.vue"
    click Home "https://github.com/me-phew/ada-assistant-web/blob/main/pages/index.vue"
    click Login "https://github.com/me-phew/ada-assistant-web/blob/main/pages/login.vue"
    click Register "https://github.com/me-phew/ada-assistant-web/blob/main/pages/register.vue"
    click Forgot "https://github.com/me-phew/ada-assistant-web/blob/main/pages/forgot-password.vue"
    click Reset "https://github.com/me-phew/ada-assistant-web/blob/main/pages/reset-password.vue"
    click UserDash "https://github.com/me-phew/ada-assistant-web/blob/main/pages/dashboard.vue"
    click AdminDash "https://github.com/me-phew/ada-assistant-web/blob/main/pages/admin-dashboard.vue"
    click BaseBtn "https://github.com/me-phew/ada-assistant-web/blob/main/components/BaseButton.vue"
    click BaseIn "https://github.com/me-phew/ada-assistant-web/blob/main/components/BaseInput.vue"
    click BaseHdr "https://github.com/me-phew/ada-assistant-web/blob/main/components/BaseHeader.vue"
    click BaseFtr "https://github.com/me-phew/ada-assistant-web/blob/main/components/BaseFooter.vue"
    click DHdr "https://github.com/me-phew/ada-assistant-web/blob/main/components/DashboardHeader.vue"
    click DTabs "https://github.com/me-phew/ada-assistant-web/blob/main/components/DashboardTabs.vue"
    click DWelcome "https://github.com/me-phew/ada-assistant-web/blob/main/components/DashboardWelcome.vue"
    click ADHdr "https://github.com/me-phew/ada-assistant-web/blob/main/components/AdminDashboardHeader.vue"
    click ADTabs "https://github.com/me-phew/ada-assistant-web/blob/main/components/AdminDashboardTabs.vue"
    click ADUsers "https://github.com/me-phew/ada-assistant-web/blob/main/components/AdminDashboardUsers.vue"
    click ADOverview "https://github.com/me-phew/ada-assistant-web/blob/main/components/AdminDashboardOverview.vue"
    click ADLogs "https://github.com/me-phew/ada-assistant-web/blob/main/components/AdminDashboardLogs.vue"
    click ADSettings "https://github.com/me-phew/ada-assistant-web/blob/main/components/AdminDashboardSettings.vue"
    click ADDevices "https://github.com/me-phew/ada-assistant-web/blob/main/components/AdminDashboardDevices.vue"
    click LoginForm "https://github.com/me-phew/ada-assistant-web/blob/main/components/LoginForm.vue"
    click LoginCont "https://github.com/me-phew/ada-assistant-web/blob/main/components/LoginContainer.vue"
    click RegForm "https://github.com/me-phew/ada-assistant-web/blob/main/components/RegisterForm.vue"
    click ForgotForm "https://github.com/me-phew/ada-assistant-web/blob/main/components/ForgotPasswordForm.vue"
    click ResetForm "https://github.com/me-phew/ada-assistant-web/blob/main/components/ResetPasswordForm.vue"
    click RegComp "https://github.com/me-phew/ada-assistant-web/blob/main/composables/register.ts"
    click Styles "https://github.com/me-phew/ada-assistant-web/tree/main/assets/styles"
    click Images "https://github.com/me-phew/ada-assistant-web/tree/main/assets/img"
    click SVGs "https://github.com/me-phew/ada-assistant-web/tree/main/assets/svg"
    click I18nEN "https://github.com/me-phew/ada-assistant-web/blob/main/i18n/locales/en-US.json"
    click I18nPL "https://github.com/me-phew/ada-assistant-web/blob/main/i18n/locales/pl-PL.json"
    click ESLINT "https://github.com/me-phew/ada-assistant-web/blob/main/eslint.config.mjs"
    click PRETTIER "https://github.com/me-phew/ada-assistant-web/blob/main/.prettierrc.json"
    click HUSKY1 "https://github.com/me-phew/ada-assistant-web/tree/main/.husky/pre-commit"
    click HUSKY2 "https://github.com/me-phew/ada-assistant-web/tree/main/.husky/commit-msg"
    click APP "https://github.com/me-phew/ada-assistant-web/blob/main/app.vue"
    click TS_CFG "https://github.com/me-phew/ada-assistant-web/blob/main/tsconfig.json"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#222,stroke-width:1px
    classDef infra fill:#d4edda,stroke:#222,stroke-width:1px
    classDef external fill:#fff3cd,stroke:#222,stroke-width:1px
    classDef code fill:#e2e3e5,stroke:#222,stroke-width:1px
```
