# sumanthnagireddi/my-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/sumanthnagireddi/my-portfolio
- Repository: https://github.com/sumanthnagireddi/my-portfolio

## Overview

##### Project type and purpose
- This is a single-page web application built with Angular (v18) that serves as a personal portfolio (“MyPortfolio”).
- It is hosted on Firebase Hosting, uses Firestore for dynamic content (blogs, interviews, resources), and includes a minimal Node.js server (server.js) likely for server-side rendering or API fallbacks.
- CI/CD is configured via GitHub Actions workflows (`.github/workflows/*.yml`) to build and deploy to Firebase on pull requests and merges.

##### File structure
- Top-level configuration:
- angular.json, tsconfig*.json, tailwind.config.js – Angular build and styling setup
- firebase.json, .firebaserc, firestore.rules, firestore.indexes.json – Firebase Hosting and Firestore security/indexes
- server.js – Node entrypoint for SSR or universal routing
- public/ – static assets served by Firebase
- src/ – Angular source code
- Under src/app:
- app.component, app.routes.ts, app.config.ts – root module, route definitions, environment/config constants
- components/ – reusable UI components (header, hero, blog-card, etc.)
- pages/ – route-backed views (home, about, blog list/detail, interview, resources, work)
- services/portfolio.service.ts – data access service wrapping Firestore calls
- pipes/words-reducer.pipe.ts – text formatting helper
- CI/CD: `.github/workflows/firebase-hosting-*.yml` triggers `ng build` and `firebase deploy`.

##### README for additional insights
- Confirms Angular CLI usage, dev server (`ng serve`), build output to `dist/`, unit tests (Karma), e2e tests, and reliance on standard Angular commands.

##### Elements
- Labels: “Browser / Angular SPA”, “Firebase Hosting”, “Node.js Server (server.js)”, “Firestore Database”, “GitHub Actions CI/CD”
- Browser → Hosting → Server.js (if routing) → Hosting
- Browser ↔ Firestore (via Firebase SDK)
- GitHub Repo → GitHub Actions → Firebase CLI API → Firebase Hosting & Firestore
- Rectangles for services (Hosting, Firestore, CI/CD)
- Clouds or hexagons for external/managed services (Firebase)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Angular SPA (Client Browser)"
        direction TB
        Browser["Browser / Angular SPA"]:::frontend
        AppComponent["AppComponent"]:::frontend
        AppRoutes["AppRoutes"]:::frontend
        AppConfig["AppConfig"]:::frontend
        ComponentsDir["components/"]:::frontend
        PagesDir["pages/"]:::frontend
        PortfolioService["PortfolioService"]:::frontend
        WordsPipe["WordsReducerPipe"]:::frontend
        IndexHTML["index.html"]:::frontend
        MainTS["main.ts"]:::frontend
        StylesCSS["styles.css"]:::frontend
    end

    %% Backend & Hosting Layer
    subgraph "Firebase Hosting"
        direction TB
        Hosting["Firebase Hosting"]:::backend
        FirebaseJSON["firebase.json"]:::backend
        FirebaseRC[".firebaserc"]:::backend
        PublicDir["public/"]:::backend
    end

    %% Node Server
    NodeServer["Node.js Server (server.js)"]:::backend

    %% Database Layer
    subgraph "Firestore Database"
        direction TB
        Firestore["Firestore"]:::db
        Rules["firestore.rules"]:::db
        Indexes["firestore.indexes.json"]:::db
    end

    %% CI/CD Layer
    subgraph "GitHub Actions CI/CD"
        direction TB
        GH_PR["firebase-hosting-pull-request.yml"]:::ci
        GH_MR["firebase-hosting-merge.yml"]:::ci
        GitHubRepo["GitHub Repository"]:::ci
    end

    %% Connections
    Browser -->|HTTPS| Hosting
    Hosting -->|SSR/Rewrites| NodeServer
    NodeServer -->|serves| Hosting
    Browser -->|Firebase SDK| Firestore
    Firestore -->|rules/index checks| Rules
    Firestore -->|indexes| Indexes

    GitHubRepo -->|trigger workflows| GH_PR
    GitHubRepo -->|trigger workflows| GH_MR
    GH_PR -->|firebase deploy| Hosting
    GH_PR -->|update rules/indexes| Firestore
    GH_MR -->|firebase deploy| Hosting
    GH_MR -->|update rules/indexes| Firestore

    %% Click Events
    click AppComponent "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/app/app.component.ts"
    click AppRoutes "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/app/app.routes.ts"
    click AppConfig "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/app/app.config.ts"
    click ComponentsDir "https://github.com/sumanthnagireddi/my-portfolio/tree/master/src/app/components/"
    click PagesDir "https://github.com/sumanthnagireddi/my-portfolio/tree/master/src/app/pages/"
    click PortfolioService "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/app/services/portfolio.service.ts"
    click WordsPipe "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/app/pipes/words-reducer.pipe.ts"
    click IndexHTML "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/index.html"
    click MainTS "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/main.ts"
    click StylesCSS "https://github.com/sumanthnagireddi/my-portfolio/blob/master/src/styles.css"

    click FirebaseJSON "https://github.com/sumanthnagireddi/my-portfolio/blob/master/firebase.json"
    click FirebaseRC "https://github.com/sumanthnagireddi/my-portfolio/blob/master/.firebaserc"
    click PublicDir "https://github.com/sumanthnagireddi/my-portfolio/tree/master/public/"

    click Rules "https://github.com/sumanthnagireddi/my-portfolio/blob/master/firestore.rules"
    click Indexes "https://github.com/sumanthnagireddi/my-portfolio/blob/master/firestore.indexes.json"

    click NodeServer "https://github.com/sumanthnagireddi/my-portfolio/blob/master/server.js"

    click GH_PR "https://github.com/sumanthnagireddi/my-portfolio/blob/master/.github/workflows/firebase-hosting-pull-request.yml"
    click GH_MR "https://github.com/sumanthnagireddi/my-portfolio/blob/master/.github/workflows/firebase-hosting-merge.yml"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#0366d6,stroke-width:1px
    classDef backend fill:#E6FFEA,stroke:#28a745,stroke-width:1px
    classDef db fill:#FFF5D1,stroke:#dbab09,stroke-width:1px
    classDef ci fill:#FFF0F6,stroke:#d6336c,stroke-width:1px
```
