# bombies/personal-portfolio-3 architecture

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

- Interactive diagram: https://gitdiagram.com/bombies/personal-portfolio-3
- Repository: https://github.com/bombies/personal-portfolio-3

## Overview

##### Project Context
- This is a personal portfolio website, built as a monorepo.
- The project uses a modern stack including a Next.js–based frontend (in packages/frontend), serverless API functions (in packages/functions), and shared or core functionalities (in packages/core). There are also infrastructure definitions (in the infra folder and sst.config.ts) that indicate the use of SST (Serverless Stack) for cloud deployments.
- Additional scripts (in packages/scripts) are used for tasks such as synchronizing secrets and other automation.

##### Main Components
a. Frontend Application:
- Located in packages/frontend, it’s a Next.js application that handles the display of your portfolio pages (landing, about, contact, projects, etc.).
- It includes public assets (like PDFs, fonts, images) and is organized through a structured routing (using Next.js app directory, with defined landing, about, projects sections).
- Key UI components, hooks, and utilities are part of this layer.

b. Backend / API Functions:
- Located in packages/functions, these serverless functions (api.ts) provide backend logic.
- They are likely used to power dynamic interactions or API endpoints required by the frontend.

c. Core / Shared Code:
- Located in packages/core, this package may supply common functionalities or business logic that can be used across both the frontend and even the functions.
- It includes example code and tests to ensure reliability.

d. Infrastructure & Deployment:
- The infra directory along with files such as sst.config.ts and the presence of SST environment files (sst-env.d.ts) indicate that infrastructure as code is being used to provision cloud resources.
- This component shows how the project is deployed (e.g., serverless deployment, routing, secrets management, etc.).

e. Automation and Scripts:
- The packages/scripts folder contains scripts for tasks (e.g., syncing secrets) that automate parts of the development or deployment process.

f. CI/CD Pipelines:
- The .github/workflows files (build.yml, deploy.yml) indicate automated build and deploy processes that should be represented as part of the overall system flow.

##### Relationships & Data Flows
- The frontend (Next.js) interacts directly with the backend API functions through HTTP calls (likely via Next.js API routes or direct serverless endpoints).
- Shared code from the core package may be consumed by both the frontend and functions to guarantee consistency.
- The infrastructure layer (defined in infra) configures the cloud environment, provisioning necessary resources (e.g., API gateways, hosting services) and integrating secret management.
- CI/CD pipelines drive automated testing, building, and deployment; these could be depicted as external triggers that feed into the overall system.

##### Architectural Patterns and Design Principles
- A clear separation of concerns is maintained by splitting the project into distinct packages.
- The microservices/serverless pattern is evident in the separation of the frontend and API functionality.
- Infrastructure as code principles are demonstrated via SST and the infra folder, ensuring reproducible and automated deployments.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Repo["Personal Portfolio V3 Monorepo"]:::repo

    subgraph "Application Modules"
        Frontend["Frontend (Next.js UI)"]:::frontend
        Backend["Backend API Functions"]:::api
        Core["Core Shared Libraries"]:::core
        Automation["Automation Scripts"]:::automation
    end

    subgraph "Deployment & Automation"
        Infrastructure["Infrastructure (SST/Infra Config)"]:::infra
        CICD["CI/CD Pipelines"]:::cicd
    end

    %% Connections from Monorepo to Modules
    Repo --> Frontend
    Repo --> Backend
    Repo --> Core
    Repo --> Automation
    Repo --> Infrastructure
    Repo --> CICD

    %% Interactions between Application Modules
    Frontend -->|"HTTPAPICalls"| Backend
    Frontend -->|"SharedLogic"| Core
    Backend -->|"SharedLogic"| Core

    %% Interactions with Infrastructure & CI/CD
    Infrastructure -->|"Provisions"| Frontend
    Infrastructure -->|"Provisions"| Backend
    CICD -->|"Deploys"| Infrastructure

    %% Click Events
    click Frontend "https://github.com/bombies/personal-portfolio-3/tree/main/packages/frontend"
    click Backend "https://github.com/bombies/personal-portfolio-3/blob/main/packages/functions/src/api.ts"
    click Core "https://github.com/bombies/personal-portfolio-3/tree/main/packages/core"
    click Infrastructure "https://github.com/bombies/personal-portfolio-3/tree/main/infra"
    click Infrastructure "https://github.com/bombies/personal-portfolio-3/blob/main/sst.config.ts"
    click Automation "https://github.com/bombies/personal-portfolio-3/tree/main/packages/scripts"
    click CICD "https://github.com/bombies/personal-portfolio-3/tree/main/.github/workflows"

    %% Styles
    classDef repo fill:#E0E0E0,stroke:#333,stroke-width:2px;
    classDef frontend fill:#FFCC80,stroke:#333,stroke-width:2px;
    classDef api fill:#80DEEA,stroke:#333,stroke-width:2px;
    classDef core fill:#C5E1A5,stroke:#333,stroke-width:2px;
    classDef infra fill:#CE93D8,stroke:#333,stroke-width:2px;
    classDef cicd fill:#B3E5FC,stroke:#333,stroke-width:2px;
    classDef automation fill:#FFF59D,stroke:#333,stroke-width:2px;
```
