# frankji1019/portfolio architecture

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

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

## Overview

This repository combines a public portfolio, an editing CMS, and Lambda-backed content services. The main workflow is an administrator editing section data in the CMS, which calls the REST API to persist JSON in S3; the portfolio fetches that content at request time and renders its sections. Separate documented branches handle guest/read-only access, Cognito authentication, resume discovery and Google Drive-to-S3 synchronization, and portfolio revalidation. Backend and several portfolio/CMS features are represented from the README and file tree where implementation excerpts were unavailable.

Main entry points: [`portfolio/src/app/page.tsx`](https://github.com/frankji1019/portfolio/blob/master/portfolio/src/app/page.tsx) (Portfolio app), [`cms/src/App.tsx`](https://github.com/frankji1019/portfolio/blob/master/cms/src/App.tsx) (CMS router), [`cms-service-functions/src/portfolio-sync-resume.ts`](https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-sync-resume.ts) (Sync resume), [`portfolio/src/components/portfolio-data-provider.tsx`](https://github.com/frankji1019/portfolio/blob/master/portfolio/src/components/portfolio-data-provider.tsx) (Portfolio data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cms["CMS editing"]
  node_cmsapp["CMS router<br/>[App.tsx]"]
  node_auth["CMS authentication<br/>[AuthProvider.tsx]"]
  node_login["Login screen<br/>[LoginPage.tsx]"]
  node_sectionedit["Section editors"]
  node_experience["Experience editor<br/>[ExperiencePage.tsx]"]
  node_forms["Form controls<br/>[FormControls.tsx]"]
  node_savehook["Save handling<br/>[useSaveHandler.ts]"]
  node_visibility["Visibility editor"]
  node_resumeui["Resume tools<br/>[ResumePage.tsx]"]
  node_sectionapi["Section API hooks<br/>[content-section.ts]"]
  node_resumapi["Resume API hooks<br/>[resume.ts]"]
end

subgraph group_backend["Content services"]
  node_lambdaall["Fetch all sections"]
  node_lambdasections["Section CRUD"]
  node_lambdalist["List resumes"]
  node_lambdasync["Sync resume"]
end

subgraph group_site["Public portfolio"]
  node_publicsite["Portfolio app<br/>[page.tsx]"]
  node_dataprovider["Portfolio data"]
  node_sections["Rendered sections"]
  node_terminal["Terminal experience<br/>[terminal.tsx]"]
  node_seo["SEO and discovery<br/>[sitemap.ts]"]
  node_revalidate["Cache revalidation<br/>[route.ts]"]
end

subgraph group_cloud["Cloud services"]
  node_gateway["REST API Gateway"]
  node_s3[("S3 content and resumes")]
  node_cognito["AWS Cognito"]
  node_drive["Google Drive API"]
  node_ssm[("SSM credentials")]
end

node_admin(("Admin / guest"))

node_admin -->|"uses CMS"| node_cmsapp
node_cmsapp -->|"checks role"| node_auth
node_cmsapp -->|"routes login"| node_login
node_login -.->|"submits credentials"| node_auth
node_auth -->|"authenticates"| node_cognito
node_cmsapp -->|"routes sections"| node_sectionedit
node_sectionedit -.->|"loads and saves"| node_sectionapi
node_experience -->|"renders controls"| node_forms
node_experience -->|"delegates save"| node_savehook
node_visibility -->|"reads and updates"| node_sectionapi
node_resumeui -.->|"requests resume ops"| node_resumapi
node_sectionapi -->|"HTTP section calls"| node_gateway
node_resumapi -->|"HTTP resume calls"| node_gateway
node_gateway -->|"routes section calls"| node_lambdasections
node_gateway -->|"routes content fetch"| node_lambdaall
node_gateway -->|"routes resume listing"| node_lambdalist
node_gateway -->|"routes resume sync"| node_lambdasync
node_lambdaall -->|"reads all content"| node_s3
node_lambdasections -->|"reads and writes"| node_s3
node_lambdalist -->|"lists Drive files"| node_drive
node_lambdasync -->|"exports document"| node_drive
node_lambdasync -->|"stores PDF"| node_s3
node_lambdasync -->|"loads credentials"| node_ssm
node_admin -->|"visits portfolio"| node_publicsite
node_publicsite -.->|"renders with data"| node_dataprovider
node_dataprovider -->|"fetches all sections"| node_gateway
node_dataprovider -.->|"receives content"| node_lambdaall
node_dataprovider -.->|"content sourced from"| node_s3
node_publicsite -.->|"presents content"| node_sections
node_publicsite -->|"offers terminal mode"| node_terminal
node_publicsite -->|"provides SEO outputs"| node_seo
node_revalidate -.->|"revalidates site"| node_publicsite

click node_cmsapp "https://github.com/frankji1019/portfolio/blob/master/cms/src/App.tsx"
click node_auth "https://github.com/frankji1019/portfolio/blob/master/cms/src/providers/AuthProvider.tsx"
click node_login "https://github.com/frankji1019/portfolio/blob/master/cms/src/pages/LoginPage/LoginPage.tsx"
click node_sectionedit "https://github.com/frankji1019/portfolio/tree/master/cms/src/pages"
click node_experience "https://github.com/frankji1019/portfolio/blob/master/cms/src/pages/ExperiencePage/ExperiencePage.tsx"
click node_forms "https://github.com/frankji1019/portfolio/blob/master/cms/src/components/FormControls.tsx"
click node_savehook "https://github.com/frankji1019/portfolio/blob/master/cms/src/hooks/useSaveHandler.ts"
click node_visibility "https://github.com/frankji1019/portfolio/blob/master/cms/src/hooks/useSectionVisibility.ts"
click node_resumeui "https://github.com/frankji1019/portfolio/blob/master/cms/src/pages/ResumePage/ResumePage.tsx"
click node_sectionapi "https://github.com/frankji1019/portfolio/blob/master/cms/src/api-hooks/content-section.ts"
click node_resumapi "https://github.com/frankji1019/portfolio/blob/master/cms/src/api-hooks/resume.ts"
click node_lambdaall "https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-fetch-all.ts"
click node_lambdasections "https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-sections.ts"
click node_lambdalist "https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-list-resumes.ts"
click node_lambdasync "https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-sync-resume.ts"
click node_publicsite "https://github.com/frankji1019/portfolio/blob/master/portfolio/src/app/page.tsx"
click node_dataprovider "https://github.com/frankji1019/portfolio/blob/master/portfolio/src/components/portfolio-data-provider.tsx"
click node_sections "https://github.com/frankji1019/portfolio/tree/master/portfolio/src/components"
click node_terminal "https://github.com/frankji1019/portfolio/blob/master/portfolio/src/components/terminal.tsx"
click node_seo "https://github.com/frankji1019/portfolio/blob/master/portfolio/src/app/sitemap.ts"
click node_revalidate "https://github.com/frankji1019/portfolio/blob/master/portfolio/src/app/api/revalidate/route.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_cmsapp,node_auth,node_login,node_sectionedit,node_experience,node_forms,node_savehook,node_visibility,node_resumeui,node_sectionapi,node_resumapi toneBlue
class node_lambdaall,node_lambdasections,node_lambdalist,node_lambdasync toneAmber
class node_publicsite,node_dataprovider,node_sections,node_terminal,node_seo,node_revalidate toneMint
class node_gateway,node_s3,node_cognito,node_drive,node_ssm toneRose
class node_admin toneIndigo
```

## Components

### CMS editing

- [CMS router](https://github.com/frankji1019/portfolio/blob/master/cms/src/App.tsx): `cms/src/App.tsx`
- [CMS authentication](https://github.com/frankji1019/portfolio/blob/master/cms/src/providers/AuthProvider.tsx): `cms/src/providers/AuthProvider.tsx`
- [Login screen](https://github.com/frankji1019/portfolio/blob/master/cms/src/pages/LoginPage/LoginPage.tsx): `cms/src/pages/LoginPage/LoginPage.tsx`
- [Section editors](https://github.com/frankji1019/portfolio/tree/master/cms/src/pages): `cms/src/pages`
- [Experience editor](https://github.com/frankji1019/portfolio/blob/master/cms/src/pages/ExperiencePage/ExperiencePage.tsx): `cms/src/pages/ExperiencePage/ExperiencePage.tsx`
- [Form controls](https://github.com/frankji1019/portfolio/blob/master/cms/src/components/FormControls.tsx): `cms/src/components/FormControls.tsx`
- [Save handling](https://github.com/frankji1019/portfolio/blob/master/cms/src/hooks/useSaveHandler.ts): `cms/src/hooks/useSaveHandler.ts`
- [Visibility editor](https://github.com/frankji1019/portfolio/blob/master/cms/src/hooks/useSectionVisibility.ts): `cms/src/hooks/useSectionVisibility.ts`
- [Resume tools](https://github.com/frankji1019/portfolio/blob/master/cms/src/pages/ResumePage/ResumePage.tsx): `cms/src/pages/ResumePage/ResumePage.tsx`
- [Section API hooks](https://github.com/frankji1019/portfolio/blob/master/cms/src/api-hooks/content-section.ts): `cms/src/api-hooks/content-section.ts`
- [Resume API hooks](https://github.com/frankji1019/portfolio/blob/master/cms/src/api-hooks/resume.ts): `cms/src/api-hooks/resume.ts`

### Content services

- [Fetch all sections](https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-fetch-all.ts): `cms-service-functions/src/portfolio-fetch-all.ts`
- [Section CRUD](https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-sections.ts): `cms-service-functions/src/portfolio-sections.ts`
- [List resumes](https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-list-resumes.ts): `cms-service-functions/src/portfolio-list-resumes.ts`
- [Sync resume](https://github.com/frankji1019/portfolio/blob/master/cms-service-functions/src/portfolio-sync-resume.ts): `cms-service-functions/src/portfolio-sync-resume.ts`

### Public portfolio

- [Portfolio app](https://github.com/frankji1019/portfolio/blob/master/portfolio/src/app/page.tsx): `portfolio/src/app/page.tsx`
- [Portfolio data](https://github.com/frankji1019/portfolio/blob/master/portfolio/src/components/portfolio-data-provider.tsx): `portfolio/src/components/portfolio-data-provider.tsx`
- [Rendered sections](https://github.com/frankji1019/portfolio/tree/master/portfolio/src/components): `portfolio/src/components`
- [Terminal experience](https://github.com/frankji1019/portfolio/blob/master/portfolio/src/components/terminal.tsx): `portfolio/src/components/terminal.tsx`
- [SEO and discovery](https://github.com/frankji1019/portfolio/blob/master/portfolio/src/app/sitemap.ts): `portfolio/src/app/sitemap.ts`
- [Cache revalidation](https://github.com/frankji1019/portfolio/blob/master/portfolio/src/app/api/revalidate/route.ts): `portfolio/src/app/api/revalidate/route.ts`

### Cloud services

- **REST API Gateway**
- **S3 content and resumes**
- **AWS Cognito**
- **Google Drive API**
- **SSM credentials**

### Other components

- **Admin / guest**

## Connections

- Admin / guest → CMS router: uses CMS (evidence: `README.md`)
- CMS router → CMS authentication: checks role (evidence: `cms/src/App.tsx`)
- CMS router → Login screen: routes login (evidence: `cms/src/App.tsx`)
- Login screen → CMS authentication: submits credentials (evidence: `cms/src/providers/AuthProvider.tsx`)
- CMS authentication → AWS Cognito: authenticates (evidence: `README.md`)
- CMS router → Section editors: routes sections (evidence: `cms/src/App.tsx`)
- Section editors → Section API hooks: loads and saves (evidence: `cms/src/pages/AboutPage/index.tsx`)
- Experience editor → Form controls: renders controls (evidence: `cms/src/pages/ExperiencePage/ExperiencePage.tsx`)
- Experience editor → Save handling: delegates save (evidence: `cms/src/pages/ExperiencePage/ExperiencePage.tsx`)
- Visibility editor → Section API hooks: reads and updates (evidence: `cms/src/hooks/useSectionVisibility.ts`)
- Resume tools → Resume API hooks: requests resume ops
- Section API hooks → REST API Gateway: HTTP section calls (evidence: `README.md`)
- Resume API hooks → REST API Gateway: HTTP resume calls (evidence: `README.md`)
- REST API Gateway → Section CRUD: routes section calls (evidence: `README.md`)
- REST API Gateway → Fetch all sections: routes content fetch (evidence: `README.md`)
- REST API Gateway → List resumes: routes resume listing (evidence: `README.md`)
- REST API Gateway → Sync resume: routes resume sync (evidence: `README.md`)
- Fetch all sections → S3 content and resumes: reads all content (evidence: `README.md`)
- Section CRUD → S3 content and resumes: reads and writes (evidence: `README.md`)
- List resumes → Google Drive API: lists Drive files (evidence: `README.md`)
- Sync resume → Google Drive API: exports document (evidence: `README.md`)
- Sync resume → S3 content and resumes: stores PDF (evidence: `README.md`)
- Sync resume → SSM credentials: loads credentials (evidence: `README.md`)
- Admin / guest → Portfolio app: visits portfolio (evidence: `README.md`)
- Portfolio app → Portfolio data: renders with data
- Portfolio data → REST API Gateway: fetches all sections (evidence: `README.md`)
- Portfolio data → Fetch all sections: receives content
- Portfolio data → S3 content and resumes: content sourced from
- Portfolio app → Rendered sections: presents content
- Portfolio app → Terminal experience: offers terminal mode
- Portfolio app → SEO and discovery: provides SEO outputs (evidence: `README.md`)
- Cache revalidation → Portfolio app: revalidates site
