# faiznation/portofolio-faiznation architecture

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

- Interactive diagram: https://gitdiagram.com/faiznation/portofolio-faiznation
- Repository: https://github.com/faiznation/portofolio-faiznation

## Overview

FaizNation is a personal portfolio site. Visitors browse profile, projects, writing, gallery, and achievements; they can also contact the owner or interact with comments. The shared layout supplies navigation and site-wide widgets, while API routes handle authentication and user/comment operations backed by Prisma. The graph follows the available tree and source index; links between routes and components are included only where the index or excerpts show them. Several content-data files and some route implementations were not supplied, so those details are not inferred.

Main entry points: [`app/layout.tsx`](https://github.com/faiznation/portofolio-faiznation/blob/main/app/layout.tsx) (Shared layout), [`lib/db.ts`](https://github.com/faiznation/portofolio-faiznation/blob/main/lib/db.ts) (Prisma database), [`app/api/comments/route.ts`](https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/comments/route.ts) (Comments API), [`lib/auth.ts`](https://github.com/faiznation/portofolio-faiznation/blob/main/lib/auth.ts) (Auth configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio site"]
  node_layout["Shared layout<br/>[layout.tsx]"]
  node_home["Home page<br/>[page.tsx]"]
end

subgraph group_content["Portfolio content"]
  node_profile["About page<br/>[page.tsx]"]
  node_projects["Projects page<br/>[page.tsx]"]
  node_writing["Writing pages<br/>[page.tsx]"]
  node_gallery["Gallery pages<br/>[page.tsx]"]
  node_achievements["Achievements page<br/>[page.tsx]"]
  node_contact["Contact page<br/>[page.tsx]"]
end

subgraph group_interaction["Interactive components"]
  node_clientlayout["Client layout<br/>[ClientLayout.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_chat["Chat widget<br/>[ChatWidget.tsx]"]
  node_network["Network alert"]
  node_search["Site search<br/>[SearchBar.tsx]"]
  node_projectcard["Project card<br/>[ProjectCard.tsx]"]
  node_gallerygrid["Gallery grid<br/>[GalleryGrid.tsx]"]
  node_imagemodal["Image modal<br/>[ImageModal.tsx]"]
  node_skills["Skills tabs<br/>[SkillsTabs.tsx]"]
  node_experience["Experience tabs<br/>[ExperienceTabs.tsx]"]
  node_preview["Link preview<br/>[link-preview.tsx]"]
end

subgraph group_backend["APIs and persistence"]
  node_commentsapi["Comments API<br/>[route.ts]"]
  node_contactapi["Contact API<br/>[route.ts]"]
  node_usersapi["User API<br/>[route.ts]"]
  node_authroute["Auth route<br/>[route.ts]"]
  node_auth["Auth configuration<br/>[auth.ts]"]
  node_database[("Prisma database<br/>[db.ts]")]
  node_email["Email service<br/>[email.ts]"]
end

node_visitor(("Visitor"))
node_postgres[("PostgreSQL")]

node_visitor -->|"opens site"| node_layout
node_layout -->|"wraps content"| node_clientlayout
node_layout -->|"renders"| node_navbar
node_layout -->|"renders"| node_footer
node_layout -->|"renders"| node_chat
node_layout -->|"renders"| node_network
node_clientlayout -->|"wraps children"| node_layout
node_home -->|"renders"| node_preview
node_navbar -->|"renders"| node_search
node_projects -->|"renders"| node_projectcard
node_gallery -->|"uses grid"| node_gallerygrid
node_gallerygrid -->|"opens modal"| node_imagemodal
node_achievements -->|"renders"| node_imagemodal
node_profile -->|"renders"| node_skills
node_profile -->|"renders"| node_experience
node_commentsapi -->|"checks session"| node_auth
node_commentsapi -->|"reads and writes"| node_database
node_commentsapi -->|"sends reply notice"| node_email
node_usersapi -->|"reads user"| node_database
node_authroute -->|"uses options"| node_auth
node_auth -->|"configures adapter"| node_database
node_database -->|"connects through pool"| node_postgres

click node_layout "https://github.com/faiznation/portofolio-faiznation/blob/main/app/layout.tsx"
click node_home "https://github.com/faiznation/portofolio-faiznation/blob/main/app/page.tsx"
click node_profile "https://github.com/faiznation/portofolio-faiznation/blob/main/app/about/page.tsx"
click node_projects "https://github.com/faiznation/portofolio-faiznation/blob/main/app/projects/page.tsx"
click node_writing "https://github.com/faiznation/portofolio-faiznation/blob/main/app/writing/page.tsx"
click node_gallery "https://github.com/faiznation/portofolio-faiznation/blob/main/app/gallery/page.tsx"
click node_achievements "https://github.com/faiznation/portofolio-faiznation/blob/main/app/achievements/page.tsx"
click node_contact "https://github.com/faiznation/portofolio-faiznation/blob/main/app/contact/page.tsx"
click node_clientlayout "https://github.com/faiznation/portofolio-faiznation/blob/main/components/ClientLayout.tsx"
click node_navbar "https://github.com/faiznation/portofolio-faiznation/blob/main/components/Navbar.tsx"
click node_footer "https://github.com/faiznation/portofolio-faiznation/blob/main/components/Footer.tsx"
click node_chat "https://github.com/faiznation/portofolio-faiznation/blob/main/components/ChatWidget.tsx"
click node_network "https://github.com/faiznation/portofolio-faiznation/blob/main/components/NetworkStatusAlert.tsx"
click node_search "https://github.com/faiznation/portofolio-faiznation/blob/main/components/SearchBar.tsx"
click node_projectcard "https://github.com/faiznation/portofolio-faiznation/blob/main/components/ProjectCard.tsx"
click node_gallerygrid "https://github.com/faiznation/portofolio-faiznation/blob/main/components/GalleryGrid.tsx"
click node_imagemodal "https://github.com/faiznation/portofolio-faiznation/blob/main/components/ImageModal.tsx"
click node_skills "https://github.com/faiznation/portofolio-faiznation/blob/main/components/SkillsTabs.tsx"
click node_experience "https://github.com/faiznation/portofolio-faiznation/blob/main/components/ExperienceTabs.tsx"
click node_preview "https://github.com/faiznation/portofolio-faiznation/blob/main/components/ui/link-preview.tsx"
click node_commentsapi "https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/comments/route.ts"
click node_contactapi "https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/contact/route.ts"
click node_usersapi "https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/users/%5Bid%5D/route.ts"
click node_authroute "https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_auth "https://github.com/faiznation/portofolio-faiznation/blob/main/lib/auth.ts"
click node_database "https://github.com/faiznation/portofolio-faiznation/blob/main/lib/db.ts"
click node_email "https://github.com/faiznation/portofolio-faiznation/blob/main/lib/email.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_layout,node_home toneBlue
class node_profile,node_projects,node_writing,node_gallery,node_achievements,node_contact,node_postgres toneAmber
class node_clientlayout,node_navbar,node_footer,node_chat,node_network,node_search,node_projectcard,node_gallerygrid,node_imagemodal,node_skills,node_experience,node_preview toneMint
class node_commentsapi,node_contactapi,node_usersapi,node_authroute,node_auth,node_database,node_email toneRose
class node_visitor toneIndigo
```

## Components

### Portfolio site

- [Shared layout](https://github.com/faiznation/portofolio-faiznation/blob/main/app/layout.tsx): `app/layout.tsx`
- [Home page](https://github.com/faiznation/portofolio-faiznation/blob/main/app/page.tsx): `app/page.tsx`

### Portfolio content

- [About page](https://github.com/faiznation/portofolio-faiznation/blob/main/app/about/page.tsx): `app/about/page.tsx`
- [Projects page](https://github.com/faiznation/portofolio-faiznation/blob/main/app/projects/page.tsx): `app/projects/page.tsx`
- [Writing pages](https://github.com/faiznation/portofolio-faiznation/blob/main/app/writing/page.tsx): `app/writing/page.tsx`
- [Gallery pages](https://github.com/faiznation/portofolio-faiznation/blob/main/app/gallery/page.tsx): `app/gallery/page.tsx`
- [Achievements page](https://github.com/faiznation/portofolio-faiznation/blob/main/app/achievements/page.tsx): `app/achievements/page.tsx`
- [Contact page](https://github.com/faiznation/portofolio-faiznation/blob/main/app/contact/page.tsx): `app/contact/page.tsx`

### Interactive components

- [Client layout](https://github.com/faiznation/portofolio-faiznation/blob/main/components/ClientLayout.tsx): `components/ClientLayout.tsx`
- [Navigation](https://github.com/faiznation/portofolio-faiznation/blob/main/components/Navbar.tsx): `components/Navbar.tsx`
- [Footer](https://github.com/faiznation/portofolio-faiznation/blob/main/components/Footer.tsx): `components/Footer.tsx`
- [Chat widget](https://github.com/faiznation/portofolio-faiznation/blob/main/components/ChatWidget.tsx): `components/ChatWidget.tsx`
- [Network alert](https://github.com/faiznation/portofolio-faiznation/blob/main/components/NetworkStatusAlert.tsx): `components/NetworkStatusAlert.tsx`
- [Site search](https://github.com/faiznation/portofolio-faiznation/blob/main/components/SearchBar.tsx): `components/SearchBar.tsx`
- [Project card](https://github.com/faiznation/portofolio-faiznation/blob/main/components/ProjectCard.tsx): `components/ProjectCard.tsx`
- [Gallery grid](https://github.com/faiznation/portofolio-faiznation/blob/main/components/GalleryGrid.tsx): `components/GalleryGrid.tsx`
- [Image modal](https://github.com/faiznation/portofolio-faiznation/blob/main/components/ImageModal.tsx): `components/ImageModal.tsx`
- [Skills tabs](https://github.com/faiznation/portofolio-faiznation/blob/main/components/SkillsTabs.tsx): `components/SkillsTabs.tsx`
- [Experience tabs](https://github.com/faiznation/portofolio-faiznation/blob/main/components/ExperienceTabs.tsx): `components/ExperienceTabs.tsx`
- [Link preview](https://github.com/faiznation/portofolio-faiznation/blob/main/components/ui/link-preview.tsx): `components/ui/link-preview.tsx`

### APIs and persistence

- [Comments API](https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/comments/route.ts): `app/api/comments/route.ts`
- [Contact API](https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/contact/route.ts): `app/api/contact/route.ts`
- [User API](https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/users/%5Bid%5D/route.ts): `app/api/users/[id]/route.ts`
- [Auth route](https://github.com/faiznation/portofolio-faiznation/blob/main/app/api/auth/%5B...nextauth%5D/route.ts): `app/api/auth/[...nextauth]/route.ts`
- [Auth configuration](https://github.com/faiznation/portofolio-faiznation/blob/main/lib/auth.ts): `lib/auth.ts`
- [Prisma database](https://github.com/faiznation/portofolio-faiznation/blob/main/lib/db.ts): `lib/db.ts`
- [Email service](https://github.com/faiznation/portofolio-faiznation/blob/main/lib/email.ts): `lib/email.ts`

### Other components

- **Visitor**
- **PostgreSQL**

## Connections

- Visitor → Shared layout: opens site (evidence: `app/layout.tsx`)
- Shared layout → Client layout: wraps content (evidence: `app/layout.tsx`)
- Shared layout → Navigation: renders (evidence: `app/layout.tsx`)
- Shared layout → Footer: renders (evidence: `app/layout.tsx`)
- Shared layout → Chat widget: renders (evidence: `app/layout.tsx`)
- Shared layout → Network alert: renders (evidence: `app/layout.tsx`)
- Client layout → Shared layout: wraps children (evidence: `components/ClientLayout.tsx`)
- Home page → Link preview: renders (evidence: `app/page.tsx`)
- Navigation → Site search: renders (evidence: `components/Navbar.tsx`)
- Projects page → Project card: renders (evidence: `app/projects/page.tsx`)
- Gallery pages → Gallery grid: uses grid
- Gallery grid → Image modal: opens modal (evidence: `components/GalleryGrid.tsx`)
- Achievements page → Image modal: renders (evidence: `app/achievements/page.tsx`)
- About page → Skills tabs: renders (evidence: `app/about/page.tsx`)
- About page → Experience tabs: renders (evidence: `app/about/page.tsx`)
- Comments API → Auth configuration: checks session (evidence: `app/api/comments/route.ts`)
- Comments API → Prisma database: reads and writes (evidence: `app/api/comments/route.ts`)
- Comments API → Email service: sends reply notice (evidence: `app/api/comments/route.ts`)
- User API → Prisma database: reads user (evidence: `app/api/users/[id]/route.ts`)
- Auth route → Auth configuration: uses options (evidence: `app/api/auth/[...nextauth]/route.ts`)
- Auth configuration → Prisma database: configures adapter (evidence: `lib/auth.ts`)
- Prisma database → PostgreSQL: connects through pool (evidence: `lib/db.ts`)
