# lukecsharpwalker/angularblog architecture

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

- Interactive diagram: https://gitdiagram.com/lukecsharpwalker/angularblog
- Repository: https://github.com/lukecsharpwalker/angularblog

## Overview

##### Project type and purpose
- This is a full-stack, server-side rendered (SSR) blog application.
- Frontend: Angular 19 with Universal for SSR, tailwind/daisyUI for styling.
- Backend: Supabase (PostgreSQL, Auth, Storage, Functions) as a BaaS.
- CI/CD: GitHub Actions, Docker, Google Cloud Run / Firebase for deployment.

##### File structure
- Top-level:
- server.ts / main.server.ts: Angular Universal entry point for SSR on Node/Express.
- src/app: Angular modules split by feature (admin, auth, reader) plus shared utilities.
- app.config.server.ts vs app.config.ts: environment routing for SSR vs client.
- scripts/, .github/workflows/: automation (image conversion, CI/CD).
- public/: static assets, pre-rendered pages, tags, versioned static copies.
- Patterns:
- Feature modules for admin & reader, guarded routes for auth.
- Shared services (Supabase wrapper), stores for state (NgRX Signals).
- Utility layer (quill configuration, Supabase initializer).

##### README for additional insights
- Confirms Angular SSR, Supabase BaaS, Tailwind/DaisyUI, Playwright tests.
- Two distinct interfaces: Reader (public listing, details, comments) vs Admin (login, post CRUD).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend" 
        direction TB
        SSRServer["Angular Universal Server<br/>(Node/Express)"]:::frontend
        Browser["Angular Client (Browser)"]:::frontend
        subgraph "Angular App"
            direction TB
            AdminModule["Admin Module"]:::frontend
            AuthModule["Auth Module"]:::frontend
            ReaderModule["Reader Module"]:::frontend
            SharedModule["Shared Module"]:::frontend
            Guards["Guards & Interceptors"]:::frontend
            Services["Supabase Service Abstraction"]:::frontend
            Utils["Utility Layer"]:::frontend
            Styling["Styling Configuration"]:::frontend
        end
    end

    %% BaaS Layer
    subgraph "Supabase BaaS" 
        direction TB
        AuthService["Supabase Auth"]:::baas
        Database["PostgreSQL Database"]:::baas
        Storage["Supabase Storage"]:::baas
        Functions["Edge Functions"]:::baas
    end

    %% CI/CD & Deployment
    subgraph "CI/CD & Deployment" 
        direction TB
        CICD["GitHub Actions"]:::cicd
        Docker["Docker Build"]:::cicd
        DeployTarget["Google Cloud Run / Firebase Hosting"]:::deploy
        Scripts["Build Scripts"]:::cicd
        Config["Deployment Configuration"]:::cicd
        Static["Public Static Assets"]:::cicd
    end

    %% Relationships
    Browser -->|"HTTP Request"| SSRServer
    SSRServer -->|"Server-side Data Fetch"| AuthService
    SSRServer -->|"Server-side Data Fetch"| Database
    Browser -->|"Runtime API Calls"| AuthService
    Browser -->|"Runtime API Calls"| Database
    Browser -->|"Runtime API Calls"| Storage

    CICD -.->|"build pipeline"| Docker
    Docker -.->|"deploy artifacts"| DeployTarget

    %% Feature interactions (hierarchy edges)
    Browser --> AdminModule
    Browser --> AuthModule
    Browser --> ReaderModule
    Browser --> SharedModule
    Browser --> Guards
    Browser --> Services
    Browser --> Utils
    Browser --> Styling

    %% Component Mappings (click events)
    click SSRServer "https://github.com/lukecsharpwalker/angularblog/blob/main/server.ts"
    click SSRServer "https://github.com/lukecsharpwalker/angularblog/blob/main/src/main.server.ts"
    click Browser "https://github.com/lukecsharpwalker/angularblog/blob/main/src/main.ts"
    click Browser "https://github.com/lukecsharpwalker/angularblog/blob/main/src/index.html"
    click Browser "https://github.com/lukecsharpwalker/angularblog/blob/main/angular.json"
    click AdminModule "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/admin/admin.component.ts"
    click AdminModule "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/admin/admin.routes.ts"
    click AdminModule "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/admin/_services/admin-api.service.ts"
    click AuthModule "https://github.com/lukecsharpwalker/angularblog/tree/main/src/app/auth/login/"
    click AuthModule "https://github.com/lukecsharpwalker/angularblog/tree/main/src/app/auth/register/"
    click AuthModule "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/auth/_guards/authAdminGuard.ts"
    click ReaderModule "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/reader/reader.component.ts"
    click ReaderModule "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/reader/reader.routes.ts"
    click SharedModule "https://github.com/lukecsharpwalker/angularblog/tree/main/src/app/shared/"
    click Guards "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/auth/_guards/auth.guard.spec.ts"
    click Guards "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/admin/_guards/unsaved-changes.guard.ts"
    click Services "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/services/supabase.service.ts"
    click Utils "https://github.com/lukecsharpwalker/angularblog/blob/main/src/app/utlis/quill-configuration.ts"
    click Styling "https://github.com/lukecsharpwalker/angularblog/blob/main/tailwind.config.js"
    click Styling "https://github.com/lukecsharpwalker/angularblog/blob/main/src/styles.scss"
    click CICD "https://github.com/lukecsharpwalker/angularblog/blob/main/.github/workflows/PR_Check.yml"
    click CICD "https://github.com/lukecsharpwalker/angularblog/blob/main/.github/workflows/google-cloudrun-docker.yml"
    click Scripts "https://github.com/lukecsharpwalker/angularblog/blob/main/scripts/png_to_webp.sh"
    click Config "https://github.com/lukecsharpwalker/angularblog/blob/main/firebase.json"
    click Config "https://github.com/lukecsharpwalker/angularblog/blob/main/routes.txt"
    click Static "https://github.com/lukecsharpwalker/angularblog/tree/main/public/"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#00529B,color:#00529B
    classDef baas fill:#dff2cc,stroke:#4F8A10,color:#4F8A10
    classDef cicd fill:#ffe6cc,stroke:#9F6000,color:#9F6000
    classDef deploy fill:#fff2cc,stroke:#9F6000,color:#9F6000
```
