# luis-gustavoj/website architecture

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

- Interactive diagram: https://gitdiagram.com/luis-gustavoj/website
- Repository: https://github.com/luis-gustavoj/website

## Overview

##### Project type and purpose
- This is a full-stack, multi-locale Next.js application with server- and client-side rendering, user authentication (via NextAuth), a guestbook feature, theming, and internationalization.
- The README confirms it’s bootstrapped with Create Next App and deployable to Vercel.

##### File structure
- Top-level “app” directory: Next.js 13+ App Router. Subfolders per locale (`[locale]`), each with its own layout, pages (home, about, guestbook).
- `app/api/auth/[...nextauth]`: NextAuth route for OAuth/credentials flows.
- `contexts/`: React Context providers (NextAuthProvider, ThemeProvider).
- `db/`: action wrappers for Prisma operations.
- `prisma/`: schema and migrations folder driving the PostgreSQL (or other) database.
- `lib/`: shared logic (auth helpers, navigation definitions, Prisma client).
- `ui/`: reusable UI components (navigation bar, buttons, forms, images).
- `styles/`, Tailwind config, and global CSS.
- Config files for TypeScript, ESLint, PostCSS, Next.js.

##### Insights from README
- Confirms Next.js stack, dev commands, font optimization, and Vercel deployment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client (Browser)"
        direction TB
        Browser["Browser"]:::client
        subgraph "UI Components"
            direction TB
            Navbar["Navbar"]:::client
            HamburgerMenu["HamburgerMenu"]:::client
            Menu["Menu"]:::client
            GuestbookBox["GuestbookMessageBox"]:::client
            Buttons["Buttons"]:::client
            LanguageSelector["LanguageSelector"]:::client
            ThemeSwitch["ThemeSwitch"]:::client
            BlurImage["BlurImage"]:::client
            Logo["Logo"]:::client
            Footer["Footer"]:::client
            PagesSummary["PagesSummary"]:::client
            Wave["Wave"]:::client
            WavingHand["WavingHand"]:::client
        end
    end

    %% Server Side
    subgraph "Next.js Server"
        direction TB
        AppRouter["Next.js App Router\n(multi-locale pages & layouts)"]:::server
        AuthAPI["API Route\n/app/api/auth/[...nextauth]"]:::server
        subgraph "React Context Providers"
            direction TB
            NextAuthProv["NextAuthProvider"]:::server
            ThemeProv["ThemeProvider"]:::server
        end
        subgraph "Data Access Layer"
            direction TB
            PrismaClient["Prisma Client\nlib/prisma.ts"]:::server
            DBActions["DB Actions\ndb/actions.ts"]:::server
        end
        subgraph "i18n Resources"
            direction TB
            I18nConfig["i18n Config\ni18n.ts"]:::server
            MessagesEN["messages/en.json"]:::server
            MessagesPT["messages/pt.json"]:::server
        end
        subgraph "Static Assets"
            direction TB
            StaticAssets["public/\nnext/font"]:::static
        end
    end

    %% External Services
    subgraph "External Services"
        direction TB
        OAuth["OAuth Providers (Google, GitHub, etc.)"]:::external
    end

    %% Database
    subgraph "Database"
        direction TB
        DB["PostgreSQL Database"]:::db
        DBSchema["schema.prisma"]:::db
        MIG["migration.sql"]:::db
    end

    %% Connections
    Browser -->|"renders UI"| Navbar
    Browser -->|"renders UI"| GuestbookBox
    Navbar --> HamburgerMenu
    Navbar --> Menu
    GuestbookBox --> Buttons
    Browser -->|"requests pages"| AppRouter
    AppRouter --> NextAuthProv
    AppRouter --> ThemeProv
    AppRouter --> AuthAPI
    AppRouter --> PrismaClient
    AppRouter --> I18nConfig
    AppRouter --> StaticAssets
    AuthAPI -->|"auth flow"| OAuth
    OAuth -->|"callback"| AuthAPI
    AuthAPI --> DBActions
    DBActions --> PrismaClient
    PrismaClient --> DB
    DBSchema --> DB
    MIG --> DB
    I18nConfig --> MessagesEN
    I18nConfig --> MessagesPT

    %% Click Events
    click AppRouter "https://github.com/luis-gustavoj/website/blob/main/app/[locale]/layout.tsx"
    click AppRouter "https://github.com/luis-gustavoj/website/blob/main/app/[locale]/(pages)/page.tsx"
    click AppRouter "https://github.com/luis-gustavoj/website/blob/main/app/[locale]/(pages)/about/page.tsx"
    click AppRouter "https://github.com/luis-gustavoj/website/blob/main/app/[locale]/(pages)/guestbook/page.tsx"
    click AuthAPI "https://github.com/luis-gustavoj/website/blob/main/app/api/auth/[...nextauth]/route.ts"
    click NextAuthProv "https://github.com/luis-gustavoj/website/blob/main/contexts/NextAuthProvider.tsx"
    click ThemeProv "https://github.com/luis-gustavoj/website/blob/main/contexts/ThemeProvider.tsx"
    click PrismaClient "https://github.com/luis-gustavoj/website/blob/main/lib/prisma.ts"
    click DBActions "https://github.com/luis-gustavoj/website/blob/main/db/actions.ts"
    click DBSchema "https://github.com/luis-gustavoj/website/blob/main/prisma/schema.prisma"
    click MIG "https://github.com/luis-gustavoj/website/blob/main/prisma/migrations/20240409133223_/migration.sql"
    click I18nConfig "https://github.com/luis-gustavoj/website/blob/main/i18n.ts"
    click MessagesEN "https://github.com/luis-gustavoj/website/blob/main/messages/en.json"
    click MessagesPT "https://github.com/luis-gustavoj/website/blob/main/messages/pt.json"
    click Navbar "https://github.com/luis-gustavoj/website/blob/main/ui/Navbar/index.tsx"
    click HamburgerMenu "https://github.com/luis-gustavoj/website/blob/main/ui/Navbar/HamburgerMenu.tsx"
    click Menu "https://github.com/luis-gustavoj/website/blob/main/ui/Navbar/Menu.tsx"
    click GuestbookBox "https://github.com/luis-gustavoj/website/blob/main/ui/GuestbookMessageBox/index.tsx"
    click Buttons "https://github.com/luis-gustavoj/website/blob/main/ui/GuestbookMessageBox/Buttons.tsx"
    click LanguageSelector "https://github.com/luis-gustavoj/website/blob/main/ui/LanguageSelector.tsx"
    click ThemeSwitch "https://github.com/luis-gustavoj/website/blob/main/ui/ThemeSwitch.tsx"
    click BlurImage "https://github.com/luis-gustavoj/website/blob/main/ui/BlurImage.tsx"
    click Logo "https://github.com/luis-gustavoj/website/blob/main/ui/Logo.tsx"
    click Footer "https://github.com/luis-gustavoj/website/blob/main/ui/Footer.tsx"
    click PagesSummary "https://github.com/luis-gustavoj/website/blob/main/ui/PagesSummary.tsx"
    click Wave "https://github.com/luis-gustavoj/website/blob/main/ui/Wave.tsx"
    click WavingHand "https://github.com/luis-gustavoj/website/blob/main/ui/WavingHand.tsx"

    %% Styles
    classDef client fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef server fill:#DFFFE0,stroke:#226600,color:#226600
    classDef external fill:#FFEFD0,stroke:#bb7700,color:#bb5500
    classDef static fill:#F0F0F0,stroke:#888888,color:#555555
    classDef db fill:#FFE0E0,stroke:#bb0000,color:#990000
```
