# bcastelino/brian-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/bcastelino/brian-portfolio
- Repository: https://github.com/bcastelino/brian-portfolio

## Overview

##### Project type and purpose
- This is a full-stack, serverless personal portfolio web application.
- Frontend: Next.js (App Router), Tailwind CSS, Framer Motion for animations.
- Backend: Supabase Edge Function (Deno) powering the contact form, which sends email via Mailgun.
- Hosting: Render (free tier), kept awake via UptimeRobot.

##### File structure
- app/… contains your Next.js “app router” pages and layout (page.tsx, layout.tsx, api/contact/route.ts).
- app/ThemeProvider.tsx & ThemeToggle.tsx handle light/dark mode.
- public/… holds static assets: images, PDFs, logos.
- next.config.js, tsconfig.json, tailwind.config.js are your framework/build configs.

##### README for additional insights
- Real-time contact form flow: Browser → Supabase Edge Function → Mailgun → Brian’s inbox → Browser confirmation.
- All services are free-tier or open source.
- Uses sharp for image optimization in production; ESLint/Prettier for code quality.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["User's Browser"]:::infra
        NextApp["Next.js App"]:::frontend
        Page["page.tsx"]:::frontend
        Layout["layout.tsx"]:::frontend
        About["about/page.tsx"]:::frontend
        ContactPage["contact/page.tsx"]:::frontend
        Projects["projects/page.tsx"]:::frontend
        ResumePage["resume/page.tsx"]:::frontend
        ThemeProvider["ThemeProvider.tsx"]:::frontend
        ThemeToggle["ThemeToggle.tsx"]:::frontend
        Globals["globals.css"]:::frontend
        StaticAssets["Static Assets (public/)"]:::frontend
        Browser -->|"HTTP GET pages/assets"| NextApp
        NextApp -->|"renders pages"| Browser
        NextApp -->|"serves assets"| StaticAssets
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        EdgeFunc["Supabase Edge Function"]:::backend
        RouteFile["route.ts"]:::backend
        EdgeFunc --> RouteFile
    end

    %% External Services
    subgraph "External Services"
        direction TB
        Mailgun["Mailgun API"]:::external
        Inbox["Brian's Inbox"]:::external
        UptimeRobot["UptimeRobot"]:::infra
        Browser -->|"POST /api/contact"| EdgeFunc
        EdgeFunc -->|"Mailgun API call"| Mailgun
        Mailgun -->|"delivers email"| Inbox
        EdgeFunc -->|"response success"| Browser
        UptimeRobot -->|"ping every 10min"| NextApp
    end

    %% CI/CD Infrastructure
    subgraph "Infrastructure"
        direction TB
        GitHub["GitHub"]:::infra
        Render["Render (Hosting)"]:::infra
        GitHub -->|"push triggers CI/CD"| Render
        Render -->|"hosts Next.js App"| NextApp
        Render -->|"deploys Edge Function"| EdgeFunc
    end

    %% Repo Config & Metadata
    subgraph "Repo Config & Metadata"
        direction TB
        NextConfig["next.config.js"]:::infra
        TailwindConfig["tailwind.config.js"]:::infra
        PostcssConfig["postcss.config.js"]:::infra
        TsConfig["tsconfig.json"]:::infra
        PackageJSON["package.json"]:::infra
        PackageLock["package-lock.json"]:::infra
        Readme["README.md"]:::infra
        EnvExample[".env.example"]:::infra
        Gitignore[".gitignore"]:::infra
    end

    %% Click Events
    click Page "https://github.com/bcastelino/brian-portfolio/blob/main/app/page.tsx"
    click Layout "https://github.com/bcastelino/brian-portfolio/blob/main/app/layout.tsx"
    click About "https://github.com/bcastelino/brian-portfolio/blob/main/app/about/page.tsx"
    click ContactPage "https://github.com/bcastelino/brian-portfolio/blob/main/app/contact/page.tsx"
    click Projects "https://github.com/bcastelino/brian-portfolio/blob/main/app/projects/page.tsx"
    click ResumePage "https://github.com/bcastelino/brian-portfolio/blob/main/app/resume/page.tsx"
    click ThemeProvider "https://github.com/bcastelino/brian-portfolio/blob/main/app/ThemeProvider.tsx"
    click ThemeToggle "https://github.com/bcastelino/brian-portfolio/blob/main/app/ThemeToggle.tsx"
    click Globals "https://github.com/bcastelino/brian-portfolio/blob/main/app/globals.css"
    click RouteFile "https://github.com/bcastelino/brian-portfolio/blob/main/app/api/contact/route.ts"
    click StaticAssets "https://github.com/bcastelino/brian-portfolio/tree/main/public/"
    click NextConfig "https://github.com/bcastelino/brian-portfolio/blob/main/next.config.js"
    click TailwindConfig "https://github.com/bcastelino/brian-portfolio/blob/main/tailwind.config.js"
    click PostcssConfig "https://github.com/bcastelino/brian-portfolio/blob/main/postcss.config.js"
    click TsConfig "https://github.com/bcastelino/brian-portfolio/blob/main/tsconfig.json"
    click PackageJSON "https://github.com/bcastelino/brian-portfolio/blob/main/package.json"
    click PackageLock "https://github.com/bcastelino/brian-portfolio/blob/main/package-lock.json"
    click Readme "https://github.com/bcastelino/brian-portfolio/blob/main/README.md"
    click EnvExample "https://github.com/bcastelino/brian-portfolio/blob/main/.env.example"
    click Gitignore "https://github.com/bcastelino/brian-portfolio/blob/main/.gitignore"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#0366d6,stroke-width:1px;
    classDef backend fill:#d4edda,stroke:#28a745,stroke-width:1px;
    classDef external fill:#fff3cd,stroke:#d39e00,stroke-width:1px;
    classDef infra fill:#e2e3e5,stroke:#6c757d,stroke-width:1px;
```
