mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-23 00:20:40 +07:00
refactor(i18n): split content into structure JSON and per-language dictionaries
Phase 1 of spec-v4-live-edit: data/i18n foundation, no visible feature.
- src/data/{profile,skills,experience,projects}.json: language-neutral
structure documents with thin typed loaders; all prose moved to
src/i18n/locales/{vi,en}/content.json; chrome strings to ui.json
- src/i18n/: dict-types, cross-document validator (runs at module load and
via pnpm validate:content), loader joining structure+text once (UI/CONTENT),
I18nProvider/useI18n mounted in App under LanguageProvider
- all 22 consumers read joined records via useI18n(); field.ts and
strings.ts deleted; *En field pairs removed from the domain types
- hero tagline renders as plain-text segments (D9); philosophy quotes as
paragraph arrays; footer display name now localizes per language (D6)
- resume generator consumes UI/CONTENT; generated resume HTML verified
byte-identical (EN+VI) before/after the migration
- AGENTS.md and v3/v3-i18n + v4 specs updated; deploy.yml concurrency group
This commit is contained in:
1 parent
f5687cce1c
commit
e6b4d83084
50 files changed
+2215
-961
No files matched your search
@@ -5,6 +5,10 @@ on:
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
||||
concurrency:
|
||||
group: deploy
|
||||
cancel-in-progress: false
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -15,6 +19,7 @@ jobs:
|
||||
cache: true
|
||||
version: ^12.0.0
|
||||
runtime: node@24
|
||||
- run: pnpm tsx scripts/validate-content.ts
|
||||
- run: pnpm build
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Project
|
||||
|
||||
Personal engineering portfolio — multi-page SPA built with React + TypeScript + Vite. Data-driven content from `src/data/`, styled with CSS variables supporting dark/light themes. Motion animations via `motion/react`. Bilingual resume generation (EN/VI).
|
||||
Personal engineering portfolio — multi-page SPA built with React + TypeScript + Vite. Data-driven content from JSON structure documents (`src/data/*.json`) and per-language dictionaries (`src/i18n/locales/`), styled with CSS variables supporting dark/light themes. Motion animations via `motion/react`. Bilingual resume generation (EN/VI).
|
||||
|
||||
## Tech Stack
|
||||
|
||||
@@ -26,6 +26,7 @@ Personal engineering portfolio — multi-page SPA built with React + TypeScript
|
||||
| `pnpm build:resume` | Generate resume PDF (default EN) via Playwright |
|
||||
| `pnpm build:resume-all` | Generate bilingual resume PDFs (EN + VI) |
|
||||
| `pnpm lint` | Run Oxlint |
|
||||
| `pnpm validate:content` | Validate the content dictionaries against the structure documents (also run by the loader at module load) |
|
||||
| `pnpm sitemap` | Regenerate `dist/sitemap.xml` on its own (also run by `pnpm build`) |
|
||||
| `pnpm preview` | Preview production build locally |
|
||||
|
||||
@@ -61,21 +62,25 @@ Personal engineering portfolio — multi-page SPA built with React + TypeScript
|
||||
- Accent has two tiers: `--accent` / `--accent-hover` / `--accent-active` are the bright signal colours (links, underlines, borders, glows) and the fill of the pale accent surfaces (palette-option hover, `.tag-accent`, `.back-to-top`, resume summary bar); `--accent-solid` / `-hover` / `-active` plus `--text-on-accent-solid` are the deeper fill and light text used by `.btn-primary` and `.badge-accent`, which is what lets a dark-mode button carry light text. The solid family is declared in all five blocks of `src/index.css` (dark red, light red, dark blue, light blue, the `prefers-color-scheme` bridge); the two light blocks duplicate the plain accent values verbatim, so light mode does not move. Spec: `docs/design/specs/v3/spec-v3-nav-cta-enhancements.md`
|
||||
- Picker, two renderings, both present at every width: the bar uses `src/components/layout/ThemePaletteMenu.tsx` — icon-only trigger (`nav-control nav-palette-trigger`, a 20px half-circle swatch: active palette's accent on the left, `--swatch-empty` on the right; no text, no chevron; the name lives in `aria-label`, the hint in `title`) opening the `#palette-menu` panel. The sheet renders its own Theme color row inside `MobileMenu.tsx` from `paletteIds` + `paletteMeta` as `.mobile-menu-icon-option` buttons — the 44px icon-only square the Language row shares; the Mode row renders the same squares with the bar's own mode line art — `MoonIcon` for dark, `SunIcon` for light, both from `src/components/ui/icons.tsx` and shared with the bar's theme control — each option naming its mode in `aria-label`/`title`. `ThemePaletteMenu` has no `variant` prop and is never mounted in the sheet
|
||||
- Preview chips are theme-aware: `--preview-red-accent` / `--preview-blue-accent` are declared per theme — `:root` dark pair, `:root[data-theme='light']` light pair, repeated in the `prefers-color-scheme` bridge — and mirror that block's `--accent`, so a submenu dot and the bar swatch's accent half are the same colour in the same theme. Each chip names its own palette through `data-preview`, so the two `[data-palette='blue']` blocks declare no preview token; `--swatch-empty` stays one constant. Spec: `docs/design/specs/v3/spec-v3-nav-swatch-and-hamburger.md`
|
||||
- Bar controls share one chrome: `.nav-control` covers the language toggle, the mode toggle and the palette trigger (44px bordered box, accent border + icon on hover/open, one `:focus-visible`). The hamburger leads the bar at every width it appears: `.nav-brand` (`display: flex; gap: 4px` — its icons carry no borders, so the spacing reads between glyphs: 4px between 44px targets is 24px between the 24px glyphs, a tight brand cluster while hover fills and 2px-offset focus rings stay clear) holds it first and the brand home icon right after, at the bar's left edge — `.nav-logo` is a 24px stroke house in a 44px target, a `<Link to="/">` named by the translated `strings.nav.home` label with the svg `aria-hidden`, so it carries its own `:focus-visible` ring. Third in the brand group is the resume entry — `src/components/layout/ResumeNavButton.tsx`, a `nav-control nav-resume-trigger` 44px target that **carries no border** (`border-color: transparent` at rest, on hover and while open, because it sits beside the borderless home icon; the hover fill and the `:focus-visible` ring stay; its glyph is `--accent` at every state — rest, hover, open — so the entry always carries the active theme's signal colour and follows the palette switch), holding `ResumeIcon size={24}` — the same 24px the home glyph beside it uses, so the two brand icons share a size inside their 44px targets — the resume document glyph, the owner's 30-grid CV artwork adapted to the bar's 24-grid (spec follow-up 19), inlined in `src/components/ui/icons.tsx` because the bar icon must inherit the control's colour — an `<img>` resolves `currentColor` to black and cannot follow the theme: a page outline split on the left edge by a visible dash (`M14 2 H6 a2 2 0 0 0 -2 2 V6` + `M4 10 V12` + `M4 16 v4 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V8 L14 2`; 4px endpoint gaps stay open under 2px round caps), a folded corner (`M14 2 v4 a2 2 0 0 0 2 2 h4`), and stroked CV lettering replacing the content lines (`M9.5 12 A3 3 0 0 0 9.5 18` + `M12.5 12 L15 18 L17.5 12`), in the bar's 2px stroke language; at 1:1 the strokes are exactly 2px and the lettering reads clearly in both themes. Named by `strings.nav.resume`, `aria-haspopup="dialog"` on its own `#resume-modal-nav`; `.nav-resume` is the wrapper that ties trigger to dialog and is what `useClickOutside` watches. `.nav-actions` then carries the three appearance controls in that order (language, mode, theme color) at the right end, their bordered boxes keeping the 16px gap. The sheet's Appearance group follows the same order (Language row, Mode row, Theme color row). Six controls now share the bar at ≤1024px: `@media (max-width: 420px)` keeps 16px padding and drops only the action gap to 8px — the brand group stays at 4px at every width — `@media (max-width: 360px)` drops the padding to 12px — 40 + 44×5 = 260px of controls plus 2×4px brand gaps plus 2×8px action gaps = 284px inside 296px, and every target stays 44px
|
||||
- Bar controls share one chrome: `.nav-control` covers the language toggle, the mode toggle and the palette trigger (44px bordered box, accent border + icon on hover/open, one `:focus-visible`). The hamburger leads the bar at every width it appears: `.nav-brand` (`display: flex; gap: 4px` — its icons carry no borders, so the spacing reads between glyphs: 4px between 44px targets is 24px between the 24px glyphs, a tight brand cluster while hover fills and 2px-offset focus rings stay clear) holds it first and the brand home icon right after, at the bar's left edge — `.nav-logo` is a 24px stroke house in a 44px target, a `<Link to="/">` named by the translated `nav.home` label (UI dictionary, via `useI18n()`) with the svg `aria-hidden`, so it carries its own `:focus-visible` ring. Third in the brand group is the resume entry — `src/components/layout/ResumeNavButton.tsx`, a `nav-control nav-resume-trigger` 44px target that **carries no border** (`border-color: transparent` at rest, on hover and while open, because it sits beside the borderless home icon; the hover fill and the `:focus-visible` ring stay; its glyph is `--accent` at every state — rest, hover, open — so the entry always carries the active theme's signal colour and follows the palette switch), holding `ResumeIcon size={24}` — the same 24px the home glyph beside it uses, so the two brand icons share a size inside their 44px targets — the resume document glyph, the owner's 30-grid CV artwork adapted to the bar's 24-grid (spec follow-up 19), inlined in `src/components/ui/icons.tsx` because the bar icon must inherit the control's colour — an `<img>` resolves `currentColor` to black and cannot follow the theme: a page outline split on the left edge by a visible dash (`M14 2 H6 a2 2 0 0 0 -2 2 V6` + `M4 10 V12` + `M4 16 v4 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V8 L14 2`; 4px endpoint gaps stay open under 2px round caps), a folded corner (`M14 2 v4 a2 2 0 0 0 2 2 h4`), and stroked CV lettering replacing the content lines (`M9.5 12 A3 3 0 0 0 9.5 18` + `M12.5 12 L15 18 L17.5 12`), in the bar's 2px stroke language; at 1:1 the strokes are exactly 2px and the lettering reads clearly in both themes. Named by the UI dictionary's `nav.resume`, `aria-haspopup="dialog"` on its own `#resume-modal-nav`; `.nav-resume` is the wrapper that ties trigger to dialog and is what `useClickOutside` watches. `.nav-actions` then carries the three appearance controls in that order (language, mode, theme color) at the right end, their bordered boxes keeping the 16px gap. The sheet's Appearance group follows the same order (Language row, Mode row, Theme color row). Six controls now share the bar at ≤1024px: `@media (max-width: 420px)` keeps 16px padding and drops only the action gap to 8px — the brand group stays at 4px at every width — `@media (max-width: 360px)` drops the padding to 12px — 40 + 44×5 = 260px of controls plus 2×4px brand gaps plus 2×8px action gaps = 284px inside 296px, and every target stays 44px
|
||||
- Language control is icon-only in both renderings — `src/components/ui/LanguageIcon.tsx` draws both languages as line art in the bar's stroke language (`currentColor`, no fills): English a 20px globe (circle r=10 + equator + meridian ellipse, 2px round joins, so it follows the control's hover accent), Tiếng Việt a flag outline (21×17.5 band `rx=2` at 1.5/3.25 — drawn 23×19.5 against the globe's 22×22; width is already at the limit, so the size step came from height, which drags the constitutional 2:3 to 1.2 — with a centred five-point mullet at r=3.6, deliberately smaller than the flag's own 0.6 × height construction, stroked 1.5px round joins so its interior stays open). The bar's `nav-control lang-toggle` shows the language it switches TO (`lang === 'en' ? 'vi' : 'en'`): translated action in `aria-label`, the target's own-language name in `title`. `.lang-toggle` now carries no CSS rules of its own — it marks the button in the DOM and nothing else. The sheet's Language row uses `.mobile-menu-icon-option` squares with `aria-pressed` and the own-language `aria-label` / `title`. Spec: `docs/design/specs/v3/spec-v3-i18n.md`
|
||||
|
||||
## Data Layer
|
||||
|
||||
- `src/data/profile.ts` — name, title, bio, links, social handles (`githubHandle`, `linkedinHandle`, `telegramHandle`), messaging URLs (`telegramUrl`) — the Contact cards render `@{profile.githubHandle}`, never a literal
|
||||
- `src/data/skills.ts` — skill groups → skills
|
||||
- `src/data/experience.ts` — work history entries; optional `variant: 'current' | 'gap'` selects the timeline decoration (live node / career break)
|
||||
- `src/data/projects.ts` — project cards with categories
|
||||
Content is split once, at authoring time, into language-neutral **structure documents** and per-language **text/UI dictionaries**, joined once at load (spec: `docs/design/specs/v4/spec-v4-live-edit.md`).
|
||||
|
||||
- `src/data/profile.json` + `profile.ts` loader — links, social handles (`githubHandle`, `linkedinHandle`, `telegramHandle`), messaging URLs (`telegramUrl`), `firstName`/`lastName` — the Contact cards render `@{c.profile.githubHandle}`, never a literal; name / title / tagline / bio are text, so they live in the content dictionaries
|
||||
- `src/data/skills.json` + `skills.ts` loader — skill groups: `{id, skills}`; group titles are text
|
||||
- `src/data/experience.json` + `experience.ts` loader — work history: company / duration / location / logo / optional `variant: 'current' | 'gap'` (timeline decoration: live node / career break); titles and responsibilities are text
|
||||
- `src/data/projects.json` + `projects.ts` loader — cards: category / role / technologies / metrics / featured / `sections[].{id, type}`; titles, summaries and section prose are text
|
||||
- `src/i18n/locales/{vi,en}/content.json` — all content text, keyed by the structure ids; `src/i18n/locales/{vi,en}/ui.json` — every chrome string in its own language (nav group labels, Mode options, language names `langEn` / `langVi`, action labels, social `aria-label`s, the resume's section labels)
|
||||
- `src/i18n/index.ts` — load + validate + join ONCE at module load; exports `UI` and `CONTENT` as `Record<Language, Resolved…>`; `src/i18n/dict-types.ts` carries the document types; `src/i18n/validate.ts` + `scripts/validate-content.ts` enforce the cross-document rules (orphan or missing keys, HTML markup in text values) — a malformed document fails `pnpm build`, CI, and the browser load, never a silent half-render
|
||||
- `src/i18n/provider.tsx` — `I18nProvider` wraps the app; components consume `const { ui: s, content: c } = useI18n()`: `s` is the chrome of the current language, `c` the joined records (`c.profile`, `c.skillGroups`, `c.experiences`, `c.projects`). There is no `field()` and no `*En` field pair anymore
|
||||
- Translation is a JSON edit, never a component edit; a new language is a new locale directory plus one `Language` union member
|
||||
- `src/data/resume.ts` — resume availability, supported languages, URL generation, and `resumeQr` (the `{id, file, label}` descriptors the resume header renders as QR codes)
|
||||
- `src/data/navigation.ts` — `navPaths` (bar + sheet order: Home, About, Experience, Projects, Contact, Philosophy), `footerPaths`
|
||||
- `src/data/social.ts` — social tiles as `{id, href, external}` (github, linkedin, email, telegram); `email` is a `mailto:` link with `external: false`, so it renders no `target`/`rel`
|
||||
- `src/i18n/strings.ts` — every chrome string as `{en, vi}`; the sheet's group labels, the Mode options, the language names (`langEn` / `langVi`, each named in its own language) and the language action labels (`langSwitch`, `switchTo`) live in `strings.nav`, the social `aria-label`s in `strings.social`
|
||||
- `src/data/site.ts` — `siteUrl` (the canonical origin) and `siteName`; every absolute URL the site publishes — canonical, Open Graph, JSON-LD, `robots.txt`, `sitemap.xml` — derives from it
|
||||
- `src/i18n/field.ts` — `field(lang, value, valueEn)` is a plain function, not a hook: `lang` is read once at component top level with `useLanguage()`, so bilingual selection is legal inside `.map()` callbacks. Convention: `value` is Vietnamese, `valueEn` English
|
||||
- `src/data/palettes.ts`, `src/data/site.ts` — code config, not content: `siteUrl` (the canonical origin) and `siteName`; every absolute URL the site publishes — canonical, Open Graph, JSON-LD, `robots.txt`, `sitemap.xml` — derives from it
|
||||
|
||||
## Component Structure
|
||||
|
||||
@@ -85,7 +90,8 @@ src/
|
||||
layout/ — Layout.tsx, Navigation.tsx, MobileMenu.tsx, Footer.tsx, ThemePaletteMenu.tsx, ResumeNavButton.tsx
|
||||
sections/ — Hero, About, Expertise, Experience, Projects, Contact, HeroParticles, DownloadResume (the hero lazer CTA; it gates itself on `resumeAvailable`)
|
||||
ui/ — Badge, Button, ContactLinks, LanguageIcon, ResumeDialog, SectionHeading, SocialLinks, Tag, Typewriter, InView, RollingTextLink, BackToTop, icons
|
||||
data/ — profile, skills, experience, projects, resume, palettes, navigation, social, site (TS modules)
|
||||
data/ — profile, skills, experience, projects (JSON documents + typed loaders), resume, palettes, navigation, social, site (TS modules)
|
||||
i18n/ — index.ts (loader), dict-types.ts, validate.ts, provider.tsx, locales/{vi,en}/{content,ui}.json
|
||||
hooks/ — useTheme.tsx, useLanguage.tsx, useClickOutside.ts, useResumeDialog.ts
|
||||
pages/ — HomePage, AboutPage, ExperiencePage, ProjectsListPage, ProjectDetailPage, PhilosophyPage, ContactPage
|
||||
types/ — shared TypeScript interfaces
|
||||
@@ -156,7 +162,7 @@ docker-compose.yaml
|
||||
2. **Import path:** All router imports use `react-router` (not `react-router-dom`) — e.g., `import { Link, useLocation } from 'react-router'`
|
||||
3. **Animation imports:** Use `motion/react` (v14 ESM), NOT `framer-motion` — e.g., `import { motion, AnimatePresence } from 'motion/react'`
|
||||
4. **Footer/Nav links:** Must use `<Link to>`, not `<a href>` for client-side navigation
|
||||
5. **Bilingual plumbing is done, the content is not:** `field(lang, value, valueEn)` resolves correctly, but most content has no second language — `skills.ts` group titles are identical in both languages, `projects.ts` titles differ for 1 of 4 projects, and `role` / `technologies` / `metrics` / `duration` / `company` in `experience.ts` have no `*En` variants at all. Translating means adding data, never changing a component
|
||||
5. **Content text lives only in the locale dictionaries:** components read joined records through `useI18n()`; a missing EN field falls back to VI per field at load (arrays are atomic). Most EN content is still the VI original — translating means adding JSON, never touching components
|
||||
6. **`lazy()` needs a default export:** pages export named components, so each factory must map `{ default: m.XPage }` — a bare `import('@/pages/XPage')` fails `tsc` with `TS2322: Property 'default' is missing`. There is no `src/pages/index.ts` barrel: importing it would pull every route back into the entry chunk
|
||||
7. **A locked `dist/resume*.pdf` blocks the build:** while a generated PDF is open in a viewer, `pnpm build:resume-all` fails with `EBUSY` on that file and `pnpm build` fails too (vite `emptyDir` → `EPERM`). Close the viewer first
|
||||
|
||||
@@ -172,6 +178,7 @@ All specification documents are in `docs/design/`:
|
||||
| `specs/ui/spec-ui-*.md` | UI specs per section (hero, about, expertise, etc.) |
|
||||
| `specs/v2/spec-v2-*.md` | v2 feature specs (resume, seo, blog, analytics, testing, cicd) |
|
||||
| `specs/v3/spec-v3-*.md` | v3 feature specs (theme colors, theme switch, theme palette switch, palette reference, UI enhancements, mobile navigation, nav & CTA enhancements, nav swatch & hamburger, typography, i18n, resume improvements, resume redesign, review fixes) |
|
||||
| `specs/v4/spec-v4-*.md` | v4 feature specs (i18n locale overlay, git-backed live edit with preview, authenticated Contents-API write path; supersedes v3-i18n Phase 2) |
|
||||
|
||||
Read `spec.md` first for product context. Read `spec-v2.md` for current feature scope.
|
||||
|
||||
@@ -199,4 +206,4 @@ When proposing or implementing changes, always include these 3 sections:
|
||||
- TypeScript: `verbatimModuleSyntax`, `noUnusedLocals`, `noUnusedParameters`, `noFallthroughCasesInSwitch`
|
||||
- Oxlint: `react/rules-of-hooks` = error, `react/only-export-components` = warn
|
||||
- No framework-specific CSS library — plain CSS with CSS variables
|
||||
- Data-driven: all content from TS modules, not hardcoded in JSX
|
||||
- Data-driven: all content from JSON documents and locale dictionaries, not hardcoded in JSX
|
||||
@@ -14,8 +14,10 @@ Add full English/Vietnamese bilingual support to the portfolio. Users can toggle
|
||||
**Content lives in data, not in layout.** Every user-facing string must be defined in a centralized module — never hardcoded in JSX. This ensures:
|
||||
|
||||
1. **Phase 1 (frontend):** All strings in `src/i18n/strings.ts`, consumed via `useLanguage()` hook
|
||||
2. **Phase 2 (backend):** Replace `src/i18n/strings.ts` with API calls — zero component changes
|
||||
3. **Future-proof:** Adding a new language requires only updating the strings module and data layer, not touching components
|
||||
2. **Phase 2 (backend):** Replace `src/i18n/strings.ts` with API calls — zero component changes — **superseded 2026-10-22** by `spec-v4-live-edit.md`: strings and content moved to per-language JSON dictionaries (`src/i18n/locales/`), consumed through `useI18n()`; `strings.ts` and `field.ts` are deleted. The "zero component changes" property carried over — every consumer switched to the provider in the same migration.
|
||||
3. **Future-proof:** Adding a new language requires only updating the strings module and data layer, not touching components — now literally true: a new language is a new locale directory plus one `Language` union member (§3.1 of the v4 spec).
|
||||
|
||||
> **Status 2026-10-22:** the Phase-2 rows below describe the v3 plan and are kept for history; the shipped implementation is the v4 one. Rows 25–27 are done by the v4 migration.
|
||||
|
||||
|
||||
## Implementation Progress
|
||||
|
||||
@@ -0,0 +1,559 @@
|
||||
# Specification — v4 Live Edit (i18n Overlay + Git-backed Content Editing)
|
||||
|
||||
> **Parent:** `spec.md` (product vision), `specs/v3/spec-v3-i18n.md` (supersedes its Phase 2)
|
||||
> **Status:** Proposed rev.4 — execution concerns from the 2026-10-22 review folded in (C1–C7). Awaiting final owner approval. No code changed yet.
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Two coupled capabilities, one architecture:
|
||||
|
||||
1. **Refactor i18n to separate content data, localized text, and UI** — replace the scattered `*En` field pairs and four parallel resolution mechanisms with a locale-overlay architecture: content **structure** and localized **text** both live in JSON documents (structure language-neutral, text per language), TS files keep only typed loaders, exports, and code config.
|
||||
2. **Live edit with preview, no database** — an authenticated edit mode on the real site: the owner edits text inline on the actual rendered pages (all seven routes), edits structure (add/remove projects, timeline entries, sections) in a JSON panel, sees real theme/motion/responsive behavior, and saves by committing the changed JSON documents to git through the Gitea Contents API. The existing CI pipeline remains the only publishing path.
|
||||
|
||||
Git is the content store. CI is the validation gate. There is no database, no new application service, and no runtime content fetch for visitors.
|
||||
|
||||
## Why Phase 2 of v3-i18n is superseded
|
||||
|
||||
`spec-v3-i18n.md` rows 23–27 planned replacing `strings.ts` with API calls. That direction is abandoned: a personal single-author portfolio does not need a content API. Static dictionaries are type-checked at build, consumed synchronously (no loading states), consumed identically by the resume generator, and served to crawlers exactly like today. Editing ergonomics are solved by the write path in §6, not by moving content off-box.
|
||||
|
||||
---
|
||||
|
||||
## 1. Current State — measured problems
|
||||
|
||||
| # | Problem | Evidence |
|
||||
|---|---------|----------|
|
||||
| 1 | Four parallel resolution mechanisms for one problem | `strings.x[lang]` — 107 accesses across 22 files; `field(lang, vi, en?)` — 23 call sites across 9 files (`src/i18n/field.ts`); `resolveField(en, vi, lang)` in `scripts/generate-resume.ts:126-128` — 8 call sites, **reversed parameter order**; a fourth hardcoded bilingual `labels` map inside `scripts/generate-resume.ts:108-123` (EXPERIENCE / SKILLS / PROJECTS / UPDATED / QR_ALT) |
|
||||
| 2 | Translation machinery lives in the domain model | `src/types/index.ts` carries `*En` sibling fields in 6 interfaces: `Project`, `ProjectSection`, `ExperienceEntry`, `SkillGroup`, `PhilosophyPoint`, `Profile` |
|
||||
| 3 | Every consumer must know which fields are bilingual | 22 unique consumer files (9 import `i18n/field`, 13 import `i18n/strings`) |
|
||||
| 4 | Redundant duplicated pairs | Recorded by `spec-v3-i18n.md:66`: "Some `*En` fields are redundant (identical to primary)" — e.g. `awb-detection.title` ≡ `titleEn` |
|
||||
| 5 | Adding a third language touches every interface and every call site | Each pair is a distinct optional field name (`*En`); no extension point |
|
||||
| 6 | Content text is welded into structure modules | `src/data/projects.ts` (226 lines) mixes ids, categories, technologies with prose in two languages |
|
||||
| 7 | Section ids collide across projects | `src/data/projects.ts`: `context`, `problem`, `architecture`, `challenges`, `result` recur across projects — a global `Record<SectionId, …>` text map would force cross-project completeness (see §3.2) |
|
||||
|
||||
---
|
||||
|
||||
## 2. Architecture Decisions
|
||||
|
||||
Each decision lists the chosen option and the rejected alternative with its reason. D6–D7 were added by the 2026-10-22 review.
|
||||
|
||||
### D1 — Locale overlay keyed by stable ids (chosen over inline `Localized` pairs)
|
||||
|
||||
Text moves out of content records into per-language dictionaries keyed by content id.
|
||||
|
||||
Rejected alternative — inline bilingual type (`title: { vi, en? }` inside each record): lighter to migrate, but text stays welded into the content modules, which is exactly the coupling this refactor removes. The overlay is chosen.
|
||||
|
||||
### D2 — All content documents are JSON (chosen over TS data modules)
|
||||
|
||||
Both halves of content are JSON: **structure** in `src/data/*.json` (language-neutral records: ids, categories, technologies, metrics, urls, `featured`, `variant`, section `{id, type}`) and **text** in `src/i18n/locales/{vi,en}/*.json`. TS keeps only typed loaders that preserve the current export names and types, so no consumer import path changes.
|
||||
|
||||
This decision is what makes §5 structural editing possible at all: a draft that can only override text can never add a project, because the project record lives in code. With structure in JSON, the JSON panel edits the same documents the Contents API commits, and the round-trip is lossless. JSON has no comments — authoring comments move to the loaders and types, which stay TS. Type safety: every JSON import is annotated in its loader, so `pnpm build` (`tsc -b`) fails on any shape violation. Requires `resolveJsonModule: true` in `tsconfig.app.json` (not currently set).
|
||||
|
||||
Rejected alternative — structure stays in TS, v4 is text-only editing: safe, but it removes the capability this spec exists for ("admin updates content"). Chosen against.
|
||||
|
||||
Code config stays TS, not content: `resume.ts` (availability, `resumeQr`), `navigation.ts`, `palettes.ts`, `social.ts`, `site.ts`.
|
||||
|
||||
### D3 — Content and UI strings are consumed through a context provider
|
||||
|
||||
All content flows through `I18nProvider` / `useI18n()`, with the static build-time documents as the default context value. This is the prerequisite for live preview: an editor overrides the context value with draft state and the **real components** render draft data — real theme, real motion, real responsive behavior. Preview is the production app, never a mockup.
|
||||
|
||||
### D4 — Git is the content store; Gitea Contents API is the write path; CI is the validator
|
||||
|
||||
No database. The content store is the git repo `https://code.vugado.com/dong.nguyen/cv` (self-hosted Gitea). Editing a file there already deploys via the existing `deploy.yml` (push to `master` → build → resume → rsync). The admin write path is a thin authenticated proxy to the Gitea Contents API (§6). A malformed content commit fails the build gate (§3.6), so the last good deploy stays live — the pipeline is the validation gate.
|
||||
|
||||
### D5 — Layout boundary: content is editable, design is code
|
||||
|
||||
Editable through data documents: all text, structure records (add/remove/edit projects, experience entries, skill groups, sections), `featured`, `variant: 'current' | 'gap'`, ordering by existing fields. Not editable without new machinery: card design, typography, spacing, section composition, motion recipes — these are the hand-tuned design of the site. A WYSIWYG layout designer would require a layout DSL + generic renderer (page-builder machinery) and is **explicitly deferred** (§10, §12 row 15).
|
||||
|
||||
### D6 — Display name stays localized (default; owner may override)
|
||||
|
||||
`Profile.nameEn` is a **required** field today (`src/types/index.ts:70`): the resume and hero resolve a display name per language (Vietnamese vs Western order). Preserving behavior: `name` becomes a required entry of the profile text dict in **both** languages (`profile.name` in `content.vi.json`, `profile.name` in `content.en.json`). `firstName` / `lastName` stay language-neutral in `profile.json`. If the owner later prefers one canonical name, that is a data edit, not a code edit. (This was Open Question 3 in rev.1; it is a decision because Phase 1 cannot type the interfaces before it is settled.)
|
||||
|
||||
### D7 — Cross-file consistency is enforced by tsc + a shared validator
|
||||
|
||||
Two mechanisms, each for what it is good at:
|
||||
|
||||
- **tsc** joins each JSON document to its declared type independently: structure loaders annotate against interfaces whose `id` fields are closed unions; text dictionaries are annotated `Record<ProjectId, …>` etc. Adding an id to a union without text in `content.vi.json` is a build error; a text key outside the union is a build error.
|
||||
- **`scripts/validate-content.ts`** (shared with edit mode via `src/i18n/validate.ts`) enforces what types cannot express across two JSON files: every section id present in `projects.json` has text in `content.vi.json` (sections are per-project arrays with colliding ids — no global union), no orphan text keys, `en` keys correspond to existing structure ids. It runs in the CI build job and in the browser before save (§5.1).
|
||||
|
||||
### D8 — Edit-mode entry is `?edit` on any route (owner decision, 2026-10-22)
|
||||
|
||||
Chosen over a dedicated `/edit` route (which would need its own page selector and a second mental model, against D3's preview-equals-app logic) and over a separate host (DNS/cert/nginx duplication). `index.html:13` already publishes clean-URL canonicals, so `?edit` is inert for crawlers; the mode is inert without authenticated write credentials; the query is stripped on exit (§5.2). The owner bookmarks the entry.
|
||||
|
||||
### D9 — `profile.tagline` is segmented; markup moves to `Hero.tsx` (owner decision, 2026-10-22)
|
||||
|
||||
The only HTML string in the entire data layer is `profile.tagline` (`src/data/profile.ts:11`, `<span class='ok-possible name-highlight'>yes</span>`). The value becomes `Array<{ text: string; emphasis?: boolean }>`; `Hero.tsx` renders the span with its existing classes from data instead of `dangerouslySetInnerHTML`. After migration no content document contains HTML — the validator can enforce plain text (§3.6 rule 5), and the tagline becomes inline-editable segment by segment (§5.1). The current value maps to three segments (`…Full Stack Developer, ` / `{text: 'yes', emphasis: true}` / `, có thể.`); `taglineEn` becomes a single plain segment. The resume generator does not consume the tagline — no resume impact.
|
||||
|
||||
---
|
||||
|
||||
## 3. Target Architecture
|
||||
|
||||
```
|
||||
src/data/
|
||||
profile.json profile.ts ← structure documents + typed loaders (exports unchanged:
|
||||
skills.json skills.ts `profile`, `skillGroups`, `experiences`, `projects`)
|
||||
experience.json experience.ts
|
||||
projects.json projects.ts
|
||||
resume.ts navigation.ts palettes.ts social.ts site.ts ← code config, unchanged
|
||||
src/i18n/
|
||||
locales/
|
||||
vi/ui.json vi/content.json ← complete, keyed by id / key path
|
||||
en/ui.json en/content.json ← ui complete (checked against UIDict); content per-field partial
|
||||
validate.ts ← cross-document consistency rules (§3.6)
|
||||
dict-types.ts ← structure types, UIDict, Content*Text, Resolved* types
|
||||
index.ts ← load + validate + merge → UI[lang], CONTENT[lang]
|
||||
provider.tsx ← I18nProvider + useI18n(), default = static documents
|
||||
scripts/
|
||||
validate-content.ts ← CLI wrapper over src/i18n/validate.ts (CI + save gate)
|
||||
```
|
||||
|
||||
### 3.1 Stable id unions (`src/types/index.ts`)
|
||||
|
||||
Text dictionaries are only type-safe against closed id unions:
|
||||
|
||||
```ts
|
||||
export type ProjectId = 'iot-dws-integration' | 'awb-detection' | 'facility-management' | 'local-llm-experiments';
|
||||
export type ExperienceId = /* existing ExperienceEntry.id values */;
|
||||
export type SkillGroupId = /* NEW — slug of group title, e.g. 'backend-systems' */;
|
||||
export type PhilosophyId = /* NEW — slug of point title */;
|
||||
```
|
||||
|
||||
- `Project.id` already appears in URLs — ids are already stable and published.
|
||||
- `SkillGroupId` / `PhilosophyId` do not exist today and must be added to the structure documents; they are internal-only keys and never appear in URLs.
|
||||
- **No `SectionId` union.** Section ids collide across projects (`context`, `problem`, `result`, … appear in several projects); a global union would force every project's text to cover every other project's sections. Section coverage is enforced per project by the validator (§3.6) instead.
|
||||
- Adding a new project/experience/skill/philosophy item = 3 edits: one line in the union, one record in the structure document, one entry in `content.vi.json`. tsc + validator catch any missing leg.
|
||||
|
||||
### 3.2 Document types (`dict-types.ts`)
|
||||
|
||||
Structure (language-neutral) and text (per language) are separate documents joined by the loader into resolved records that components consume:
|
||||
|
||||
```ts
|
||||
// --- structure (src/data/*.json) ---
|
||||
export type ProjectStructure = {
|
||||
id: ProjectId; category: ProjectCategory; role: string; technologies: string[];
|
||||
metrics?: string[]; featured: boolean;
|
||||
sections: Array<{ id: string; type: 'text' | 'diagram' | 'metrics' | 'code' }>;
|
||||
};
|
||||
export type ExperienceStructure = {
|
||||
id: ExperienceId; company: string; duration: string; location?: string;
|
||||
variant?: 'current' | 'gap'; logo?: string;
|
||||
};
|
||||
export type SkillGroupStructure = { id: SkillGroupId; skills: string[] };
|
||||
export type ProfileStructure = {
|
||||
firstName: string; lastName: string; email: string;
|
||||
githubUrl: string; linkedinUrl: string; githubHandle: string; linkedinHandle: string;
|
||||
telegramUrl: string; telegramHandle: string;
|
||||
currentInterests: string[]; roles: string[];
|
||||
philosophy: Array<{ id: PhilosophyId; keywords: string[] }>;
|
||||
};
|
||||
|
||||
// --- text (src/i18n/locales/{vi,en}/content.json) ---
|
||||
export type SectionText = { title: string; content: string };
|
||||
export type ProjectText = {
|
||||
title: string; summary: string;
|
||||
sections: Record<string, SectionText>; // keys validated against the structure's section ids
|
||||
};
|
||||
export type ExperienceText = { title: string; responsibilities: string[] };
|
||||
export type SkillGroupText = { title: string };
|
||||
export type ProfileText = {
|
||||
name: string; title: string; bio: string;
|
||||
tagline: Array<{ text: string; emphasis?: boolean }>; // D9 — markup lives in Hero.tsx, never in content
|
||||
philosophy: Record<PhilosophyId, { title: string; description: string }>;
|
||||
};
|
||||
|
||||
export type ContentVi = {
|
||||
profile: ProfileText;
|
||||
skills: Record<SkillGroupId, SkillGroupText>;
|
||||
experience: Record<ExperienceId, ExperienceText>;
|
||||
projects: Record<ProjectId, ProjectText>;
|
||||
};
|
||||
|
||||
// Defined locally in dict-types.ts — PartialDeep is NOT a TypeScript builtin.
|
||||
// Objects: every key optional + recursed. Arrays: atomic (whole-array fallback, never per-item).
|
||||
type PartialDeep<T> = T extends readonly unknown[] ? T
|
||||
: T extends object ? { [K in keyof T]?: PartialDeep<T[K]> } : T;
|
||||
|
||||
export type ContentEn = { [K in keyof ContentVi]: PartialDeep<ContentVi[K]> };
|
||||
```
|
||||
|
||||
Fallback semantics (unchanged from `field()` today):
|
||||
|
||||
- `ContentVi` is a **complete mapped type** — omitting text for any union id is a `tsc` error. The primary language is enforced at build.
|
||||
- `ContentEn` is partial **per field**, including inside `sections` and `philosophy`. Missing English field → Vietnamese value. Arrays fall back whole-array; mixed-language arrays are not a v4 feature. `deepMerge` therefore treats arrays as atomic values.
|
||||
- Redundant identical pairs (Problem 4) are deleted: identical text simply omits the `en` key.
|
||||
|
||||
### 3.3 UI dictionary (`ui.json`)
|
||||
|
||||
`strings.ts`' key tree is preserved verbatim; the resume script's `labels` map (§1 row 4) is merged in as a `resume` section. `UIDict` is derived from the vi import and the en import is checked **against** it — both files are then complete by construction, and the derivation is not circular (rev.1 wrote `UIDict = typeof uiVi` while `uiVi: Record<Language, UIDict>`):
|
||||
|
||||
```ts
|
||||
import uiViJson from './locales/vi/ui.json';
|
||||
export type UIDict = typeof uiViJson; // literal structure of the complete tree
|
||||
const uiVi: UIDict = uiViJson;
|
||||
const uiEn: UIDict = uiEnJson; // tsc enforces en completeness
|
||||
```
|
||||
|
||||
### 3.4 Loader (`index.ts`) — validate and join once at module load
|
||||
|
||||
```ts
|
||||
import profileStructure from '@/data/profile.json';
|
||||
import projectsStructure from '@/data/projects.json'; // … skills, experience likewise
|
||||
import contentViJson from './locales/vi/content.json';
|
||||
import contentEnJson from './locales/en/content.json';
|
||||
|
||||
const profile: ProfileStructure = profileStructure; // tsc validates shape + id unions
|
||||
// … (skills, experience likewise)
|
||||
const contentVi: ContentVi = contentViJson;
|
||||
const contentEn: ContentEn = contentEnJson;
|
||||
validateContent({ profile, skills, experience, projects }, contentVi, contentEn); // §3.6
|
||||
|
||||
const mergedEn: ContentVi = deepMerge(contentVi, contentEn); // arrays atomic, one-time
|
||||
|
||||
export const UI: Record<Language, UIDict> = { vi: uiVi, en: uiEn };
|
||||
|
||||
// Resolved records: structure joined with text — components never join by id themselves.
|
||||
export type ResolvedProject = ProjectStructure & { title: string; summary: string;
|
||||
sections: Array<{ id: string; type: 'text' | 'diagram' | 'metrics' | 'code'; title: string; content: string }> };
|
||||
export type ResolvedExperienceEntry = ExperienceStructure & { title: string; responsibilities: string[] };
|
||||
export type ResolvedSkillGroup = SkillGroupStructure & { title: string };
|
||||
export type ResolvedProfile = ProfileStructure & ProfileText;
|
||||
export type ResolvedContent = {
|
||||
profile: ResolvedProfile; skillGroups: ResolvedSkillGroup[];
|
||||
experiences: ResolvedExperienceEntry[]; projects: ResolvedProject[];
|
||||
};
|
||||
export const CONTENT: Record<Language, ResolvedContent> = {
|
||||
vi: join(structures, contentVi), en: join(structures, mergedEn),
|
||||
};
|
||||
```
|
||||
|
||||
`src/data/*.ts` loaders keep exporting the raw structure under today's names (`profile`, `projects`, `experiences`, `skillGroups`) for `scripts/generate-sitemap.ts`, which consumes structure only. Both languages are already in today's bundle (`strings.ts` + `*En` fields); splitting them into JSON documents does not change bundle size materially.
|
||||
|
||||
### 3.5 Provider and consumer usage
|
||||
|
||||
```tsx
|
||||
// provider.tsx — must mount inside LanguageProvider (lang is read to pick the resolved pair)
|
||||
export function I18nProvider({ children, override }: { children: React.ReactNode; override?: ResolvedI18n }) { … }
|
||||
export function useI18n(): ResolvedI18n { … } // default = build-time documents for the current lang
|
||||
export type ResolvedI18n = { ui: UIDict; content: ResolvedContent };
|
||||
```
|
||||
|
||||
Every consumer collapses to one pattern — components iterate **resolved records**, never join structure and text themselves:
|
||||
|
||||
```tsx
|
||||
const { ui: s, content: c } = useI18n();
|
||||
{c.projects.map(p => <ProjectCard key={p.id} project={p} />)} // p.title / p.summary already joined
|
||||
<span>{s.nav.home}</span>
|
||||
```
|
||||
|
||||
`src/i18n/field.ts` and `src/i18n/strings.ts` are deleted. `resolveField` and the `labels` map in `scripts/generate-resume.ts` are deleted; the script imports `UI`/`CONTENT` (resolved records — simpler than today's per-field resolution) — its `--lang=` flow is unchanged.
|
||||
|
||||
### 3.6 Cross-document validation (`src/i18n/validate.ts`)
|
||||
|
||||
Rules, run at load (dev), in CI (`pnpm tsx scripts/validate-content.ts`, added to the build job), and in the browser before save:
|
||||
|
||||
1. Every section id in each project's structure array has a text entry in `content.vi.json`.
|
||||
2. No orphan text keys: every key in `content.vi/en.json` (including nested `sections`, `philosophy`) corresponds to an id present in structure.
|
||||
3. `en` text keys likewise correspond to existing structure ids (partial coverage allowed).
|
||||
4. `ui.en.json` completeness is enforced by tsc (§3.3), not here.
|
||||
5. Text values contain no HTML markup (`<` / `>`) — after D9 no content document holds HTML; literal angle brackets in prose are rejected as a data error.
|
||||
|
||||
Failure output lists exact document paths so a content edit can be fixed in the JSON panel.
|
||||
|
||||
### 3.7 Data flow
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
subgraph build["Build time (unchanged pipeline)"]
|
||||
SD["src/data/*.json<br/>structure documents"] --> LD["loaders + i18n loader<br/>tsc types + validate + join"]
|
||||
TX["locales/{vi,en}/*.json<br/>text documents"] --> LD
|
||||
LD --> B["bundle + resolved records"]
|
||||
LD --> V["validate-content.ts"]
|
||||
B --> CI["gitea CI: tsc -b → validate → resume → rsync deploy"]
|
||||
V --> CI
|
||||
end
|
||||
subgraph edit["Edit time (new)"]
|
||||
V2["edit mode"] --> DR["draft state<br/>= the same JSON documents"]
|
||||
DR -->|"validate before save"| DR
|
||||
DR -->|"PUT + last_commit_sha"| PX["nginx /api/content/<br/>basic auth + token"]
|
||||
PX --> GA["Gitea Contents API"] --> COMMIT["commit on master"] --> CI
|
||||
end
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Document Migration
|
||||
|
||||
Field-by-field disposition. "structure" = `src/data/<module>.json`; "text" = `content.{vi,en}.json` under the record's id.
|
||||
|
||||
| Module | → structure document | → text document | New fields |
|
||||
|---|---|---|---|
|
||||
| `profile.ts` | `firstName`, `lastName`, `email`, all URLs/handles, `currentInterests`, `roles`, `keywords`, `philosophy[].{id, keywords}` | `title(+En)`, `bio(+En)` → `profile.*`; `tagline(+En)` → `profile.tagline` as segments (D9); `name`/`nameEn` → `profile.name` in **both** language docs (D6); `philosophy[].title(+En)`, `description(+En)` | `PhilosophyId` per point |
|
||||
| `skills.ts` | `id`, `skills[]` (technical terms, EN-only per v3-i18n) | `title(+titleEn)` → `skills[id].title` | `id: SkillGroupId` |
|
||||
| `experience.ts` | `id`, `company`, `duration`, `location`, `variant`, `logo` | `title(+En)` → `experience[id].title`; `responsibilities(+En)` → `experience[id].responsibilities` | — |
|
||||
| `projects.ts` | `id`, `category`, `role`, `technologies`, `metrics`, `featured`, `sections[].{id, type}` | `title(+En)`, `summary(+En)` → `projects[id]`; `sections[].title(+En)`, `content(+En)` → `projects[id].sections[sectionId]` | — |
|
||||
| `i18n/strings.ts` | — (file deleted) | all 130 lines → `ui.{vi,en}.json`, same key tree | — |
|
||||
| `scripts/generate-resume.ts` `labels` map | — | EXPERIENCE / SKILLS / PROJECTS / UPDATED / QR_ALT → `ui.{vi,en}.json` `resume` section | — |
|
||||
| `resume.ts`, `navigation.ts`, `palettes.ts`, `social.ts`, `site.ts` | unchanged — code config, not content | resume language labels already in `strings.nav` → move with ui | — |
|
||||
|
||||
Type changes in `src/types/index.ts`: every `*En` optional is deleted from the 6 interfaces; id unions added (§3.1); structure/text/resolved types as §3.2. The old `Project` / `ProjectDetail` / `ExperienceEntry` interfaces are replaced by `*Structure` + `Resolved*` types — no shim left behind.
|
||||
|
||||
---
|
||||
|
||||
## 5. Edit Mode — live edit on all pages
|
||||
|
||||
### 5.1 Shape: edit mode on the real site (chosen over a separate `/admin` shell)
|
||||
|
||||
The site itself gains an edit mode. There is no second preview machinery — the seven routes *are* the preview.
|
||||
|
||||
- **Entry:** edit mode activates only for the authenticated owner (handshake against the protected proxy endpoint, §6.2; activation stored in `sessionStorage`; a `?edit` query on any route re-enters the mode within a session; the query is stripped from the URL on exit so shared/canonical URLs stay clean). Anonymous visitors never see edit affordances.
|
||||
- **Draft initialization:** the draft is initialized from **live repository files fetched through the proxy** (`GET` per document + its `last_commit_sha`), not from the bundle — the bundle may be older than master if anyone edited via Gitea web since the last build, and a bundle-seeded draft would silently revert those edits. The static bundle is used only as an offline fallback, with a visible "stale" warning.
|
||||
- **Mechanism:** edit mode wraps `<Layout>` in `<I18nProvider override={draft}>`. All pages, all components, both languages render the draft — text **and** structure.
|
||||
- **Inline text editing:** rendered text nodes bound to a text-document path become editable on focus (`contentEditable`); blur writes `{ path, value }` into the draft. Editing `projects['iot-dws-integration'].title` updates the card on `/projects`, the header on `/projects/:id`, and the featured block on the home page **simultaneously** — one draft, every consumer.
|
||||
- **Editable surface (curated scope):** inline editing covers **text documents only** — profile bio and tagline (each tagline segment is an individually editable span; the `emphasis` toggle is edited in the JSON panel), project titles/summaries/section content, experience titles/responsibilities, skill group titles, philosophy titles/descriptions. `ui.json` is **read-only** in v4 (labels/aria are low-frequency chrome). This bounds the wrapping work to the ~40 content render sites, not the 130+ UI-string sites. Adjacent tagline segments are separate edit targets — the caret does not cross a segment boundary; intended behavior (D9), not a bug.
|
||||
- **Structural editing:** add/remove/edit records in the structure documents and their text entries happens in a JSON panel docked beside the page (the panel edits the draft documents directly; the live page re-renders on every valid change). The panel validates against §3.2/§3.6 before accepting — an invalid draft never reaches the preview.
|
||||
- **Language/theme:** the existing language, theme, and palette controls work unchanged inside edit mode — the owner previews exactly what visitors will see.
|
||||
- **Save:** a persistent save bar lists the diff (changed paths per document), runs the §3.6 validator on the full draft, then PUTs each touched document through the proxy (§6). Unsaved draft is invisible to visitors.
|
||||
|
||||
Rejected alternative — `/admin` route with preview pane + bespoke forms: same engine, more code (a form per content type), and a second shell to maintain. Revisit only if inline editing proves ergonomically insufficient.
|
||||
|
||||
### 5.2 Session lifecycle
|
||||
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
visitor --> authenticating: ?edit on any route
|
||||
authenticating --> visitor: 401 / cancel
|
||||
authenticating --> editing: auth ok — draft = live master docs + shas
|
||||
editing --> editing: accepted edit → draft + sessionStorage copy
|
||||
editing --> saving: save (validator passes, §3.6)
|
||||
saving --> saved: commits written — deploy queued
|
||||
saving --> conflict: 412 on a document
|
||||
conflict --> editing: rebase / take theirs / hand-merge
|
||||
saved --> editing: continue
|
||||
editing --> visitor: exit (save-or-discard prompt)
|
||||
```
|
||||
|
||||
- **Entry:** `?edit` on any route → the app probes the protected endpoint once (hidden-iframe GET to trigger the native Basic prompt, §6.2). 401 or cancel → normal visitor site, zero affordances. Auth OK → session flag in `sessionStorage` + draft initialization (§5.1). Within a session the browser re-attaches Basic credentials to later requests on its own — no repeated prompt.
|
||||
- **Durability:** every accepted edit is also copied to `sessionStorage` (the documents are tens of KB). An accidental reload restores the draft: the app re-fetches live files, re-applies the saved draft, and flags any document whose `last_commit_sha` moved → conflict flow (§5.6). SPA navigation never loses the draft; `beforeunload` warns while dirty.
|
||||
- **Exit:** explicit action in the EditBar — save-or-discard prompt if dirty, clear flag + draft, `history.replaceState` strips `?edit`.
|
||||
|
||||
### 5.3 `EditableText` contract (inline editing)
|
||||
|
||||
- **Visitor mode is transparent:** the component renders exactly the element the site renders today (same tag, same attributes, text as children). Zero DOM/CSS/motion difference outside edit mode.
|
||||
- **Affordances (edit mode only):** hover → 1px dashed `--muted` underline + `cursor: text`; focus → 2px-offset `--accent` ring (the bar's existing focus language); `aria-label` = human-readable path ("Project iot-dws — Summary"); `role="textbox"`, `aria-multiline` for multi-line fields.
|
||||
- **Commit on blur only — never per keystroke.** This is a hard rule: Vietnamese IME composition (dấu) must never be truncated mid-composition; the draft updates only after composition completes.
|
||||
- **Keys:** Esc cancels the current edit and restores the last committed value. Enter commits + blurs single-line fields (titles, names); in multi-line fields (bio, summary, section content, responsibilities items) Enter inserts `\n` — text is stored as plain text with newlines, rendering unchanged.
|
||||
- **Paste** is sanitized to plain text (`textContent`, no HTML).
|
||||
- **Empty required values** are rejected at commit: inline error on the field + entry in the EditBar list; the field keeps focus.
|
||||
- **Per-field revert** action appears after a commit; document-level discard lives in the EditBar.
|
||||
- **Motion safety:** `EditableText` edits only the text node inside already-animated elements; motion keeps transform ownership — the existing animation recipes are untouched.
|
||||
|
||||
### 5.4 JSON panel (structural editing)
|
||||
|
||||
- Docked sheet: 420px right side above 1024px, full-width bottom sheet below; toggled from the EditBar; the live page stays interactive beside it.
|
||||
- Tabs: `profile.json`, `skills.json`, `experience.json`, `projects.json`, `content.vi.json`, `content.en.json`; `ui.{vi,en}.json` shown read-only for reference.
|
||||
- Editor: monospace textarea + parse/validation status bar; errors render JSON-pointer paths with line numbers. The preview keeps rendering the **last valid draft** — an invalid panel state never reaches the page or the save.
|
||||
- **Templates:** "add project / experience / skill group / philosophy point / section" inserts a well-shaped skeleton into the structure document and text stubs into `content.vi`/`content.en` in one action — the new card appears in the preview immediately; empty required fields show as validation warnings until filled.
|
||||
- **Delete** removes the record's text entries from both text documents in the same action — orphan text is never created.
|
||||
- Each tab header shows the required shape as a comment block copied from `dict-types.ts` (JSON has no comments; the panel chrome supplies them).
|
||||
|
||||
### 5.5 Draft, diff, undo
|
||||
|
||||
- Copy-on-write: untouched documents stay the fetched baselines; only touched documents are copied into the draft.
|
||||
- Change tracking: per-document set of changed JSON paths; the EditBar shows the dirty-document count and an expandable per-path old→new preview.
|
||||
- Undo model: per-field revert (inline action) + per-document discard (EditBar). No full edit history in v4 — after a save, git is the history; before a save, revert covers the realistic undo need.
|
||||
|
||||
### 5.6 Save, deploy feedback, conflicts
|
||||
|
||||
- Save pipeline: validate the full draft (§3.6) → serialize touched documents (2-space indent, key order preserved, §6.1) → sequential PUTs, each with the message `content: <first change summary> (<n> paths)`.
|
||||
- Progress UI: per-document status line (queued → written / failed), then a summary with commit SHAs and a link to the pipeline run. The bar states "deploy queued — live after CI": the site changes only when the pipeline finishes (§6.1 policy).
|
||||
- **Conflict (412 on one document):** fetch the current file, then a per-document three-way choice — **rebase** (re-apply my changed paths onto the new base), **take theirs** (discard my changes for that document), or **hand-merge** (the panel opens with both versions side by side). Untouched documents are unaffected.
|
||||
- **Partial failure** (network/5xx mid-sequence): the bar reports exactly which documents landed and which did not; retry resumes from the first unwritten document — landed documents are never rewritten (their content already matches, their shas are refreshed).
|
||||
|
||||
### 5.7 What live edit covers / does not cover
|
||||
|
||||
| Live in the preview | Only after commit + CI |
|
||||
|---|---|
|
||||
| All text on all 7 routes, both languages | Resume PDFs (`generate-resume.ts` runs at build) |
|
||||
| Structural changes: new/removed cards, detail routes, timeline entries | `sitemap.xml` + canonical links (generated at build). OG tags in `index.html` are static strings — **not updated by v4** |
|
||||
| Theme, palette, language rendering | Layout design (see D5) |
|
||||
|
||||
### 5.8 Layout knobs and the deferred layout designer
|
||||
|
||||
v4 exposes no new layout knobs. `featured` and `variant` already exist and are editable via the JSON panel. A `layout.ts` config (section order/visibility) and any WYSIWYG layout editing are recorded here as **deferred research**, explicitly out of v4 scope.
|
||||
|
||||
---
|
||||
|
||||
## 6. Write Path, Authentication, Authorization
|
||||
|
||||
### 6.1 API
|
||||
|
||||
Repo: `https://code.vugado.com/dong.nguyen/cv` — self-hosted Gitea (API verified live: `/api/v1/version` → 28.1.0). Contents API paths are fixed to this repo:
|
||||
|
||||
- `GET /api/v1/repos/dong.nguyen/cv/contents/{path}` — read the live file + its `last_commit_sha` when a draft session starts (§5.1).
|
||||
- `PUT /api/v1/repos/dong.nguyen/cv/contents/{path}` — body: base64 content, `message`, `branch`, `last_commit_sha`. A stale sha → 412 → editor refetches and re-applies; lost updates are impossible.
|
||||
|
||||
**Save/CI policy (decided):** a save writes its touched documents as **sequential PUTs to `master`** — each is one commit and triggers the existing pipeline. Consequences accepted: a save touching 2–4 documents produces 2–4 sequential CI runs, and between runs the deployed site can transiently mix old/new documents. For a single owner publishing at low frequency this is the boring, correct choice; the final state after the last pipeline is always consistent. (Branch-then-merge for a single pipeline run is noted as a future optimization, not v4.)
|
||||
|
||||
Serialization on save: 2-space indent, key order preserved from the parsed document — diffs in Gitea stay reviewable.
|
||||
|
||||
The proxy exposes the Contents API for this repo only. It does not restrict which file paths a PUT may name; with a single owner this is accepted. Optional hardening (noted, not v4): an nginx `map` whitelisting the 8 content document paths.
|
||||
|
||||
### 6.2 Proxy + authentication (no new service)
|
||||
|
||||
Add to `nginx.conf` using the stock nginx image's envsubst template support (`/etc/nginx/templates/nginx.conf.template`), so the token comes from the environment, never the bundle:
|
||||
|
||||
```nginx
|
||||
location /api/content/ {
|
||||
auth_basic "Editor";
|
||||
auth_basic_user_file /etc/nginx/htpasswd;
|
||||
proxy_pass https://code.vugado.com/api/v1/repos/dong.nguyen/cv/contents/;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_set_header Host code.vugado.com;
|
||||
proxy_set_header Authorization "token ${GITEA_TOKEN}";
|
||||
}
|
||||
```
|
||||
|
||||
- **Authentication:** HTTP Basic (htpasswd, one user today) at the proxy; the Gitea write token lives only in the container environment. A write-capable token MUST NEVER appear in the SPA bundle — the bundle is public.
|
||||
- **Handshake mechanics:** `fetch()` does not trigger the browser's Basic-auth prompt. The edit-mode entry loads the protected `GET` once through a hidden iframe to trigger the native prompt; the browser then attaches the cached credentials to subsequent `fetch` calls for the origin. Fallback: a credentials form whose value is kept in `sessionStorage` for the session (plaintext — accepted for a personal site; state it in the UI).
|
||||
- **Security model:** edit mode is a UI affordance, not the protection. The protected endpoint is the security boundary: an unauthenticated browser cannot write, regardless of how edit mode was reached.
|
||||
|
||||
### 6.3 Production deployment of the proxy (operational step — was missing in rev.1)
|
||||
|
||||
`deploy.yml` rsyncs `dist/` only — `nginx.conf` is **not** deployed by the pipeline. Phase 2 therefore includes an explicit one-time server step: update the stack's nginx config + `htpasswd`, set `GITEA_TOKEN` in the stack environment, and reload the nginx container on `/opt/stacks/dong-site`. Recorded as Phase 2 step 0 in §7 and §12.
|
||||
|
||||
### 6.4 Authorization tiers (future-ready, no custom RBAC)
|
||||
|
||||
| Role | Capability | Mechanism |
|
||||
|---|---|---|
|
||||
| Owner (today) | commit to `master` → immediate CI deploy | proxy token |
|
||||
| Editor (if ever needed) | commit to `content` branch only | Contents API `branch` param + a second token; owner merges in Gitea; only `master` deploys |
|
||||
| Visitor | read-only | no endpoint access |
|
||||
|
||||
Audit and rollback are git-native: history is the audit log; `git revert` + CI is the rollback.
|
||||
|
||||
---
|
||||
|
||||
## 7. Implementation Details
|
||||
|
||||
### Phase 1 — foundation (no visible feature; prerequisite for everything else)
|
||||
|
||||
Commit policy: Phase 1 lands as **one atomic commit** — it is a 30-file mechanical migration whose intermediate states are worse than either end. (Tension with the repo rule "keep changes small" is acknowledged deliberately: splitting it would leave half the codebase on each of two incompatible contracts.)
|
||||
|
||||
1. `src/types/index.ts`: id unions (§3.1), structure/text/resolved types (§3.2), `PartialDeep`; delete all `*En` fields from the 6 interfaces.
|
||||
2. Create `src/data/{profile,skills,experience,projects}.json` **via a throwaway extraction codemod** (`scripts/extract-content.ts`, deleted after the run): it reads today's modules and writes the structure documents programmatically — values are never hand-moved, because types verify structure but cannot catch text placed under the wrong id. `id` added to every skill group and philosophy point. TS loaders preserving today's export names; `resolveJsonModule` added to `tsconfig.app.json`. All JSON and inter-module imports inside `src/data` / `src/i18n` use **relative paths** — the tsx scripts consume these modules and do not resolve a runtime `@/` alias (type-only `@/` imports are erased and fine).
|
||||
3. Create `src/i18n/dict-types.ts`, `src/i18n/locales/{vi,en}/ui.json` (from `strings.ts` + the resume `labels` map, key tree preserved), `src/i18n/locales/{vi,en}/content.json` (text extracted by the same codemod; identical `*En` pairs dropped; `profile.tagline` converted to segments per D9), `src/i18n/validate.ts`, `src/i18n/index.ts` (load + validate + join), `src/i18n/provider.tsx` — the default context value is a **module-level constant**: a value object rebuilt on every provider render would re-render every consumer in the tree.
|
||||
4. `scripts/validate-content.ts` + wire into the CI build job (`pnpm tsx scripts/validate-content.ts` before `pnpm build`) and a `pnpm validate:content` script. Add `concurrency: {group: deploy, cancel-in-progress: false}` to `.gitea/workflows/deploy.yml` (supported since Gitea 1.26): consecutive saves queue the pipeline instead of racing it, so deploys land in commit order.
|
||||
5. Migrate all 22 consumer files: `strings.x[lang]` → `useI18n().ui.x`; `field(lang, a, b)` and direct `@/data/*` content imports → `useI18n().content` resolved records; `Hero.tsx` renders tagline segments (span with existing classes) instead of `dangerouslySetInnerHTML`. No visual or behavioral change intended.
|
||||
6. `scripts/generate-resume.ts`: delete `resolveField` and `labels`; consume `UI`/`CONTENT`; `--lang` behavior unchanged. `scripts/generate-sitemap.ts`: unchanged imports (structure loaders).
|
||||
7. Delete `src/i18n/field.ts`, `src/i18n/strings.ts`.
|
||||
8. Update `AGENTS.md` (Data Layer + i18n sections) and mark `spec-v3-i18n.md` Phase 2 rows superseded by this spec.
|
||||
|
||||
**Verification:** `pnpm build` (tsc is the migration net — every unconverted call site is a type error), `pnpm validate:content`, `pnpm lint`, `pnpm build:resume-all` run **before and after** the migration with a **text-level diff** of the two PDF pairs (`pdftotext`) — the diff must be empty; owner walkthrough of all 7 routes in a real browser, both languages.
|
||||
|
||||
### Phase 2 — write path infrastructure
|
||||
|
||||
0. **Server step (§6.3):** update the production nginx stack with the `/api/content/` location + `htpasswd` + `GITEA_TOKEN` env; reload nginx on the deploy host.
|
||||
1. `nginx.conf` → template with the location (§6.2); `docker-compose.yaml`: env var for the token, mount `htpasswd`, use the nginx image template mechanism.
|
||||
2. Smoke: `curl` GET/PUT through the proxy with and without credentials; verify a commit appears in Gitea and CI deploys it.
|
||||
|
||||
### Phase 3 — edit mode (three verified sub-steps)
|
||||
|
||||
Scope note (was missing in rev.1): inline editing wraps the **~40 content render sites in the 22 consumer files** with `EditableText` bound to a text-document path; `ui.json` sites stay read-only. Phase 3 therefore touches consumer files again — by design, bounded by the §5.1 editable surface.
|
||||
|
||||
The phase lands as **three separately verified sub-steps** — each ends with its own check; the P3 acceptance criteria in §9 are unchanged, only ordered onto the sub-steps.
|
||||
|
||||
**3a — draft + inline text + save happy path.**
|
||||
1. `src/i18n/draft.ts`: draft documents (structure + text) with copy-on-write (§5.5), initialized from live proxy `GET`s + `last_commit_sha`s (§5.1); changed-path tracking + diff summaries; `sessionStorage` persistence and re-apply on remount with sha-drift detection (§5.2); runs `src/i18n/validate.ts` on every accepted edit.
|
||||
2. `src/i18n/edit-mode.ts`: session flag, hidden-iframe auth probe (§6.2 mechanics), `?edit` entry + `history.replaceState` strip on exit, `beforeunload` dirty guard (§5.2).
|
||||
3. `src/components/ui/EditableText.tsx`: inline editor bound to a text-document path implementing the §5.3 contract — transparent rendering outside edit mode, commit-on-blur only (IME-safe), Esc cancel, paste sanitization, single-line vs multi-line Enter, empty-required rejection, per-field revert.
|
||||
4. Consumer files: wrap the curated editable surface with `EditableText` (no other change). `Layout.tsx` / `main.tsx`: conditionally wrap in edit-mode provider when the flag is active. **All edit-mode components are lazy-loaded** (`React.lazy`) so the visitor bundle is unchanged in size and behavior (AC P3).
|
||||
5. Minimal save button (sequential PUTs per §6.1) — conflict detection only: a 412 shows "document changed externally" without the full merge UI yet.
|
||||
*Verify 3a:* edit a bio line → home About and `/about` update together; Vietnamese dấu composition commits only on blur, never mid-composition; invalid draft → save blocked with path-level errors; unauthenticated PUT → 401; mid-edit reload → draft restored, drifted sha flagged.
|
||||
|
||||
**3b — JSON panel + templates.**
|
||||
6. `src/components/layout/JsonPanel.tsx`: tabbed document editing (structure + text; `ui.*` read-only) with parse/JSON-pointer validation, record templates that create structure + text stubs together, and orphan-text cleanup on record delete (§5.4).
|
||||
*Verify 3b:* add a project via template → card appears on `/projects` and its detail route resolves in preview; delete a record → no orphan text remains (validator confirms); structural edit fails to save when validation rejects it.
|
||||
|
||||
**3c — save bar + conflicts + failure recovery.**
|
||||
7. `src/components/layout/EditBar.tsx`: dirty-document list + per-path diff, validate + save (sequential PUTs per §6.1), per-document status lines, conflict UI (rebase / take theirs / hand-merge, §5.6), partial-failure resume, exit with save-or-discard prompt.
|
||||
*Verify 3c:* save → commits visible in Gitea → CI deploys → live site shows the change; stale sha → full 412 conflict flow offers rebase / take-theirs / hand-merge per document; mid-sequence failure → resume from the first unwritten document without rewriting landed ones; save → live after the queued pipeline finishes.
|
||||
|
||||
---
|
||||
|
||||
## 8. Affected Files
|
||||
|
||||
| Phase | Files |
|
||||
|---|---|
|
||||
| 1 | `src/types/index.ts`, `tsconfig.app.json`, `scripts/generate-resume.ts`, `.gitea/workflows/deploy.yml` (validate step + `concurrency` group); new: `src/data/{profile,skills,experience,projects}.json` + their loaders (replacing the current `profile.ts`/`skills.ts`/`experience.ts`/`projects.ts` bodies), `src/i18n/dict-types.ts`, `src/i18n/validate.ts`, `src/i18n/index.ts`, `src/i18n/provider.tsx`, `src/i18n/locales/{vi,en}/ui.json`, `src/i18n/locales/{vi,en}/content.json`, `scripts/validate-content.ts`, throwaway `scripts/extract-content.ts` (deleted after the run); deleted: `src/i18n/strings.ts`, `src/i18n/field.ts`; migrated consumers: all 22 files listed in §1 row 3 |
|
||||
| 2 | `nginx.conf` (+ template), `docker-compose.yaml`, new `deploy/htpasswd`, production nginx stack (manual step) |
|
||||
| 3 | new: `src/i18n/draft.ts`, `src/i18n/edit-mode.ts`, `src/components/ui/EditableText.tsx`, `src/components/layout/EditBar.tsx`, `src/components/layout/JsonPanel.tsx`; edits: `src/components/layout/Layout.tsx`, `src/main.tsx`, the ~40 editable render sites across the 22 consumer files |
|
||||
| docs | this spec; `AGENTS.md` (Data Layer + i18n + Design Specs sections); `spec-v3-i18n.md` (Phase 2 marked superseded) |
|
||||
|
||||
## 9. Acceptance Criteria
|
||||
|
||||
- [ ] P1: adding a project/experience/skill/philosophy id to a structure document without its Vietnamese text fails `pnpm build` or `pnpm validate:content`; omitting only English text does neither, and renders Vietnamese.
|
||||
- [ ] P1: orphan or mismatched section text keys fail `pnpm validate:content` with exact document paths.
|
||||
- [ ] P1: site is visually and behaviorally identical across all 7 routes in both languages and both themes; resume PDFs unchanged in content — proven by a **text diff** (`pdftotext`) of before/after PDFs, not visual inspection; `generate-sitemap.ts` output unchanged.
|
||||
- [ ] P1: the hero tagline renders identical to today (emphasis span keeps its classes); no `dangerouslySetInnerHTML` remains anywhere in `src/`.
|
||||
- [ ] P1: no consumer file imports `i18n/field`; no `*En` fields remain in `src/types`; no shim interfaces remain.
|
||||
- [ ] P2: unauthenticated `PUT /api/content/...` → 401; authenticated PUT creates a commit; push to `master` triggers the existing deploy pipeline.
|
||||
- [ ] P2: consecutive pushes to `master` deploy in commit order — the `deploy.yml` concurrency group queues pipelines rather than racing them; an older pipeline never overwrites a newer build.
|
||||
- [ ] P2: the production proxy answers GET/PUT (after the §6.3 server step), not just local compose.
|
||||
- [ ] P3: a text edit in edit mode is visible on every page that renders that id, in the live preview, before saving.
|
||||
- [ ] P3: a structural edit (new project record + text) renders the new card and detail route in the live preview, and fails to save if validation rejects it.
|
||||
- [ ] P3: draft reflects live master even when it is ahead of the deployed bundle (§5.1 initialization).
|
||||
- [ ] P3: save writes only touched documents, sequentially; a concurrent external edit forces a rebase (412) instead of silently overwriting.
|
||||
- [ ] P3: visitors (no edit session) receive the unchanged static bundle behavior with zero edit affordances and no edit-mode code in the initial bundle.
|
||||
- [ ] P3: Vietnamese IME composition is never truncated — draft updates only on blur (§5.3).
|
||||
- [ ] P3: a mid-edit reload restores the draft and flags any document whose live sha has moved.
|
||||
- [ ] P3: 412 conflict offers rebase / take-theirs / hand-merge per document; a partial save resumes from the first unwritten document without rewriting landed ones.
|
||||
- [ ] P3: a template add creates the structure record and its text stubs together; a delete leaves no orphan text (validator confirms).
|
||||
|
||||
## 10. Risks & Mitigations
|
||||
|
||||
| Risk | Mitigation |
|
||||
|---|---|
|
||||
| Id instability breaks overlay joins | Project ids already URL-stable; new ids (skill/philosophy) are slugs fixed at creation; id unions make renames a compile-time event |
|
||||
| Cross-document drift (text without structure, sections without text) | Validator §3.6 in dev, CI, and pre-save — the same rules, one implementation |
|
||||
| A bad content commit breaks the build | CI gate: `tsc` + validator fail → last good deploy stays live |
|
||||
| Lost concurrent edits | `last_commit_sha` optimistic concurrency (§6.1) |
|
||||
| Multi-document save → transient mixed-state deploy | Documented policy (§6.1): sequential commits, final state consistent; low owner frequency |
|
||||
| HTML markup drifting back into content text | Resolved by D9: no content document contains HTML; validator §3.6 rule 5 rejects `<` / `>` in text values |
|
||||
| Edit mode reachable by curious visitors via `?edit` | Mode is inert without authenticated write credentials; UI affordances hidden until the handshake succeeds; query stripped on exit |
|
||||
| JSON documents lose code comments | Comments and invariants live in loaders and `dict-types.ts`; validator messages carry document paths |
|
||||
| Edit-mode machinery bloats the visitor bundle | All edit-mode components lazy-loaded (§7 P3 step 7) |
|
||||
| Text placed under the wrong id during migration (types verify structure, not value placement) | Migration is scripted: the extraction codemod moves values programmatically (§7 P1 step 2); before/after text diffs of resume PDFs and rendered pages (§7 P1 verification) |
|
||||
|
||||
## 11. Resolved and Deferred Review Items
|
||||
|
||||
Resolved by owner decision during the 2026-10-22 review:
|
||||
|
||||
- **Edit-mode entry** → Decision D8 (`?edit` on any route).
|
||||
- **`profile.tagline`** → Decision D9 (segment the value; markup moves to `Hero.tsx`).
|
||||
- Display name (rev.1 Q3) → Decision D6. `ui.json` editability (rev.1 Q4) → §5.1 editable surface: read-only in v4.
|
||||
|
||||
Deferred (not v4):
|
||||
|
||||
- **Media editing** (profile photo, QR images): the Contents API handles base64 fine, but `public/profile-photo.webp` is a fixed path served with 30-day immutable caching (`nginx.conf:25-30`) — replacing the file at the same URL serves the stale image until cache expiry. Correct media editing needs URL versioning (filename or `?v=<sha>`) plus a data reference update — its own small design. Binary git diffs also make review opaque, and edit frequency is low. Revisit in v4.1.
|
||||
|
||||
## 12. Progress Tracking
|
||||
|
||||
| # | Task | Phase | Status |
|
||||
|---|------|-------|--------|
|
||||
| 1 | This spec (rev.4) reviewed & approved by owner | — | ⬜ Awaiting review |
|
||||
| 2 | Review questions resolved → Decisions D8 (`?edit`), D9 (tagline segments) | — | ✅ Done 2026-10-22 |
|
||||
| 3 | Types: unions, structure/text/resolved types, PartialDeep | 1 | ✅ Done 2026-10-22 |
|
||||
| 4 | Structure documents + loaders (`src/data/*.json`) — extraction codemod, relative imports | 1 | ✅ Done 2026-10-22 |
|
||||
| 5 | Text + UI dictionaries (`src/i18n/locales/`) incl. resume labels | 1 | ✅ Done 2026-10-22 |
|
||||
| 6 | Validator (`src/i18n/validate.ts`, `scripts/validate-content.ts`) + CI wiring + `deploy.yml` concurrency group | 1 | ✅ Done 2026-10-22 |
|
||||
| 7 | Loader + provider | 1 | ✅ Done 2026-10-22 |
|
||||
| 8 | 22 consumer files migrated; `field.ts`/`strings.ts` deleted | 1 | ✅ Done 2026-10-22 |
|
||||
| 9 | Resume generator migrated to shared documents | 1 | ✅ Done 2026-10-22 |
|
||||
| 10 | Phase 1 verified (build, validate, lint, resume-PDF text diff, browser walkthrough) | 1 | ✅ Automated checks Done 2026-10-22 — `tsc -b`, `pnpm validate:content`, `pnpm lint` (no new warnings), `pnpm build`, `pnpm build:resume-all` all pass; the resume verification was **stronger than planned**: the generated resume HTML (`--dump-html`, both languages) is byte-identical before and after the migration, so no pdftotext diff was needed. A throwaway SSR smoke (`react-dom/server` over the real provider tree) rendered all 7 routes × both languages and matched EN/VI markers from the joined dictionaries (display names, section headings, philosophy quotes, project detail, contact links); it was deleted after the run. ⬜ Browser walkthrough of all 7 routes, both languages — owner |
|
||||
| 11 | Production nginx step (§6.3) | 2 | ⬜ TODO |
|
||||
| 12 | Local proxy config + compose + auth | 2 | ⬜ TODO |
|
||||
| 13 | Edit mode 3a: draft store, inline editing, save happy path | 3 | ⬜ TODO |
|
||||
| 14 | Edit mode 3b: JSON panel + record templates | 3 | ⬜ TODO |
|
||||
| 15 | Edit mode 3c: save bar, conflicts, failure recovery | 3 | ⬜ TODO |
|
||||
| 16 | Layout designer research (WYSIWYG / layout config) | deferred | ⬜ Out of v4 scope |
|
||||
@@ -11,6 +11,7 @@
|
||||
"build:resume-preview": "pnpm tsx scripts/generate-resume.ts --preview",
|
||||
"lint": "oxlint",
|
||||
"sitemap": "pnpm tsx scripts/generate-sitemap.ts",
|
||||
"validate:content": "pnpm tsx scripts/validate-content.ts",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
+31
-51
@@ -1,13 +1,10 @@
|
||||
import { chromium } from 'playwright';
|
||||
import { existsSync, mkdirSync, readFileSync } from 'node:fs';
|
||||
import { dirname, join, resolve } from 'node:path';
|
||||
import { profile } from '../src/data/profile.js';
|
||||
import { experiences } from '../src/data/experience.js';
|
||||
import { skillGroups } from '../src/data/skills.js';
|
||||
import { projects } from '../src/data/projects.js';
|
||||
import { CONTENT, UI } from '../src/i18n/index.js';
|
||||
import type { ResolvedExperienceEntry, ResolvedProject, ResolvedSkillGroup } from '../src/i18n/index.js';
|
||||
import { resumeQr } from '../src/data/resume.js';
|
||||
import { siteUrl } from '../src/data/site.js';
|
||||
import { strings } from '../src/i18n/strings.js';
|
||||
import type { Language } from '../src/types/index.js';
|
||||
|
||||
const ROOT = resolve(import.meta.dirname, '..');
|
||||
@@ -74,7 +71,7 @@ const fontFaces = Object.entries(fonts).map(([key, b64]) => {
|
||||
}).join('\n');
|
||||
|
||||
// --- Company logos: load every logo referenced by experience entries ---
|
||||
const logoIds = [...new Set(experiences.map(exp => exp.logo).filter((id): id is string => id !== undefined))];
|
||||
const logoIds = [...new Set(CONTENT.en.experiences.map(exp => exp.logo).filter((id): id is string => id !== undefined))];
|
||||
const logos: Record<string, string> = {};
|
||||
for (const id of logoIds) {
|
||||
const logoFile = join(ROOT, 'public/resume-logos', `${id}.svg`);
|
||||
@@ -104,28 +101,9 @@ for (const q of resumeQr) {
|
||||
// --- Version stamp date ---
|
||||
const updatedDate = new Date().toISOString().slice(0, 10);
|
||||
|
||||
// --- Language-specific label map ---
|
||||
const labels: Record<Language, Record<string, string>> = {
|
||||
en: {
|
||||
EXPERIENCE: 'Experience',
|
||||
SKILLS: 'Skills',
|
||||
PROJECTS: 'Projects',
|
||||
UPDATED: 'Last updated',
|
||||
QR_ALT: 'QR code',
|
||||
},
|
||||
vi: {
|
||||
EXPERIENCE: 'Kinh nghiệm',
|
||||
SKILLS: 'Kỹ năng',
|
||||
PROJECTS: 'Dự án',
|
||||
UPDATED: 'Cập nhật lần cuối',
|
||||
QR_ALT: 'mã QR',
|
||||
},
|
||||
};
|
||||
// (Removed: the inline `labels` map and `resolveField` — labels now live in
|
||||
// the UI dictionaries and text arrives pre-resolved through CONTENT.)
|
||||
|
||||
// --- Resolve bilingual field ---
|
||||
function resolveField<T>(en: T | undefined, vi: T | undefined, lang: Language): T {
|
||||
return lang === 'en' && en !== undefined ? en : (vi !== undefined ? vi : (en as T));
|
||||
}
|
||||
|
||||
// --- Escape data strings before injection ---
|
||||
function escapeHtml(value: string): string {
|
||||
@@ -141,25 +119,25 @@ function renderQr(lang: Language): string {
|
||||
return qrAssets
|
||||
.map(q => `
|
||||
<div class="qr-item">
|
||||
<img class="qr-img" src="${q.dataUri}" alt="${escapeHtml(`${q.label} ${labels[lang].QR_ALT}`)}" />
|
||||
<img class="qr-img" src="${q.dataUri}" alt="${escapeHtml(`${q.label} ${UI[lang].resume.QR_ALT}`)}" />
|
||||
<span class="qr-label">${escapeHtml(q.label)}</span>
|
||||
</div>`)
|
||||
.join('');
|
||||
}
|
||||
|
||||
// --- Render HTML helpers ---
|
||||
function renderExperience(exps: typeof experiences, lang: Language): string {
|
||||
function renderExperience(exps: ResolvedExperienceEntry[]): string {
|
||||
return exps
|
||||
// open-to-work (variant 'current') is excluded from the resume PDF entirely
|
||||
.filter(exp => exp.variant !== 'current')
|
||||
.map(exp => {
|
||||
const variantClass = exp.variant ? ` ${exp.variant}` : '';
|
||||
const companyLine = [exp.company, exp.location].filter(Boolean).join(' · ');
|
||||
const responsibilities = resolveField(exp.responsibilitiesEn, exp.responsibilities, lang);
|
||||
const responsibilities = exp.responsibilities;
|
||||
return `
|
||||
<div class="exp-entry avoid-break${variantClass}">
|
||||
<div class="exp-header">
|
||||
<span class="exp-title">${escapeHtml(resolveField(exp.titleEn, exp.title, lang))}</span>
|
||||
<span class="exp-title">${escapeHtml(exp.title)}</span>
|
||||
<span class="exp-duration">${escapeHtml(exp.duration)}</span>
|
||||
</div>
|
||||
<div class="exp-company">${exp.logo ? `<img class="exp-logo" src="data:image/svg+xml;base64,${logos[exp.logo]}" alt="" />` : ''}${escapeHtml(companyLine)}</div>
|
||||
@@ -175,27 +153,27 @@ function renderExperience(exps: typeof experiences, lang: Language): string {
|
||||
function renderTldr(lang: Language): string {
|
||||
return `
|
||||
<div class="timeline-tldr avoid-break">
|
||||
<div class="timeline-tldr-chip">${escapeHtml(strings.experience.tldr[lang])}</div>
|
||||
<div class="timeline-tldr-text">${escapeHtml(strings.experience.tldrText[lang])}</div>
|
||||
<div class="timeline-tldr-chip">${escapeHtml(UI[lang].experience.tldr)}</div>
|
||||
<div class="timeline-tldr-text">${escapeHtml(UI[lang].experience.tldrText)}</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function renderSkills(groups: typeof skillGroups, lang: Language): string {
|
||||
function renderSkills(groups: ResolvedSkillGroup[]): string {
|
||||
return groups.map(group => `
|
||||
<div class="skill-group avoid-break">
|
||||
<div class="skill-group-title">${escapeHtml(resolveField(group.titleEn, group.title, lang))}</div>
|
||||
<div class="skill-group-title">${escapeHtml(group.title)}</div>
|
||||
<div class="skill-list">${group.skills.map(skill => escapeHtml(skill)).join(' · ')}</div>
|
||||
</div>
|
||||
`).join('');
|
||||
}
|
||||
|
||||
function renderProjects(projs: typeof projects, lang: Language): string {
|
||||
function renderProjects(projs: ResolvedProject[]): string {
|
||||
return projs.map(project => `
|
||||
<div class="project avoid-break">
|
||||
<div class="project-title">${escapeHtml(resolveField(project.titleEn, project.title, lang))}</div>
|
||||
<div class="project-title">${escapeHtml(project.title)}</div>
|
||||
<div class="project-role">${escapeHtml(project.role)}</div>
|
||||
<div class="project-summary">${escapeHtml(resolveField(project.summaryEn, project.summary, lang))}</div>
|
||||
<div class="project-summary">${escapeHtml(project.summary)}</div>
|
||||
<div class="project-tech">
|
||||
${project.technologies.map(t => `<span>${escapeHtml(t)}</span>`).join('')}
|
||||
</div>
|
||||
@@ -205,26 +183,28 @@ function renderProjects(projs: typeof projects, lang: Language): string {
|
||||
|
||||
// --- Assemble HTML ---
|
||||
function buildHtml(lang: Language): string {
|
||||
const c = CONTENT[lang];
|
||||
const r = UI[lang].resume;
|
||||
const fills: Array<[string, string]> = [
|
||||
['{{NAME}}', escapeHtml(resolveField(profile.nameEn, profile.name, lang))],
|
||||
['{{TITLE}}', escapeHtml(resolveField(profile.titleEn, profile.title, lang))],
|
||||
['{{BIO}}', escapeHtml(resolveField(profile.bioEn, profile.bio, lang))],
|
||||
['{{EMAIL}}', escapeHtml(profile.email)],
|
||||
['{{GITHUB_URL}}', escapeHtml(profile.githubUrl)],
|
||||
['{{LINKEDIN_URL}}', escapeHtml(profile.linkedinUrl)],
|
||||
['{{NAME}}', escapeHtml(c.profile.name)],
|
||||
['{{TITLE}}', escapeHtml(c.profile.title)],
|
||||
['{{BIO}}', escapeHtml(c.profile.bio)],
|
||||
['{{EMAIL}}', escapeHtml(c.profile.email)],
|
||||
['{{GITHUB_URL}}', escapeHtml(c.profile.githubUrl)],
|
||||
['{{LINKEDIN_URL}}', escapeHtml(c.profile.linkedinUrl)],
|
||||
['{{PHOTO_BASE64}}', photoBase64],
|
||||
['{{FONT_FACES}}', fontFaces],
|
||||
['{{UPDATED_DATE}}', updatedDate],
|
||||
['{{UPDATED_LABEL}}', labels[lang].UPDATED],
|
||||
['{{UPDATED_LABEL}}', r.UPDATED],
|
||||
['{{SITE_URL}}', escapeHtml(siteUrl)],
|
||||
['{{LANG}}', lang],
|
||||
['{{EXPERIENCE_LABEL}}', labels[lang].EXPERIENCE],
|
||||
['{{SKILLS_LABEL}}', labels[lang].SKILLS],
|
||||
['{{PROJECTS_LABEL}}', labels[lang].PROJECTS],
|
||||
['{{EXPERIENCE}}', renderExperience(experiences, lang)],
|
||||
['{{EXPERIENCE_LABEL}}', r.EXPERIENCE],
|
||||
['{{SKILLS_LABEL}}', r.SKILLS],
|
||||
['{{PROJECTS_LABEL}}', r.PROJECTS],
|
||||
['{{EXPERIENCE}}', renderExperience(c.experiences)],
|
||||
['{{TLDR}}', renderTldr(lang)],
|
||||
['{{SKILLS}}', renderSkills(skillGroups, lang)],
|
||||
['{{PROJECTS}}', renderProjects(projects, lang)],
|
||||
['{{SKILLS}}', renderSkills(c.skillGroups)],
|
||||
['{{PROJECTS}}', renderProjects(c.projects)],
|
||||
['{{QR_CODES}}', renderQr(lang)],
|
||||
];
|
||||
return fills.reduce((html, [key, value]) => html.split(key).join(value), template);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// CLI over the shared validator (spec-v4 §3.6): the CI build gate and, from
|
||||
// Phase 3 on, the save gate. A malformed content document fails here with
|
||||
// exact document paths, so the last good deploy stays live.
|
||||
import { experiences } from '../src/data/experience';
|
||||
import { profile } from '../src/data/profile';
|
||||
import { projects } from '../src/data/projects';
|
||||
import { skillGroups } from '../src/data/skills';
|
||||
import contentEnJson from '../src/i18n/locales/en/content.json';
|
||||
import contentViJson from '../src/i18n/locales/vi/content.json';
|
||||
import type { ContentEn, ContentVi } from '../src/i18n/dict-types';
|
||||
import { collectContentIssues } from '../src/i18n/validate';
|
||||
|
||||
const contentVi: ContentVi = contentViJson;
|
||||
const contentEn: ContentEn = contentEnJson;
|
||||
|
||||
const issues = collectContentIssues(
|
||||
{ profile, skills: skillGroups, experience: experiences, projects },
|
||||
contentVi,
|
||||
contentEn,
|
||||
);
|
||||
|
||||
if (issues.length > 0) {
|
||||
console.error(`content validation failed (${issues.length} issue(s)):`);
|
||||
for (const issue of issues) {
|
||||
console.error(` ${issue.path}: ${issue.message}`);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('content documents valid');
|
||||
+7
-2
@@ -4,6 +4,7 @@ import { BrowserRouter, Routes, Route } from 'react-router'
|
||||
import { ThemeProvider } from '@/hooks/useTheme'
|
||||
import { Layout } from '@/components/layout/Layout'
|
||||
import { LanguageProvider } from '@/hooks/useLanguage'
|
||||
import { I18nProvider } from '@/i18n/provider'
|
||||
import { HomePage } from '@/pages/HomePage'
|
||||
|
||||
// HomePage stays eager: it is the landing route and owns the LCP, so its code must
|
||||
@@ -20,7 +21,10 @@ function App() {
|
||||
<BrowserRouter>
|
||||
<ThemeProvider>
|
||||
<LanguageProvider>
|
||||
<Layout>
|
||||
{/* I18nProvider sits below LanguageProvider: it resolves the language
|
||||
through useLanguage and hands every consumer the UI/CONTENT of it. */}
|
||||
<I18nProvider>
|
||||
<Layout>
|
||||
{/* A null fallback keeps the shell (nav, footer) painted without reserving a
|
||||
box that would shift the page when the route chunk lands. */}
|
||||
<Suspense fallback={null}>
|
||||
@@ -34,7 +38,8 @@ function App() {
|
||||
<Route path="/contact" element={<ContactPage />} />
|
||||
</Routes>
|
||||
</Suspense>
|
||||
</Layout>
|
||||
</Layout>
|
||||
</I18nProvider>
|
||||
</LanguageProvider>
|
||||
</ThemeProvider>
|
||||
</BrowserRouter>
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
import { Link } from 'react-router'
|
||||
import { profile } from '@/data/profile'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
import { footerPaths } from '@/data/navigation'
|
||||
import { SocialLinks } from '@/components/ui/SocialLinks'
|
||||
|
||||
export function Footer() {
|
||||
const year = new Date().getFullYear()
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
|
||||
// The display name is localized (D6): the English footer now names "Dong
|
||||
// Nguyen" instead of carrying the Vietnamese name in both languages.
|
||||
return (
|
||||
<footer className="footer" role="contentinfo">
|
||||
<div className="footer-container">
|
||||
<p className="footer-text">
|
||||
© {year} {profile.name}. {strings.footer.copyright[lang]}
|
||||
© {year} {c.profile.name}. {s.footer.copyright}
|
||||
</p>
|
||||
|
||||
<ul className="footer-links">
|
||||
{footerPaths.map((path) => {
|
||||
const key = path === '/' ? 'home' : path.replace('/', '') as keyof typeof strings.footer.links
|
||||
const label = strings.footer.links[key][lang]
|
||||
const key = path === '/' ? 'home' : path.replace('/', '') as keyof typeof s.footer.links
|
||||
const label = s.footer.links[key]
|
||||
|
||||
return (
|
||||
<li key={path}>
|
||||
<Link to={path} className="footer-link">
|
||||
|
||||
@@ -5,7 +5,7 @@ import { navPaths } from '@/data/navigation'
|
||||
import { paletteIds, paletteMeta } from '@/data/palettes'
|
||||
import { useTheme } from '@/hooks/useTheme'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
import { RollingTextLink } from '@/components/ui/RollingTextLink'
|
||||
import { SocialLinks } from '@/components/ui/SocialLinks'
|
||||
import { LanguageIcon } from '@/components/ui/LanguageIcon'
|
||||
@@ -18,6 +18,7 @@ interface MobileMenuProps {
|
||||
|
||||
export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
const { lang, setLang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
const { resolvedTheme, setTheme, palette, setPalette } = useTheme()
|
||||
const location = useLocation()
|
||||
const reduceMotion = useReducedMotion()
|
||||
@@ -33,7 +34,7 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
tabIndex={-1}
|
||||
aria-label={strings.nav.menuAria[lang]}
|
||||
aria-label={s.nav.menuAria}
|
||||
initial={{ opacity: 0, y: -12 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
exit={{ opacity: 0, y: -12 }}
|
||||
@@ -41,11 +42,11 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
onAnimationComplete={() => sheetRef.current?.focus()}
|
||||
>
|
||||
<div className="mobile-menu-inner">
|
||||
<nav className="mobile-menu-group" aria-label={strings.nav.groupMenu[lang]}>
|
||||
<span className="mobile-menu-heading">{strings.nav.groupMenu[lang]}</span>
|
||||
<nav className="mobile-menu-group" aria-label={s.nav.groupMenu}>
|
||||
<span className="mobile-menu-heading">{s.nav.groupMenu}</span>
|
||||
<ul className="mobile-menu-list">
|
||||
{navPaths.map((path, index) => {
|
||||
const navKey = path === '/' ? 'home' : path.replace('/', '') as keyof typeof strings.nav
|
||||
const navKey = path === '/' ? 'home' : path.replace('/', '') as keyof typeof s.nav
|
||||
const active = path === location.pathname
|
||||
return (
|
||||
<motion.li
|
||||
@@ -60,7 +61,7 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
className={active ? 'mobile-menu-link active' : 'mobile-menu-link'}
|
||||
onClick={onClose}
|
||||
>
|
||||
{strings.nav[navKey][lang]}
|
||||
{s.nav[navKey]}
|
||||
</RollingTextLink>
|
||||
</motion.li>
|
||||
)
|
||||
@@ -69,11 +70,11 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
</nav>
|
||||
|
||||
<div className="mobile-menu-group">
|
||||
<span className="mobile-menu-heading">{strings.nav.groupAppearance[lang]}</span>
|
||||
<span className="mobile-menu-heading">{s.nav.groupAppearance}</span>
|
||||
|
||||
<div className="mobile-menu-segment">
|
||||
<span className="mobile-menu-segment-label">{strings.nav.langGroup[lang]}</span>
|
||||
<div className="mobile-menu-segment-options" role="group" aria-label={strings.nav.langGroup[lang]}>
|
||||
<span className="mobile-menu-segment-label">{s.nav.langGroup}</span>
|
||||
<div className="mobile-menu-segment-options" role="group" aria-label={s.nav.langGroup}>
|
||||
{/* Icons, not words — globe for English, red flag for Tiếng Việt — in the same
|
||||
44px icon-only shape as the Theme color row. An icon cannot say which language
|
||||
it is, so each option carries its own-language name in aria-label and title. */}
|
||||
@@ -81,8 +82,8 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
type="button"
|
||||
className={lang === 'en' ? 'mobile-menu-icon-option active' : 'mobile-menu-icon-option'}
|
||||
aria-pressed={lang === 'en'}
|
||||
aria-label={strings.nav.langEn[lang]}
|
||||
title={strings.nav.langEn[lang]}
|
||||
aria-label={s.nav.langEn}
|
||||
title={s.nav.langEn}
|
||||
onClick={() => setLang('en')}
|
||||
>
|
||||
<LanguageIcon lang="en" />
|
||||
@@ -91,8 +92,8 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
type="button"
|
||||
className={lang === 'vi' ? 'mobile-menu-icon-option active' : 'mobile-menu-icon-option'}
|
||||
aria-pressed={lang === 'vi'}
|
||||
aria-label={strings.nav.langVi[lang]}
|
||||
title={strings.nav.langVi[lang]}
|
||||
aria-label={s.nav.langVi}
|
||||
title={s.nav.langVi}
|
||||
onClick={() => setLang('vi')}
|
||||
>
|
||||
<LanguageIcon lang="vi" />
|
||||
@@ -101,8 +102,8 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
</div>
|
||||
|
||||
<div className="mobile-menu-segment">
|
||||
<span className="mobile-menu-segment-label">{strings.nav.themeGroup[lang]}</span>
|
||||
<div className="mobile-menu-segment-options" role="group" aria-label={strings.nav.themeGroup[lang]}>
|
||||
<span className="mobile-menu-segment-label">{s.nav.themeGroup}</span>
|
||||
<div className="mobile-menu-segment-options" role="group" aria-label={s.nav.themeGroup}>
|
||||
{/* Icons, not words — the bar's own line art: moon for dark, sun for light.
|
||||
An icon alone cannot name a mode, so each option carries the translated
|
||||
mode name in aria-label and title. */}
|
||||
@@ -110,8 +111,8 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
type="button"
|
||||
className={resolvedTheme === 'dark' ? 'mobile-menu-icon-option active' : 'mobile-menu-icon-option'}
|
||||
aria-pressed={resolvedTheme === 'dark'}
|
||||
aria-label={strings.nav.themeDark[lang]}
|
||||
title={strings.nav.themeDark[lang]}
|
||||
aria-label={s.nav.themeDark}
|
||||
title={s.nav.themeDark}
|
||||
onClick={() => setTheme('dark')}
|
||||
>
|
||||
<MoonIcon />
|
||||
@@ -120,8 +121,8 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
type="button"
|
||||
className={resolvedTheme === 'light' ? 'mobile-menu-icon-option active' : 'mobile-menu-icon-option'}
|
||||
aria-pressed={resolvedTheme === 'light'}
|
||||
aria-label={strings.nav.themeLight[lang]}
|
||||
title={strings.nav.themeLight[lang]}
|
||||
aria-label={s.nav.themeLight}
|
||||
title={s.nav.themeLight}
|
||||
onClick={() => setTheme('light')}
|
||||
>
|
||||
<SunIcon />
|
||||
@@ -130,8 +131,8 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
</div>
|
||||
|
||||
<div className="mobile-menu-segment">
|
||||
<span className="mobile-menu-segment-label">{strings.nav.palette[lang]}</span>
|
||||
<div className="mobile-menu-segment-options" role="group" aria-label={strings.nav.palette[lang]}>
|
||||
<span className="mobile-menu-segment-label">{s.nav.palette}</span>
|
||||
<div className="mobile-menu-segment-options" role="group" aria-label={s.nav.palette}>
|
||||
{paletteIds.map((id) => (
|
||||
<button
|
||||
key={id}
|
||||
@@ -150,7 +151,7 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
|
||||
</div>
|
||||
|
||||
<div className="mobile-menu-group">
|
||||
<span className="mobile-menu-heading">{strings.social.heading[lang]}</span>
|
||||
<span className="mobile-menu-heading">{s.social.heading}</span>
|
||||
<SocialLinks />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Link, useLocation } from 'react-router'
|
||||
import { AnimatePresence, motion } from 'motion/react'
|
||||
import { useTheme } from '@/hooks/useTheme'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
import { navPaths } from '@/data/navigation'
|
||||
import { RollingTextLink } from '@/components/ui/RollingTextLink'
|
||||
import { ThemePaletteMenu } from '@/components/layout/ThemePaletteMenu'
|
||||
@@ -15,8 +15,9 @@ import { ResumeNavButton } from '@/components/layout/ResumeNavButton'
|
||||
export function Navigation() {
|
||||
const { cycleTheme, resolvedTheme } = useTheme()
|
||||
const { lang, toggleLang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
const targetLang = lang === 'en' ? 'vi' : 'en'
|
||||
const targetLabel = targetLang === 'en' ? strings.nav.langEn[lang] : strings.nav.langVi[lang]
|
||||
const targetLabel = targetLang === 'en' ? s.nav.langEn : s.nav.langVi
|
||||
const [mobileOpen, setMobileOpen] = useState(false)
|
||||
const location = useLocation()
|
||||
const triggerRef = useRef<HTMLButtonElement>(null)
|
||||
@@ -59,7 +60,7 @@ export function Navigation() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<nav className="nav" role="navigation" aria-label={strings.nav.mainNav[lang]}>
|
||||
<nav className="nav" role="navigation" aria-label={s.nav.mainNav}>
|
||||
<div className="nav-container">
|
||||
<div className="nav-brand">
|
||||
{/* Trigger first, brand next: the hamburger is the sheet's own control and sits at
|
||||
@@ -69,7 +70,7 @@ export function Navigation() {
|
||||
ref={triggerRef}
|
||||
className="mobile-menu-btn"
|
||||
onClick={() => setMobileOpen((prev) => !prev)}
|
||||
aria-label={mobileOpen ? strings.nav.closeMenu[lang] : strings.nav.openMenu[lang]}
|
||||
aria-label={mobileOpen ? s.nav.closeMenu : s.nav.openMenu}
|
||||
aria-expanded={mobileOpen}
|
||||
aria-controls="mobile-menu"
|
||||
>
|
||||
@@ -103,7 +104,7 @@ export function Navigation() {
|
||||
<Link to="/"> target the {CV} wordmark always had. The accessible name is the
|
||||
translated Home label; the icon itself is decorative. The current-page marker stays
|
||||
on the nav link and the sheet's Home row. */}
|
||||
<Link to="/" className="nav-logo" aria-label={strings.nav.home[lang]}>
|
||||
<Link to="/" className="nav-logo" aria-label={s.nav.home}>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
||||
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||
<polyline points="9 22 9 12 15 12 15 22" />
|
||||
@@ -116,8 +117,8 @@ export function Navigation() {
|
||||
|
||||
<ul className="nav-menu">
|
||||
{navPaths.map((path) => {
|
||||
const navKey = path === '/' ? 'home' : path.replace('/', '') as keyof typeof strings.nav
|
||||
const label = strings.nav[navKey][lang]
|
||||
const navKey = path === '/' ? 'home' : path.replace('/', '') as keyof typeof s.nav
|
||||
const label = s.nav[navKey]
|
||||
return (
|
||||
<li key={path}>
|
||||
<RollingTextLink
|
||||
@@ -139,8 +140,8 @@ export function Navigation() {
|
||||
<button
|
||||
className="nav-control lang-toggle"
|
||||
onClick={toggleLang}
|
||||
aria-label={strings.nav.langSwitch[lang]}
|
||||
title={`${strings.nav.switchTo[lang]} ${targetLabel}`}
|
||||
aria-label={s.nav.langSwitch}
|
||||
title={`${s.nav.switchTo} ${targetLabel}`}
|
||||
>
|
||||
<LanguageIcon lang={targetLang} />
|
||||
</button>
|
||||
@@ -148,8 +149,8 @@ export function Navigation() {
|
||||
<button
|
||||
className="nav-control theme-toggle"
|
||||
onClick={cycleTheme}
|
||||
aria-label={`${strings.nav.themeSwitch[lang]} (${resolvedTheme === 'dark' ? strings.nav.themeDark[lang] : strings.nav.themeLight[lang]})`}
|
||||
title={`${strings.nav.themeMode[lang]}: ${resolvedTheme === 'dark' ? strings.nav.themeDark[lang] : strings.nav.themeLight[lang]}`}
|
||||
aria-label={`${s.nav.themeSwitch} (${resolvedTheme === 'dark' ? s.nav.themeDark : s.nav.themeLight})`}
|
||||
title={`${s.nav.themeMode}: ${resolvedTheme === 'dark' ? s.nav.themeDark : s.nav.themeLight}`}
|
||||
>
|
||||
{resolvedTheme === 'dark' ? <SunIcon /> : <MoonIcon />}
|
||||
</button>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { resumeAvailable } from '@/data/resume'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
import { useResumeDialog } from '@/hooks/useResumeDialog'
|
||||
import { ResumeDialog } from '@/components/ui/ResumeDialog'
|
||||
import { ResumeIcon } from '@/components/ui/icons'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
/**
|
||||
* Bar entry for the resume: an icon-only `.nav-control` in the brand group, right after the home
|
||||
@@ -11,7 +10,7 @@ import { strings } from '@/i18n/strings'
|
||||
* accessible name is the translated action in `aria-label`, the hint is the `title`.
|
||||
*/
|
||||
export function ResumeNavButton() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
const { open, openDialog, close, containerRef, triggerRef, panelRef } = useResumeDialog()
|
||||
|
||||
if (!resumeAvailable) return null
|
||||
@@ -24,8 +23,8 @@ export function ResumeNavButton() {
|
||||
aria-haspopup="dialog"
|
||||
aria-expanded={open}
|
||||
aria-controls="resume-modal-nav"
|
||||
aria-label={strings.nav.resume[lang]}
|
||||
title={strings.common.resumeModalHint[lang]}
|
||||
aria-label={s.nav.resume}
|
||||
title={s.common.resumeModalHint}
|
||||
onClick={openDialog}
|
||||
>
|
||||
<ResumeIcon size={24} />
|
||||
|
||||
@@ -4,11 +4,12 @@ import { useTheme } from '@/hooks/useTheme'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { useClickOutside } from '@/hooks/useClickOutside'
|
||||
import { paletteIds, paletteMeta } from '@/data/palettes'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function ThemePaletteMenu() {
|
||||
const { palette, setPalette } = useTheme()
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
const [open, setOpen] = useState(false)
|
||||
const containerRef = useRef<HTMLDivElement>(null)
|
||||
const triggerRef = useRef<HTMLButtonElement>(null)
|
||||
@@ -33,8 +34,8 @@ export function ThemePaletteMenu() {
|
||||
className={`nav-control nav-palette-trigger ${open ? 'open' : ''}`}
|
||||
aria-expanded={open}
|
||||
aria-controls="palette-menu"
|
||||
aria-label={`${strings.nav.palette[lang]}: ${paletteMeta[palette].label[lang]}`}
|
||||
title={strings.nav.paletteAria[lang]}
|
||||
aria-label={`${s.nav.palette}: ${paletteMeta[palette].label[lang]}`}
|
||||
title={s.nav.paletteAria}
|
||||
onClick={() => setOpen((prev) => !prev)}
|
||||
>
|
||||
{/* Rotation tracks the submenu: 90° while it is open, back to 0° on selection, Escape or
|
||||
|
||||
@@ -2,12 +2,9 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { motion } from 'motion/react'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { profile } from '@/data/profile'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
export function About() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -21,18 +18,18 @@ export function About() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.about.heading[lang]} tag={strings.about.heading[lang]} />
|
||||
<SectionHeading title={s.about.heading} tag={s.about.heading} />
|
||||
<p className="prose-lede lede-wide">
|
||||
{field(lang, profile.bio, profile.bioEn)}
|
||||
{c.profile.bio}
|
||||
</p>
|
||||
|
||||
<h3 className="subheading">
|
||||
{strings.about.engineeringTitle[lang]}
|
||||
{s.about.engineeringTitle}
|
||||
</h3>
|
||||
<div className="philosophy-grid">
|
||||
{profile.philosophy.map((point, i) => (
|
||||
{c.profile.philosophy.map((point, i) => (
|
||||
<motion.div
|
||||
key={point.title}
|
||||
key={point.id}
|
||||
className="philosophy-card"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
@@ -41,8 +38,8 @@ export function About() {
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{field(lang, point.title, point.titleEn)}</h3>
|
||||
<p>{field(lang, point.description, point.descriptionEn)}</p>
|
||||
<h3>{point.title}</h3>
|
||||
<p>{point.description}</p>
|
||||
<div className="philosophy-keywords">
|
||||
{point.keywords.map((kw) => (
|
||||
<Tag key={kw}>{kw}</Tag>
|
||||
@@ -53,10 +50,10 @@ export function About() {
|
||||
</div>
|
||||
|
||||
<h3 className="subheading">
|
||||
{strings.about.exploringTitle[lang]}
|
||||
{s.about.exploringTitle}
|
||||
</h3>
|
||||
<div className="interests-list">
|
||||
{profile.currentInterests.map((interest) => (
|
||||
{c.profile.currentInterests.map((interest) => (
|
||||
<Tag key={interest} accent>
|
||||
{interest}
|
||||
</Tag>
|
||||
|
||||
@@ -2,10 +2,9 @@ import { motion } from "motion/react"
|
||||
import { SectionHeading } from "@/components/ui/SectionHeading"
|
||||
import { ContactLinks } from "@/components/ui/ContactLinks"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
export function Contact() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -20,7 +19,7 @@ export function Contact() {
|
||||
}}
|
||||
>
|
||||
|
||||
<SectionHeading title={strings.contact.heading[lang]} tag={strings.common.contactTag[lang]} />
|
||||
<SectionHeading title={s.contact.heading} tag={s.common.contactTag} />
|
||||
<ContactLinks />
|
||||
</motion.section>
|
||||
</InView>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { resumeAvailable } from '@/data/resume'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
import { useResumeDialog } from '@/hooks/useResumeDialog'
|
||||
import { ResumeDialog } from '@/components/ui/ResumeDialog'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
|
||||
export function DownloadResume() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
const { open, openDialog, close, containerRef, triggerRef, panelRef } = useResumeDialog()
|
||||
|
||||
if (!resumeAvailable) return null
|
||||
@@ -23,14 +23,14 @@ export function DownloadResume() {
|
||||
aria-haspopup="dialog"
|
||||
aria-expanded={open}
|
||||
aria-controls="resume-modal"
|
||||
title={strings.common.resumeModalHint[lang]}
|
||||
title={s.common.resumeModalHint}
|
||||
onClick={openDialog}
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="20" height="20" aria-hidden="true">
|
||||
<path d="M12 3v10m0 0l-3-3m3 3l3-3" />
|
||||
<path d="M3 17h18" />
|
||||
</svg>
|
||||
<span>{strings.common.resumeDownload[lang]}</span>
|
||||
<span>{s.common.resumeDownload}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { motion } from "motion/react"
|
||||
import { experiences } from "@/data/experience"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function Experience() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -21,10 +18,10 @@ export function Experience() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.experience.heading[lang]} tag={strings.experience.heading[lang]} />
|
||||
<SectionHeading title={s.experience.heading} tag={s.experience.heading} />
|
||||
<div className="page-body">
|
||||
<div className="timeline">
|
||||
{experiences.map((exp, i) => (
|
||||
{c.experiences.map((exp, i) => (
|
||||
<motion.div
|
||||
key={exp.id}
|
||||
className={exp.variant ? `timeline-entry timeline-entry-${exp.variant}` : 'timeline-entry'}
|
||||
@@ -36,7 +33,7 @@ export function Experience() {
|
||||
<div className="timeline-marker" />
|
||||
<div className="timeline-header">
|
||||
<div className="timeline-title">
|
||||
{field(lang, exp.title, exp.titleEn)}
|
||||
{exp.title}
|
||||
</div>
|
||||
<div className="timeline-company">{exp.company}</div>
|
||||
<div className="timeline-meta">
|
||||
@@ -47,7 +44,7 @@ export function Experience() {
|
||||
</div>
|
||||
</div>
|
||||
<ul className="timeline-responsibilities">
|
||||
{field(lang, exp.responsibilities, exp.responsibilitiesEn).map((r) => (
|
||||
{exp.responsibilities.map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
))}
|
||||
</ul>
|
||||
@@ -55,8 +52,8 @@ export function Experience() {
|
||||
))}
|
||||
<div className="timeline-tldr">
|
||||
<span className="timeline-tldr-marker" aria-hidden="true" />
|
||||
<span className="timeline-tldr-chip">{strings.experience.tldr[lang]}</span>
|
||||
<p className="timeline-tldr-text">{strings.experience.tldrText[lang]}</p>
|
||||
<span className="timeline-tldr-chip">{s.experience.tldr}</span>
|
||||
<p className="timeline-tldr-text">{s.experience.tldrText}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { motion } from "motion/react"
|
||||
import { SectionHeading } from "@/components/ui/SectionHeading"
|
||||
import { skillGroups } from "@/data/skills"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function Expertise() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -21,11 +18,11 @@ export function Expertise() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.expertise.heading[lang]} tag={strings.expertise.heading[lang]} />
|
||||
<SectionHeading title={s.expertise.heading} tag={s.expertise.heading} />
|
||||
<div className="expertise-grid">
|
||||
{skillGroups.map((group, i) => (
|
||||
{c.skillGroups.map((group, i) => (
|
||||
<motion.div
|
||||
key={group.title}
|
||||
key={group.id}
|
||||
className="expertise-card"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
@@ -34,7 +31,7 @@ export function Expertise() {
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{field(lang, group.title, group.titleEn)}</h3>
|
||||
<h3>{group.title}</h3>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {motion, useScroll, useTransform} from "motion/react"
|
||||
import {InView} from "@/components/ui/InView"
|
||||
import {useLanguage} from '@/hooks/useLanguage'
|
||||
import {strings} from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import {useI18n} from '@/i18n/provider'
|
||||
import {DownloadResume} from '@/components/sections/DownloadResume'
|
||||
|
||||
|
||||
@@ -10,11 +8,11 @@ import {Button} from "@/components/ui/Button"
|
||||
import {Typewriter} from '@/components/ui/Typewriter'
|
||||
import {HeroParticles} from '@/components/sections/HeroParticles'
|
||||
import {SocialLinks} from "@/components/ui/SocialLinks"
|
||||
import {profile} from "@/data/profile"
|
||||
|
||||
|
||||
export function Hero() {
|
||||
const {scrollY} = useScroll()
|
||||
const {lang} = useLanguage()
|
||||
const {ui: s, content: c} = useI18n()
|
||||
const y = useTransform(scrollY, [0, 300], [0, -80])
|
||||
return (
|
||||
<InView>
|
||||
@@ -43,7 +41,7 @@ export function Hero() {
|
||||
>
|
||||
<span className="hero-greeting">
|
||||
<span className="greeting-dot"/>
|
||||
{strings.hero.greeting[lang]}
|
||||
{s.hero.greeting}
|
||||
</span>
|
||||
</motion.div>
|
||||
<motion.h1
|
||||
@@ -54,7 +52,7 @@ export function Hero() {
|
||||
viewport={{once: true, amount: 0.2}}
|
||||
transition={{duration: 0.45, ease: "easeOut", delay: 0.08}}
|
||||
>
|
||||
<span className="name-highlight">{field(lang, profile.name, profile.nameEn)}</span>
|
||||
<span className="name-highlight">{c.profile.name}</span>
|
||||
</motion.h1>
|
||||
<motion.p
|
||||
className="hero-title"
|
||||
@@ -63,7 +61,7 @@ export function Hero() {
|
||||
viewport={{once: true, amount: 0.2}}
|
||||
transition={{duration: 0.45, ease: "easeOut", delay: 0.16}}
|
||||
>
|
||||
<Typewriter texts={profile.roles}/>
|
||||
<Typewriter texts={c.profile.roles}/>
|
||||
</motion.p>
|
||||
<motion.p
|
||||
className="hero-tagline"
|
||||
@@ -71,8 +69,17 @@ export function Hero() {
|
||||
whileInView={{opacity: 1, y: 0}}
|
||||
viewport={{once: true, amount: 0.2}}
|
||||
transition={{duration: 0.45, ease: "easeOut", delay: 0.24}}
|
||||
dangerouslySetInnerHTML={{__html: field(lang, profile.tagline, profile.taglineEn)}}
|
||||
/>
|
||||
>
|
||||
{/* Tagline segments (D9): markup is this component's rendering,
|
||||
never content — the emphasis span keeps its classes. */}
|
||||
{c.profile.tagline.map((segment, i) => (
|
||||
segment.emphasis ? (
|
||||
<span key={i} className="ok-possible name-highlight">{segment.text}</span>
|
||||
) : (
|
||||
<span key={i}>{segment.text}</span>
|
||||
)
|
||||
))}
|
||||
</motion.p>
|
||||
<motion.div
|
||||
className="hero-cta"
|
||||
initial={{opacity: 0, y: 24}}
|
||||
@@ -81,10 +88,10 @@ export function Hero() {
|
||||
transition={{duration: 0.45, ease: "easeOut", delay: 0.32}}
|
||||
>
|
||||
<Button href="/projects" variant="primary">
|
||||
{strings.hero.ctaProjects[lang]}
|
||||
{s.hero.ctaProjects}
|
||||
</Button>
|
||||
<Button href="/contact" variant="primary">
|
||||
{strings.hero.ctaContact[lang]}
|
||||
{s.hero.ctaContact}
|
||||
</Button>
|
||||
<DownloadResume />
|
||||
|
||||
@@ -95,7 +102,7 @@ export function Hero() {
|
||||
<div className="scroll-mouse">
|
||||
<div className="scroll-wheel"/>
|
||||
</div>
|
||||
<span>{strings.hero.scroll[lang]}</span>
|
||||
<span>{s.hero.scroll}</span>
|
||||
</div>
|
||||
<motion.div
|
||||
className="hero-visual"
|
||||
@@ -106,7 +113,7 @@ export function Hero() {
|
||||
>
|
||||
<motion.img
|
||||
src="/profile-photo.webp"
|
||||
alt={field(lang, profile.name, profile.nameEn)}
|
||||
alt={c.profile.name}
|
||||
className="hero-photo"
|
||||
style={{y}}
|
||||
width="1200"
|
||||
|
||||
@@ -2,17 +2,14 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Link } from "react-router"
|
||||
import { motion } from "motion/react"
|
||||
import { Badge } from "@/components/ui/Badge"
|
||||
import { projects } from "@/data/projects"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
const MotionLink = motion.create(Link)
|
||||
|
||||
export function Projects() {
|
||||
const { lang } = useLanguage()
|
||||
const featured = projects.filter((p) => p.featured).slice(0, 4)
|
||||
const { ui: s, content: c } = useI18n()
|
||||
const featured = c.projects.filter((p) => p.featured).slice(0, 4)
|
||||
|
||||
return (
|
||||
<InView>
|
||||
@@ -27,12 +24,12 @@ export function Projects() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.projects.featured[lang]} tag={strings.projects.featured[lang]} />
|
||||
<SectionHeading title={s.projects.featured} tag={s.projects.featured} />
|
||||
<Link
|
||||
to="/projects"
|
||||
className="section-cta"
|
||||
>
|
||||
{strings.projects.viewAll[lang]} →
|
||||
{s.projects.viewAll} →
|
||||
</Link>
|
||||
<div className="projects-grid">
|
||||
{featured.map((project, i) => (
|
||||
@@ -49,12 +46,12 @@ export function Projects() {
|
||||
>
|
||||
<div className="project-card-content">
|
||||
<div className="project-card-header">
|
||||
<h3>{field(lang, project.title, project.titleEn)}</h3>
|
||||
<h3>{project.title}</h3>
|
||||
<Badge variant="outline">
|
||||
{strings.projects.categories[project.category][lang]}
|
||||
{s.projects.categories[project.category]}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="project-card-summary">{field(lang, project.summary, project.summaryEn)}</p>
|
||||
<p className="project-card-summary">{project.summary}</p>
|
||||
<div className="project-card-techs">
|
||||
{project.technologies.slice(0, 4).map((tech) => (
|
||||
<span key={tech} className="tag">
|
||||
@@ -71,7 +68,7 @@ export function Projects() {
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<span className="project-card-cta">{strings.projects.viewDetails[lang]} →</span>
|
||||
<span className="project-card-cta">{s.projects.viewDetails} →</span>
|
||||
</div>
|
||||
</MotionLink>
|
||||
))}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { useEffect, useState } from "react"
|
||||
import { motion, AnimatePresence, useReducedMotion } from "motion/react"
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
const SCROLL_THRESHOLD = 300
|
||||
|
||||
export function BackToTop() {
|
||||
const [visible, setVisible] = useState(false)
|
||||
const reduceMotion = useReducedMotion()
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
@@ -28,7 +27,7 @@ export function BackToTop() {
|
||||
{visible && (
|
||||
<motion.button
|
||||
className="back-to-top"
|
||||
aria-label={strings.common.backToTop[lang]}
|
||||
aria-label={s.common.backToTop}
|
||||
onClick={scrollToTop}
|
||||
initial={{ opacity: 0, y: 10 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
import { motion } from "motion/react"
|
||||
import { profile } from "@/data/profile"
|
||||
import { useLanguage } from "@/hooks/useLanguage"
|
||||
import { strings } from "@/i18n/strings"
|
||||
import { useI18n } from "@/i18n/provider"
|
||||
import { GithubIcon, LinkedinIcon, MailIcon, TelegramIcon } from "@/components/ui/icons"
|
||||
import type { Language, SocialId } from "@/types"
|
||||
import type { SocialId } from "@/types"
|
||||
|
||||
type ContactEntry = {
|
||||
id: SocialId
|
||||
href: string
|
||||
external: boolean
|
||||
labelKey: 'email' | 'github' | 'linkedin' | 'telegram'
|
||||
sub: Record<Language, string>
|
||||
sub: string
|
||||
icon: React.ReactNode
|
||||
}
|
||||
|
||||
const entries: ContactEntry[] = [
|
||||
{ id: 'email', href: `mailto:${profile.email}`, external: false, labelKey: 'email', sub: { en: profile.email, vi: profile.email }, icon: <MailIcon size={24} /> },
|
||||
{ id: 'github', href: profile.githubUrl, external: true, labelKey: 'github', sub: { en: `@${profile.githubHandle}`, vi: `@${profile.githubHandle}` }, icon: <GithubIcon size={24} /> },
|
||||
{ id: 'linkedin', href: profile.linkedinUrl, external: true, labelKey: 'linkedin', sub: { en: `@${profile.linkedinHandle}`, vi: `@${profile.linkedinHandle}` }, icon: <LinkedinIcon size={24} /> },
|
||||
{ id: 'telegram', href: profile.telegramUrl, external: true, labelKey: 'telegram', sub: { en: `@${profile.telegramHandle}`, vi: `@${profile.telegramHandle}` }, icon: <TelegramIcon size={24} /> },
|
||||
]
|
||||
|
||||
export function ContactLinks() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
|
||||
const entries: ContactEntry[] = [
|
||||
{ id: 'email', href: `mailto:${c.profile.email}`, external: false, labelKey: 'email', sub: c.profile.email, icon: <MailIcon size={24} /> },
|
||||
{ id: 'github', href: c.profile.githubUrl, external: true, labelKey: 'github', sub: `@${c.profile.githubHandle}`, icon: <GithubIcon size={24} /> },
|
||||
{ id: 'linkedin', href: c.profile.linkedinUrl, external: true, labelKey: 'linkedin', sub: `@${c.profile.linkedinHandle}`, icon: <LinkedinIcon size={24} /> },
|
||||
{ id: 'telegram', href: c.profile.telegramUrl, external: true, labelKey: 'telegram', sub: `@${c.profile.telegramHandle}`, icon: <TelegramIcon size={24} /> },
|
||||
]
|
||||
|
||||
return (
|
||||
<div className="contact-links">
|
||||
@@ -42,8 +40,8 @@ export function ContactLinks() {
|
||||
>
|
||||
{entry.icon}
|
||||
<div>
|
||||
<div className="link-label">{strings.contact[entry.labelKey][lang]}</div>
|
||||
<div className="contact-link-sub">{entry.sub[lang]}</div>
|
||||
<div className="link-label">{s.contact[entry.labelKey]}</div>
|
||||
<div className="contact-link-sub">{entry.sub}</div>
|
||||
</div>
|
||||
</motion.a>
|
||||
))}
|
||||
|
||||
@@ -2,8 +2,7 @@ import { AnimatePresence, motion } from 'motion/react'
|
||||
import { useEffect } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { resumeUrlFor, resumeLanguages, resumeLanguageLabels } from '@/data/resume'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
type ResumeDialogProps = {
|
||||
open: boolean
|
||||
@@ -19,7 +18,7 @@ type ResumeDialogProps = {
|
||||
* descendants, which would size the viewport overlay to the bar and clip the panel.
|
||||
*/
|
||||
export function ResumeDialog({ open, close, panelRef, dialogId }: ResumeDialogProps) {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
|
||||
// Enter only, one frame late so the panel is on screen before it takes focus. AnimatePresence
|
||||
// keeps the open=true props on its exiting copy, so an onAnimationComplete handler fires again
|
||||
@@ -47,7 +46,7 @@ export function ResumeDialog({ open, close, panelRef, dialogId }: ResumeDialogPr
|
||||
className="resume-modal"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={strings.common.resumeModalAria[lang]}
|
||||
aria-label={s.common.resumeModalAria}
|
||||
tabIndex={-1}
|
||||
initial={{ opacity: 0, y: 12, scale: 0.98 }}
|
||||
animate={{ opacity: 1, y: 0, scale: 1 }}
|
||||
@@ -56,11 +55,11 @@ export function ResumeDialog({ open, close, panelRef, dialogId }: ResumeDialogPr
|
||||
onClick={event => event.stopPropagation()}
|
||||
>
|
||||
<div className="resume-modal-head">
|
||||
<h3>{strings.common.resumeModalTitle[lang]}</h3>
|
||||
<h3>{s.common.resumeModalTitle}</h3>
|
||||
<button
|
||||
type="button"
|
||||
className="resume-modal-close"
|
||||
aria-label={strings.common.resumeModalClose[lang]}
|
||||
aria-label={s.common.resumeModalClose}
|
||||
onClick={close}
|
||||
>
|
||||
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true">
|
||||
@@ -68,7 +67,7 @@ export function ResumeDialog({ open, close, panelRef, dialogId }: ResumeDialogPr
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<p className="resume-modal-hint">{strings.common.resumeModalHint[lang]}</p>
|
||||
<p className="resume-modal-hint">{s.common.resumeModalHint}</p>
|
||||
<div className="resume-modal-options">
|
||||
{resumeLanguages.map(optionLang => (
|
||||
<a
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { motion } from "motion/react"
|
||||
import { socialLinks } from "@/data/social"
|
||||
import { useLanguage } from "@/hooks/useLanguage"
|
||||
import { strings } from "@/i18n/strings"
|
||||
import { useI18n } from "@/i18n/provider"
|
||||
import { GithubIcon, LinkedinIcon, MailIcon, TelegramIcon } from "@/components/ui/icons"
|
||||
import type { SocialId } from "@/types"
|
||||
|
||||
@@ -13,7 +12,7 @@ const icons: Record<SocialId, React.ReactNode> = {
|
||||
}
|
||||
|
||||
export function SocialLinks() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
|
||||
return (
|
||||
<div className="social-links">
|
||||
@@ -24,7 +23,7 @@ export function SocialLinks() {
|
||||
target={link.external ? "_blank" : undefined}
|
||||
rel={link.external ? "noopener noreferrer" : undefined}
|
||||
className="social-link"
|
||||
aria-label={strings.social.aria[link.id][lang]}
|
||||
aria-label={s.social.aria[link.id]}
|
||||
whileHover={{ scale: 1.1 }}
|
||||
whileTap={{ scale: 0.9 }}
|
||||
>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
[
|
||||
{
|
||||
"id": "open-to-work",
|
||||
"company": "Open to new opportunities",
|
||||
"duration": "Nov 2026 – Present",
|
||||
"variant": "current"
|
||||
},
|
||||
{
|
||||
"id": "relax-gap",
|
||||
"company": "Career break",
|
||||
"duration": "Aug 2026 – Oct 2026",
|
||||
"variant": "gap"
|
||||
},
|
||||
{
|
||||
"id": "lazada-senior-swe",
|
||||
"company": "Lazada Tech Hub Vietnam",
|
||||
"duration": "Jan 2020 – Aug 2026",
|
||||
"location": "Ho Chi Minh City, Vietnam",
|
||||
"logo": "lazada"
|
||||
},
|
||||
{
|
||||
"id": "nexts-founder",
|
||||
"company": "Nexts Limited Company",
|
||||
"duration": "06/2019 – 12/2019",
|
||||
"location": "Ho Chi Minh City, Vietnam"
|
||||
},
|
||||
{
|
||||
"id": "sap-senior-swe",
|
||||
"company": "SAP Lab Vietnam",
|
||||
"duration": "2017 – 12/2019",
|
||||
"location": "Ho Chi Minh City, Vietnam",
|
||||
"logo": "sap"
|
||||
}
|
||||
]
|
||||
+7
-84
@@ -1,85 +1,8 @@
|
||||
import type { ExperienceEntry } from "@/types";
|
||||
// Typed loader for the experience structure document (spec-v4 D2) — see the
|
||||
// note in profile.ts. Titles and responsibilities are localized text in the
|
||||
// content dictionaries; company, duration, location, variant, and logo are
|
||||
// language-neutral structure.
|
||||
import experienceJson from './experience.json';
|
||||
import type { ExperienceStructure } from '../i18n/dict-types';
|
||||
|
||||
export const experiences: ExperienceEntry[] = [
|
||||
{
|
||||
id: "open-to-work",
|
||||
variant: "current",
|
||||
title: "Đang tìm nơi làm việc mới",
|
||||
titleEn: "Seeking a New Place",
|
||||
company: "Open to new opportunities",
|
||||
duration: "Nov 2026 – Present",
|
||||
responsibilities: [
|
||||
"Sẵn sàng cho vai trò Senior Engineer: system architecture, integration platform, full-stack delivery",
|
||||
],
|
||||
responsibilitiesEn: [
|
||||
"Open to Senior Engineer roles: system architecture, integration platforms, full-stack delivery",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "relax-gap",
|
||||
variant: "gap",
|
||||
title: "Nghỉ ngơi",
|
||||
titleEn: "Relax",
|
||||
company: "Career break",
|
||||
duration: "Aug 2026 – Oct 2026",
|
||||
responsibilities: [
|
||||
"Nghỉ có chủ đích giữa hai vai trò — lấy lại nhịp trước khi nhận hệ thống tiếp theo",
|
||||
"Tự thử nghiệm theo nhịp riêng: local LLM với llama.cpp, đọc về Computer Vision",
|
||||
],
|
||||
responsibilitiesEn: [
|
||||
"Intentional break between roles — recovering the rhythm before the next system",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "lazada-senior-swe",
|
||||
title: "Senior Software Engineer",
|
||||
titleEn: "Senior Software Engineer",
|
||||
company: "Lazada Tech Hub Vietnam",
|
||||
logo: "lazada",
|
||||
duration: "Jan 2020 – Aug 2026",
|
||||
location: "Ho Chi Minh City, Vietnam",
|
||||
responsibilities: [
|
||||
"System ownership và architecture design cho logistics integration systems",
|
||||
"Developed IoT-DWS integration solution deployed across 16 sortations",
|
||||
"Led system maintenance and modernization for production environments",
|
||||
"Applied Computer Vision and ML to solve real-world operational problems",
|
||||
"Scrum Master responsibilities — team achieved Scrum Level L3",
|
||||
],
|
||||
responsibilitiesEn: [
|
||||
"System ownership and architecture design for logistics integration systems",
|
||||
"Developed IoT-DWS integration solution deployed across 16 sortations",
|
||||
"Led system maintenance and modernization for production environments",
|
||||
"Applied Computer Vision and ML to solve real-world operational problems",
|
||||
"Scrum Master responsibilities — team achieved Scrum Level L3",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "nexts-founder",
|
||||
title: "Người sáng lập",
|
||||
titleEn: "CTO & Founder",
|
||||
company: "Nexts Limited Company",
|
||||
duration: "06/2019 – 12/2019",
|
||||
location: "Ho Chi Minh City, Vietnam",
|
||||
responsibilities: [
|
||||
"Phát triển giải pháp cho xe tự hành, thu thập dữ liệu thời gian thực từ cảm biến và hệ thống onboard: LiDAR, camera, GPS, CAN bus.",
|
||||
],
|
||||
responsibilitiesEn: [
|
||||
"Developed a solution for autonomous vehicles to collect real-time data from onboard sensors and systems, including LiDAR, cameras, GPS, and CAN bus.",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "sap-senior-swe",
|
||||
title: "Senior Software Engineer",
|
||||
titleEn: "Senior Software Engineer",
|
||||
logo: "sap",
|
||||
company: "SAP Lab Vietnam",
|
||||
duration: "2017 – 12/2019",
|
||||
location: "Ho Chi Minh City, Vietnam",
|
||||
responsibilities: [
|
||||
"Team leader quản lý sản phẩm B1 Integration",
|
||||
],
|
||||
responsibilitiesEn: [
|
||||
"Team leader managing the B1 Integration product",
|
||||
],
|
||||
}
|
||||
];
|
||||
export const experiences = experienceJson as ExperienceStructure[];
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"firstName": "Dong",
|
||||
"lastName": "Nguyen",
|
||||
"email": "nguyendong_bkdn@yahoo.com",
|
||||
"githubUrl": "https://github.com/dong-nz",
|
||||
"linkedinUrl": "https://www.linkedin.com/in/dong-nz",
|
||||
"githubHandle": "dong-nz",
|
||||
"linkedinHandle": "dong-nz",
|
||||
"telegramUrl": "https://t.me/dongdn",
|
||||
"telegramHandle": "dongdn",
|
||||
"currentInterests": [
|
||||
"AI in logistics",
|
||||
"Digital twins",
|
||||
"Simulation",
|
||||
"LLM",
|
||||
"Computer Vision",
|
||||
"High-performance systems"
|
||||
],
|
||||
"roles": [
|
||||
"System Architect",
|
||||
"Full-Stack Developer",
|
||||
"System Engineer",
|
||||
"AI/ML Application Engineer"
|
||||
],
|
||||
"philosophy": [
|
||||
{
|
||||
"id": "build-for-the-real-problem",
|
||||
"keywords": [
|
||||
"Problem-first",
|
||||
"Business value",
|
||||
"Measurement"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "think-in-systems",
|
||||
"keywords": [
|
||||
"Architecture",
|
||||
"Integration",
|
||||
"Scalability",
|
||||
"Reliability"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "measure-impact",
|
||||
"keywords": [
|
||||
"Performance",
|
||||
"Reliability",
|
||||
"Cost",
|
||||
"Efficiency"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "keep-learning",
|
||||
"keywords": [
|
||||
"AI/ML",
|
||||
"Computer Vision",
|
||||
"LLM",
|
||||
"Distributed systems"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "business-domain-knowledge-is-a-key-of-success",
|
||||
"keywords": [
|
||||
"Biz knowledge",
|
||||
"Business value"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+10
-83
@@ -1,84 +1,11 @@
|
||||
import type {Profile} from "@/types";
|
||||
// Typed loader for the profile structure document (spec-v4 D2). Localized text
|
||||
// lives in src/i18n/locales and is joined in src/i18n/index.ts; this module
|
||||
// exports the language-neutral structure under today's name, for the i18n
|
||||
// loader and for scripts/generate-sitemap.ts.
|
||||
// JSON imports widen string literals to `string`, so id membership is guarded
|
||||
// by the text dictionaries (tsc) and by src/i18n/validate.ts (cross-document
|
||||
// coverage) — the cast still fails on gross shape errors.
|
||||
import profileJson from './profile.json';
|
||||
import type { ProfileStructure } from '../i18n/dict-types';
|
||||
|
||||
export const profile: Profile = {
|
||||
firstName: "Dong",
|
||||
lastName: "Nguyen",
|
||||
name: "Nguyễn Đông",
|
||||
nameEn: "Dong Nguyen",
|
||||
title: "Senior Software Engineer",
|
||||
titleEn: "Senior Software Engineer",
|
||||
tagline:
|
||||
"Phần lớn thời gian tôi là Backend Software Engineer. Muốn tôi là Full Stack Developer, <span class='ok-possible name-highlight'>yes</span>, có thể.",
|
||||
taglineEn:
|
||||
"Building scalable software systems, intelligent logistics solutions, and practical AI applications.",
|
||||
bio: "Senior Software Engineer với kinh nghiệm xây dựng hệ thống phân tán, logistics technology, và ứng dụng AI/ML vào bài toán thực tế. Tập trung vào system architecture, integration, và production-grade solutions.",
|
||||
bioEn: "Senior Software Engineer with experience building distributed systems, logistics technology, and AI/ML applications for real-world problems. Focused on system architecture, integration, and production-grade solutions.",
|
||||
email: "nguyendong_bkdn@yahoo.com",
|
||||
githubUrl: "https://github.com/dong-nz",
|
||||
linkedinUrl: "https://www.linkedin.com/in/dong-nz",
|
||||
githubHandle: "dong-nz",
|
||||
linkedinHandle: "dong-nz",
|
||||
telegramUrl: "https://t.me/dongdn",
|
||||
telegramHandle: "dongdn",
|
||||
currentInterests: [
|
||||
"AI in logistics",
|
||||
"Digital twins",
|
||||
"Simulation",
|
||||
"LLM",
|
||||
"Computer Vision",
|
||||
"High-performance systems",
|
||||
],
|
||||
roles: [
|
||||
"System Architect",
|
||||
"Full-Stack Developer",
|
||||
"System Engineer",
|
||||
"AI/ML Application Engineer",
|
||||
],
|
||||
philosophy: [
|
||||
{
|
||||
title: "Giải pháp được xây dựng dựa trên vấn đề thực tế",
|
||||
titleEn: "Build for the real problem",
|
||||
description:
|
||||
"Không bắt đầu bằng technology. Bắt đầu bằng problem.",
|
||||
descriptionEn:
|
||||
"Don't start with technology. Start with the problem.",
|
||||
keywords: ["Problem-first", "Business value", "Measurement"],
|
||||
},
|
||||
{
|
||||
title: "Think in systems",
|
||||
titleEn: "Think in systems",
|
||||
description:
|
||||
"Quan tâm đến kiến trúc tổng thể, không chỉ từng component.",
|
||||
descriptionEn:
|
||||
"Care about the overall architecture, not just individual components.",
|
||||
keywords: ["Architecture", "Integration", "Scalability", "Reliability"],
|
||||
},
|
||||
{
|
||||
title: "Measure impact",
|
||||
titleEn: "Measure impact",
|
||||
description:
|
||||
"Technical implementation phải gắn với measurable outcome.",
|
||||
descriptionEn:
|
||||
"Technical implementation must be tied to measurable outcomes.",
|
||||
keywords: ["Performance", "Reliability", "Cost", "Efficiency"],
|
||||
},
|
||||
{
|
||||
title: "Keep learning",
|
||||
titleEn: "Keep learning",
|
||||
description:
|
||||
"Continuous exploration of new technologies and approaches.",
|
||||
descriptionEn:
|
||||
"Continuous exploration of new technologies and approaches.",
|
||||
keywords: ["AI/ML", "Computer Vision", "LLM", "Distributed systems"],
|
||||
},
|
||||
{
|
||||
title: "Kiến thức nghiệp vụ là chìa khóa thành công",
|
||||
titleEn: "Business domain knowledge is a key of success",
|
||||
description:
|
||||
"Hiểu sâu về business domain giúp hiểu rõ vấn đề và đưa ra giải pháp phù hợp.",
|
||||
descriptionEn:
|
||||
"Don't start with technology. Start with the problem.",
|
||||
keywords: ["Biz knowledge", "Business value"],
|
||||
},
|
||||
],
|
||||
};
|
||||
export const profile = profileJson as ProfileStructure;
|
||||
@@ -0,0 +1,131 @@
|
||||
[
|
||||
{
|
||||
"id": "iot-dws-integration",
|
||||
"category": "logistics",
|
||||
"role": "Senior Software Engineer — System Owner",
|
||||
"technologies": [
|
||||
"Java",
|
||||
"HTTP",
|
||||
"HMAC",
|
||||
"RocketMQ",
|
||||
"DWS"
|
||||
],
|
||||
"metrics": [
|
||||
"16 sortations deployed"
|
||||
],
|
||||
"featured": true,
|
||||
"sections": [
|
||||
{
|
||||
"id": "context",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "problem",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "solution",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "architecture",
|
||||
"type": "diagram"
|
||||
},
|
||||
{
|
||||
"id": "challenges",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "result",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "awb-detection",
|
||||
"category": "computer-vision",
|
||||
"role": "Senior Software Engineer — ML Engineering",
|
||||
"technologies": [
|
||||
"Python",
|
||||
"OpenCV",
|
||||
"YOLO",
|
||||
"ONNX",
|
||||
"OCR"
|
||||
],
|
||||
"metrics": [
|
||||
"70,000 images/month processed"
|
||||
],
|
||||
"featured": true,
|
||||
"sections": [
|
||||
{
|
||||
"id": "context",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "problem",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "pipeline",
|
||||
"type": "diagram"
|
||||
},
|
||||
{
|
||||
"id": "challenges",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "result",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "facility-management",
|
||||
"category": "software-engineering",
|
||||
"role": "Senior Software Engineer — Platform Design",
|
||||
"technologies": [
|
||||
"Go",
|
||||
"TypeScript",
|
||||
"Docker",
|
||||
"Event-driven"
|
||||
],
|
||||
"featured": true,
|
||||
"sections": [
|
||||
{
|
||||
"id": "vision",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "architecture",
|
||||
"type": "diagram"
|
||||
},
|
||||
{
|
||||
"id": "result",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "local-llm-experiments",
|
||||
"category": "experiment",
|
||||
"role": "Engineering Experiment",
|
||||
"technologies": [
|
||||
"llama.cpp",
|
||||
"Qwen",
|
||||
"MoE",
|
||||
"Python",
|
||||
"CUDA"
|
||||
],
|
||||
"featured": true,
|
||||
"sections": [
|
||||
{
|
||||
"id": "exploration",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "learnings",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
+8
-225
@@ -1,226 +1,9 @@
|
||||
import type { ProjectDetail } from "@/types";
|
||||
// Typed loader for the projects structure document (spec-v4 D2) — see the note
|
||||
// in profile.ts. Titles, summaries, and section prose are localized text in the
|
||||
// content dictionaries; ids, categories, roles, technologies, metrics,
|
||||
// featured, and section {id, type} are language-neutral structure. Project ids
|
||||
// already appear in URLs and the sitemap, so they are the stable join keys.
|
||||
import projectsJson from './projects.json';
|
||||
import type { ProjectStructure } from '../i18n/dict-types';
|
||||
|
||||
export const projects: ProjectDetail[] = [
|
||||
{
|
||||
id: "iot-dws-integration",
|
||||
title: "Tích hợp hệ thống IoT-DWS",
|
||||
titleEn: "IoT-DWS Integration System",
|
||||
summary:
|
||||
"Thiết kế và triển khai hệ thống integration giữa IoT devices và DWS (Dimensioning Weighing Scanning) machines cho 16 sortations.",
|
||||
summaryEn:
|
||||
"Designed and deployed an integration system between IoT devices and DWS (Dimensioning Weighing Scanning) machines across 16 sortations.",
|
||||
category: "logistics",
|
||||
role: "Senior Software Engineer — System Owner",
|
||||
technologies: ["Java", "HTTP", "HMAC", "RocketMQ", "DWS"],
|
||||
metrics: ["16 sortations deployed"],
|
||||
featured: true,
|
||||
sections: [
|
||||
{
|
||||
id: "context",
|
||||
title: "Context",
|
||||
titleEn: "Context",
|
||||
content:
|
||||
"Tiếp nhận và nhanh chóng làm chủ một hệ thống IoT-DWS sau khi thành viên phụ trách trước đó rời project. Cần hiểu nhanh architecture hiện tại và tiếp tục phát triển integration solution.",
|
||||
contentEn:
|
||||
"Took over and rapidly mastered an IoT-DWS system after the previous responsible team member left the project. Needed to quickly understand the current architecture and continue developing the integration solution.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "problem",
|
||||
title: "Problem",
|
||||
titleEn: "Problem",
|
||||
content:
|
||||
"Cần integration giữa các IoT devices (sensors, cameras) và DWS machines — hệ thống vật lý phức tạp với nhiều protocol khác nhau (HMI, FTP, HTTP).",
|
||||
contentEn:
|
||||
"Needed integration between IoT devices (sensors, cameras) and DWS machines — a complex physical system with multiple different protocols (HMI, FTP, HTTP).",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "solution",
|
||||
title: "Solution",
|
||||
titleEn: "Solution",
|
||||
content:
|
||||
"Thiết kế HTTP-based integration engine với HMAC security, RocketMQ messaging, và protocol adapters cho HMI/FTP/HTTP.",
|
||||
contentEn:
|
||||
"Designed an HTTP-based integration engine with HMAC security, RocketMQ messaging, and protocol adapters for HMI/FTP/HTTP.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "architecture",
|
||||
title: "Architecture",
|
||||
titleEn: "Architecture",
|
||||
content:
|
||||
"```text\nIoT Devices\n ↓\nProtocol Adapters (HMI/FTP/HTTP)\n ↓\nHTTP Engine + HMAC Security\n ↓\nRocketMQ\n ↓\nDWS Machines\n```",
|
||||
contentEn:
|
||||
"```text\nIoT Devices\n ↓\nProtocol Adapters (HMI/FTP/HTTP)\n ↓\nHTTP Engine + HMAC Security\n ↓\nRocketMQ\n ↓\nDWS Machines\n```",
|
||||
type: "diagram",
|
||||
},
|
||||
{
|
||||
id: "challenges",
|
||||
title: "Challenges",
|
||||
titleEn: "Challenges",
|
||||
content:
|
||||
"Nhiều protocol khác nhau, security requirements (HMAC signature), real-time data processing, production reliability.",
|
||||
contentEn:
|
||||
"Multiple different protocols, security requirements (HMAC signature), real-time data processing, production reliability.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "result",
|
||||
title: "Result",
|
||||
titleEn: "Result",
|
||||
content:
|
||||
"Giải pháp được triển khai cho 16 sortations, ổn định trong production, hỗ trợ 3 protocols (HMI, FTP, HTTP).",
|
||||
contentEn:
|
||||
"Solution deployed across 16 sortations, stable in production, supporting 3 protocols (HMI, FTP, HTTP).",
|
||||
type: "text",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "awb-detection",
|
||||
title: "AWB Detection / Computer Vision",
|
||||
titleEn: "AWB Detection / Computer Vision",
|
||||
summary:
|
||||
"Ứng dụng Computer Vision và Machine Learning để tự động phát hiện và OCR shipping label từ hình ảnh camera trên sortation.",
|
||||
summaryEn:
|
||||
"Applied Computer Vision and Machine Learning to automatically detect and OCR shipping labels from camera images on sortation lines.",
|
||||
category: "computer-vision",
|
||||
role: "Senior Software Engineer — ML Engineering",
|
||||
technologies: ["Python", "OpenCV", "YOLO", "ONNX", "OCR"],
|
||||
metrics: ["70,000 images/month processed"],
|
||||
featured: true,
|
||||
sections: [
|
||||
{
|
||||
id: "context",
|
||||
title: "Context",
|
||||
titleEn: "Context",
|
||||
content:
|
||||
"Sortation machines chụp ảnh packages khi di chuyển trên băng chuyền. Cần tự động đọc AWB (Air Waybill) từ ảnh để tracking và sorting.",
|
||||
contentEn:
|
||||
"Sortation machines capture images of packages as they move on conveyor belts. Need to automatically read AWB (Air Waybill) from images for tracking and sorting.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "problem",
|
||||
title: "Problem",
|
||||
titleEn: "Problem",
|
||||
content:
|
||||
"White label trên white package — traditional CV methods không đủ robust. Cần ML-based detection.",
|
||||
contentEn:
|
||||
"White label on white package — traditional CV methods are not robust enough. Needed ML-based detection.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "pipeline",
|
||||
title: "Pipeline",
|
||||
titleEn: "Pipeline",
|
||||
content:
|
||||
"```text\nImage\n ↓\nAWB/Label Detection (YOLO)\n ↓\nBounding Box / OBB\n ↓\nRotation Correction\n ↓\nCrop\n ↓\nOCR\n ↓\nText Extraction\n```",
|
||||
contentEn:
|
||||
"```text\nImage\n ↓\nAWB/Label Detection (YOLO)\n ↓\nBounding Box / OBB\n ↓\nRotation Correction\n ↓\nCrop\n ↓\nOCR\n ↓\nText Extraction\n```",
|
||||
type: "diagram",
|
||||
},
|
||||
{
|
||||
id: "challenges",
|
||||
title: "Challenges",
|
||||
titleEn: "Challenges",
|
||||
content:
|
||||
"White label on white package, rotated labels, varying lighting conditions, real-time inference requirements.",
|
||||
contentEn:
|
||||
"White label on white package, rotated labels, varying lighting conditions, real-time inference requirements.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "result",
|
||||
title: "Result",
|
||||
titleEn: "Result",
|
||||
content:
|
||||
"Model fine-tuned cho AWB detection, xử lý 70,000 images/month. Presentation tại Tech Talk workshop.",
|
||||
contentEn:
|
||||
"Model fine-tuned for AWB detection, processing 70,000 images/month. Presented at Tech Talk workshop.",
|
||||
type: "text",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "facility-management",
|
||||
title: "Facility Management Platform",
|
||||
titleEn: "Facility Management Platform",
|
||||
summary:
|
||||
"Xây dựng nền tảng digital twin cho logistics facilities — mô hình hóa facility, theo dõi real-time, và recommendation system.",
|
||||
summaryEn:
|
||||
"Built a digital twin platform for logistics facilities — facility modeling, real-time monitoring, and recommendation system.",
|
||||
category: "software-engineering",
|
||||
role: "Senior Software Engineer — Platform Design",
|
||||
technologies: ["Go", "TypeScript", "Docker", "Event-driven"],
|
||||
featured: true,
|
||||
sections: [
|
||||
{
|
||||
id: "vision",
|
||||
title: "Vision",
|
||||
titleEn: "Vision",
|
||||
content:
|
||||
"Chuyển đổi từ manual operations sang Operation Intelligence Platform — thu thập data, monitor, analyze, recommend, decide.",
|
||||
contentEn:
|
||||
"Transition from manual operations to an Operation Intelligence Platform — collect data, monitor, analyze, recommend, decide.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "architecture",
|
||||
title: "Architecture",
|
||||
titleEn: "Architecture",
|
||||
content:
|
||||
"```text\nPhysical Facility\n ↓\nData Collection\n ↓\nFacility Model\n ↓\nDigital Twin\n ↓\nSimulation\n ↓\nAnalytics\n ↓\nRecommendation\n ↓\nOperation Decision\n```",
|
||||
contentEn:
|
||||
"```text\nPhysical Facility\n ↓\nData Collection\n ↓\nFacility Model\n ↓\nDigital Twin\n ↓\nSimulation\n ↓\nAnalytics\n ↓\nRecommendation\n ↓\nOperation Decision\n```",
|
||||
type: "diagram",
|
||||
},
|
||||
{
|
||||
id: "result",
|
||||
title: "Result",
|
||||
titleEn: "Result",
|
||||
content:
|
||||
"Platform hỗ trợ facility modeling, real-time visibility, và recommendation cho capacity planning.",
|
||||
contentEn:
|
||||
"Platform supports facility modeling, real-time visibility, and recommendations for capacity planning.",
|
||||
type: "text",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "local-llm-experiments",
|
||||
title: "Local LLM Experiments",
|
||||
titleEn: "Local LLM Experiments",
|
||||
summary:
|
||||
"Technical exploration về running local MoE LLMs với llama.cpp — GPU offloading, VRAM optimization, performance tracing.",
|
||||
summaryEn:
|
||||
"Technical exploration of running local MoE LLMs with llama.cpp — GPU offloading, VRAM optimization, performance tracing.",
|
||||
category: "experiment",
|
||||
role: "Engineering Experiment",
|
||||
technologies: ["llama.cpp", "Qwen", "MoE", "Python", "CUDA"],
|
||||
featured: true,
|
||||
sections: [
|
||||
{
|
||||
id: "exploration",
|
||||
title: "Exploration",
|
||||
titleEn: "Exploration",
|
||||
content:
|
||||
"Technical exploration về MoE (Mixture of Experts), expert routing, GPU offloading, VRAM optimization, prefill/decode pipeline.",
|
||||
contentEn:
|
||||
"Technical exploration of MoE (Mixture of Experts), expert routing, GPU offloading, VRAM optimization, prefill/decode pipeline.",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
id: "learnings",
|
||||
title: "Lessons Learned",
|
||||
titleEn: "Lessons Learned",
|
||||
content:
|
||||
"Understand the system → Measure → Analyze → Optimize. Không phải khoe hardware — mà thể hiện engineering approach.",
|
||||
contentEn:
|
||||
"Understand the system → Measure → Analyze → Optimize. Not about showing off hardware — but demonstrating engineering approach.",
|
||||
type: "text",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
export const projects = projectsJson as ProjectStructure[];
|
||||
@@ -0,0 +1,64 @@
|
||||
[
|
||||
{
|
||||
"id": "software-engineering",
|
||||
"skills": [
|
||||
"Java",
|
||||
"Go",
|
||||
"TypeScript",
|
||||
"Distributed Systems",
|
||||
"REST APIs",
|
||||
"Microservices"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "system-architecture",
|
||||
"skills": [
|
||||
"System Design",
|
||||
"Integration Architecture",
|
||||
"Event-driven Architecture",
|
||||
"Message Queues",
|
||||
"API Design"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "logistics-technology",
|
||||
"skills": [
|
||||
"Sortation",
|
||||
"Warehouse / Facility Operations",
|
||||
"Package Flow",
|
||||
"Operational Intelligence",
|
||||
"Facility Modeling"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "ai-ml",
|
||||
"skills": [
|
||||
"Computer Vision",
|
||||
"Object Detection",
|
||||
"OCR",
|
||||
"Model Deployment",
|
||||
"LLM",
|
||||
"AI-assisted Engineering"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "infrastructure",
|
||||
"skills": [
|
||||
"Docker",
|
||||
"Linux",
|
||||
"CI/CD",
|
||||
"Networking",
|
||||
"Middleware"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "engineering-practices",
|
||||
"skills": [
|
||||
"Agile / Scrum",
|
||||
"Technical Documentation",
|
||||
"System Maintenance",
|
||||
"Performance Optimization",
|
||||
"Technical Research"
|
||||
]
|
||||
}
|
||||
]
|
||||
+6
-65
@@ -1,66 +1,7 @@
|
||||
import type { SkillGroup } from "@/types";
|
||||
// Typed loader for the skills structure document (spec-v4 D2) — see the note
|
||||
// in profile.ts. Group titles are localized text and live in the content
|
||||
// dictionaries; only language-neutral ids and skill terms stay here.
|
||||
import skillsJson from './skills.json';
|
||||
import type { SkillGroupStructure } from '../i18n/dict-types';
|
||||
|
||||
export const skillGroups: SkillGroup[] = [
|
||||
{
|
||||
title: "Software Engineering",
|
||||
titleEn: "Software Engineering",
|
||||
skills: [
|
||||
"Java",
|
||||
"Go",
|
||||
"TypeScript",
|
||||
"Distributed Systems",
|
||||
"REST APIs",
|
||||
"Microservices",
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "System Architecture",
|
||||
titleEn: "System Architecture",
|
||||
skills: [
|
||||
"System Design",
|
||||
"Integration Architecture",
|
||||
"Event-driven Architecture",
|
||||
"Message Queues",
|
||||
"API Design",
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Logistics Technology",
|
||||
titleEn: "Logistics Technology",
|
||||
skills: [
|
||||
"Sortation",
|
||||
"Warehouse / Facility Operations",
|
||||
"Package Flow",
|
||||
"Operational Intelligence",
|
||||
"Facility Modeling",
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "AI / ML",
|
||||
titleEn: "AI / ML",
|
||||
skills: [
|
||||
"Computer Vision",
|
||||
"Object Detection",
|
||||
"OCR",
|
||||
"Model Deployment",
|
||||
"LLM",
|
||||
"AI-assisted Engineering",
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Infrastructure",
|
||||
titleEn: "Infrastructure",
|
||||
skills: ["Docker", "Linux", "CI/CD", "Networking", "Middleware"],
|
||||
},
|
||||
{
|
||||
title: "Engineering Practices",
|
||||
titleEn: "Engineering Practices",
|
||||
skills: [
|
||||
"Agile / Scrum",
|
||||
"Technical Documentation",
|
||||
"System Maintenance",
|
||||
"Performance Optimization",
|
||||
"Technical Research",
|
||||
],
|
||||
},
|
||||
];
|
||||
export const skillGroups = skillsJson as SkillGroupStructure[];
|
||||
@@ -0,0 +1,109 @@
|
||||
// Document types for the content and UI JSON (spec-v4 §3.2–§3.3).
|
||||
// Structure documents are language-neutral; text documents are per language.
|
||||
// Authoring invariants that JSON cannot carry as comments live here and in the
|
||||
// loaders.
|
||||
import type {
|
||||
ExperienceId,
|
||||
PhilosophyId,
|
||||
ProjectCategory,
|
||||
ProjectId,
|
||||
SkillGroupId,
|
||||
} from '../types/index';
|
||||
import uiViJson from './locales/vi/ui.json';
|
||||
|
||||
// --- structure (src/data/*.json) ---
|
||||
|
||||
export type ProjectSectionStructure = {
|
||||
id: string;
|
||||
type: 'text' | 'diagram' | 'metrics' | 'code';
|
||||
};
|
||||
|
||||
export type ProjectStructure = {
|
||||
id: ProjectId;
|
||||
category: ProjectCategory;
|
||||
role: string;
|
||||
technologies: string[];
|
||||
metrics?: string[];
|
||||
featured: boolean;
|
||||
sections: ProjectSectionStructure[];
|
||||
};
|
||||
|
||||
export type ExperienceStructure = {
|
||||
id: ExperienceId;
|
||||
company: string;
|
||||
duration: string;
|
||||
location?: string;
|
||||
variant?: 'current' | 'gap';
|
||||
logo?: string;
|
||||
};
|
||||
|
||||
export type SkillGroupStructure = { id: SkillGroupId; skills: string[] };
|
||||
|
||||
export type ProfileStructure = {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email: string;
|
||||
githubUrl: string;
|
||||
linkedinUrl: string;
|
||||
githubHandle: string;
|
||||
linkedinHandle: string;
|
||||
telegramUrl: string;
|
||||
telegramHandle: string;
|
||||
currentInterests: string[];
|
||||
roles: string[];
|
||||
// The display name is localized (D6) and therefore lives in the text
|
||||
// documents, never here; only the language-neutral name parts stay.
|
||||
philosophy: Array<{ id: PhilosophyId; keywords: string[] }>;
|
||||
};
|
||||
|
||||
// --- text (src/i18n/locales/{vi,en}/content.json) ---
|
||||
|
||||
// Plain-text segments; markup is a rendering concern (D9), never content.
|
||||
export type TaglineSegment = { text: string; emphasis?: boolean };
|
||||
|
||||
export type SectionText = { title: string; content: string };
|
||||
|
||||
// Section keys are validated against each project's structure array by the
|
||||
// validator (§3.6) — section ids collide across projects, so there is no
|
||||
// global SectionId union (§3.1).
|
||||
export type ProjectText = {
|
||||
title: string;
|
||||
summary: string;
|
||||
sections: Record<string, SectionText>;
|
||||
};
|
||||
|
||||
export type ExperienceText = { title: string; responsibilities: string[] };
|
||||
|
||||
export type SkillGroupText = { title: string };
|
||||
|
||||
export type ProfileText = {
|
||||
name: string;
|
||||
title: string;
|
||||
bio: string;
|
||||
tagline: TaglineSegment[];
|
||||
philosophy: Record<PhilosophyId, { title: string; description: string }>;
|
||||
};
|
||||
|
||||
export type ContentVi = {
|
||||
profile: ProfileText;
|
||||
skills: Record<SkillGroupId, SkillGroupText>;
|
||||
experience: Record<ExperienceId, ExperienceText>;
|
||||
projects: Record<ProjectId, ProjectText>;
|
||||
};
|
||||
|
||||
// Defined here — PartialDeep is NOT a TypeScript builtin.
|
||||
// Objects: every key optional + recursed. Arrays: atomic (whole-array
|
||||
// fallback, never per-item).
|
||||
type PartialDeep<T> = T extends readonly unknown[]
|
||||
? T
|
||||
: T extends object
|
||||
? { [K in keyof T]?: PartialDeep<T[K]> }
|
||||
: T;
|
||||
|
||||
export type ContentEn = { [K in keyof ContentVi]?: PartialDeep<ContentVi[K]> };
|
||||
|
||||
// --- UI (src/i18n/locales/{vi,en}/ui.json) ---
|
||||
|
||||
// Derived from the complete Vietnamese tree; the en import is checked against
|
||||
// this type in index.ts — both files are complete by construction (§3.3).
|
||||
export type UIDict = typeof uiViJson;
|
||||
@@ -1,14 +0,0 @@
|
||||
import type { Language } from '@/types'
|
||||
|
||||
/**
|
||||
* Select one value from a bilingual pair. Plain function, not a hook: `lang` is
|
||||
* read once at component top level with `useLanguage()`, so `field` is safe
|
||||
* inside `.map()` callbacks.
|
||||
*
|
||||
* Convention: `value` is the Vietnamese value, `valueEn` the English one. When a
|
||||
* pair has no English variant yet, `valueEn` is undefined and both languages
|
||||
* render `value`.
|
||||
*/
|
||||
export function field<T>(lang: Language, value: T, valueEn: T | undefined): T {
|
||||
return lang === 'vi' ? value : (valueEn ?? value)
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
// The i18n loader (spec-v4 §3.4): load + validate + join ONCE at module load.
|
||||
// Components and scripts consume the exported UI / CONTENT and never join
|
||||
// structure and text by id themselves.
|
||||
import { experiences } from '../data/experience';
|
||||
import { profile } from '../data/profile';
|
||||
import { projects } from '../data/projects';
|
||||
import { skillGroups } from '../data/skills';
|
||||
import contentEnJson from './locales/en/content.json';
|
||||
import contentViJson from './locales/vi/content.json';
|
||||
import uiEnJson from './locales/en/ui.json';
|
||||
import uiViJson from './locales/vi/ui.json';
|
||||
import type {
|
||||
ContentEn,
|
||||
ContentVi,
|
||||
ExperienceStructure,
|
||||
ExperienceText,
|
||||
ProfileStructure,
|
||||
ProfileText,
|
||||
ProjectSectionStructure,
|
||||
ProjectStructure,
|
||||
SectionText,
|
||||
SkillGroupStructure,
|
||||
SkillGroupText,
|
||||
UIDict,
|
||||
} from './dict-types';
|
||||
import type { Language, PhilosophyId } from '../types/index';
|
||||
import { validateContent } from './validate';
|
||||
|
||||
const uiVi: UIDict = uiViJson;
|
||||
// tsc enforces en completeness against the derived Vietnamese tree (§3.3).
|
||||
const uiEn: UIDict = uiEnJson;
|
||||
|
||||
const contentVi: ContentVi = contentViJson;
|
||||
const contentEn: ContentEn = contentEnJson;
|
||||
|
||||
const structures = {
|
||||
profile,
|
||||
skills: skillGroups,
|
||||
experience: experiences,
|
||||
projects,
|
||||
};
|
||||
|
||||
// Cross-document rules run at module load: a malformed content document fails
|
||||
// the build here, in CI, and in the browser — never silently half-renders.
|
||||
validateContent(structures, contentVi, contentEn);
|
||||
|
||||
// Missing en fields fall back to vi per field; arrays are atomic — a whole
|
||||
// array is replaced or inherited, never merged item by item (§3.2).
|
||||
function deepMerge<T>(base: T, patch: unknown): T {
|
||||
if (patch === undefined) return base;
|
||||
if (
|
||||
Array.isArray(base) ||
|
||||
Array.isArray(patch) ||
|
||||
typeof base !== 'object' ||
|
||||
base === null ||
|
||||
typeof patch !== 'object' ||
|
||||
patch === null
|
||||
) {
|
||||
return patch as T;
|
||||
}
|
||||
const out: Record<string, unknown> = { ...(base as Record<string, unknown>) };
|
||||
for (const [key, value] of Object.entries(patch as Record<string, unknown>)) {
|
||||
out[key] = deepMerge(out[key], value);
|
||||
}
|
||||
return out as T;
|
||||
}
|
||||
|
||||
const mergedEn: ContentVi = deepMerge(contentVi, contentEn);
|
||||
|
||||
export const UI: Record<Language, UIDict> = { vi: uiVi, en: uiEn };
|
||||
|
||||
// Resolved records: structure joined with text. These are the shapes every
|
||||
// component consumes.
|
||||
export type ResolvedProjectSection = ProjectSectionStructure & SectionText;
|
||||
export type ResolvedProject = Omit<ProjectStructure, 'sections'> & {
|
||||
title: string;
|
||||
summary: string;
|
||||
sections: ResolvedProjectSection[];
|
||||
};
|
||||
export type ResolvedExperienceEntry = ExperienceStructure & ExperienceText;
|
||||
export type ResolvedSkillGroup = SkillGroupStructure & SkillGroupText;
|
||||
// Structure carries philosophy as an ordered {id, keywords} array, text as a
|
||||
// Record keyed by id — the join merges them back into one ordered array.
|
||||
export type ResolvedPhilosophyPoint = {
|
||||
id: PhilosophyId;
|
||||
keywords: string[];
|
||||
title: string;
|
||||
description: string;
|
||||
};
|
||||
export type ResolvedProfile = Omit<ProfileStructure, 'philosophy'> &
|
||||
Omit<ProfileText, 'philosophy'> & { philosophy: ResolvedPhilosophyPoint[] };
|
||||
|
||||
export type ResolvedContent = {
|
||||
profile: ResolvedProfile;
|
||||
skillGroups: ResolvedSkillGroup[];
|
||||
experiences: ResolvedExperienceEntry[];
|
||||
projects: ResolvedProject[];
|
||||
};
|
||||
|
||||
function joinContent(text: ContentVi): ResolvedContent {
|
||||
return {
|
||||
profile: {
|
||||
...structures.profile,
|
||||
...text.profile,
|
||||
philosophy: structures.profile.philosophy.map((point) => ({
|
||||
...point,
|
||||
...text.profile.philosophy[point.id],
|
||||
})),
|
||||
},
|
||||
skillGroups: structures.skills.map((group) => ({
|
||||
...group,
|
||||
...text.skills[group.id],
|
||||
})),
|
||||
experiences: structures.experience.map((entry) => ({
|
||||
...entry,
|
||||
...text.experience[entry.id],
|
||||
})),
|
||||
projects: structures.projects.map((project) => {
|
||||
const text_ = text.projects[project.id];
|
||||
return {
|
||||
...project,
|
||||
title: text_.title,
|
||||
summary: text_.summary,
|
||||
sections: project.sections.map((section) => ({
|
||||
...section,
|
||||
...text_.sections[section.id],
|
||||
})),
|
||||
};
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
export const CONTENT: Record<Language, ResolvedContent> = {
|
||||
vi: joinContent(contentVi),
|
||||
en: joinContent(mergedEn),
|
||||
};
|
||||
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"profile": {
|
||||
"name": "Dong Nguyen",
|
||||
"bio": "Senior Software Engineer with experience building distributed systems, logistics technology, and AI/ML applications for real-world problems. Focused on system architecture, integration, and production-grade solutions.",
|
||||
"tagline": [
|
||||
{
|
||||
"text": "Building scalable software systems, intelligent logistics solutions, and practical AI applications."
|
||||
}
|
||||
],
|
||||
"philosophy": {
|
||||
"build-for-the-real-problem": {
|
||||
"title": "Build for the real problem",
|
||||
"description": "Don't start with technology. Start with the problem."
|
||||
},
|
||||
"think-in-systems": {
|
||||
"description": "Care about the overall architecture, not just individual components."
|
||||
},
|
||||
"measure-impact": {
|
||||
"description": "Technical implementation must be tied to measurable outcomes."
|
||||
},
|
||||
"business-domain-knowledge-is-a-key-of-success": {
|
||||
"title": "Business domain knowledge is a key of success",
|
||||
"description": "Don't start with technology. Start with the problem."
|
||||
}
|
||||
}
|
||||
},
|
||||
"experience": {
|
||||
"open-to-work": {
|
||||
"title": "Seeking a New Place",
|
||||
"responsibilities": [
|
||||
"Open to Senior Engineer roles: system architecture, integration platforms, full-stack delivery"
|
||||
]
|
||||
},
|
||||
"relax-gap": {
|
||||
"title": "Relax",
|
||||
"responsibilities": [
|
||||
"Intentional break between roles — recovering the rhythm before the next system"
|
||||
]
|
||||
},
|
||||
"lazada-senior-swe": {
|
||||
"responsibilities": [
|
||||
"System ownership and architecture design for logistics integration systems",
|
||||
"Developed IoT-DWS integration solution deployed across 16 sortations",
|
||||
"Led system maintenance and modernization for production environments",
|
||||
"Applied Computer Vision and ML to solve real-world operational problems",
|
||||
"Scrum Master responsibilities — team achieved Scrum Level L3"
|
||||
]
|
||||
},
|
||||
"nexts-founder": {
|
||||
"title": "CTO & Founder",
|
||||
"responsibilities": [
|
||||
"Developed a solution for autonomous vehicles to collect real-time data from onboard sensors and systems, including LiDAR, cameras, GPS, and CAN bus."
|
||||
]
|
||||
},
|
||||
"sap-senior-swe": {
|
||||
"responsibilities": [
|
||||
"Team leader managing the B1 Integration product"
|
||||
]
|
||||
}
|
||||
},
|
||||
"projects": {
|
||||
"iot-dws-integration": {
|
||||
"title": "IoT-DWS Integration System",
|
||||
"summary": "Designed and deployed an integration system between IoT devices and DWS (Dimensioning Weighing Scanning) machines across 16 sortations.",
|
||||
"sections": {
|
||||
"context": {
|
||||
"content": "Took over and rapidly mastered an IoT-DWS system after the previous responsible team member left the project. Needed to quickly understand the current architecture and continue developing the integration solution."
|
||||
},
|
||||
"problem": {
|
||||
"content": "Needed integration between IoT devices (sensors, cameras) and DWS machines — a complex physical system with multiple different protocols (HMI, FTP, HTTP)."
|
||||
},
|
||||
"solution": {
|
||||
"content": "Designed an HTTP-based integration engine with HMAC security, RocketMQ messaging, and protocol adapters for HMI/FTP/HTTP."
|
||||
},
|
||||
"challenges": {
|
||||
"content": "Multiple different protocols, security requirements (HMAC signature), real-time data processing, production reliability."
|
||||
},
|
||||
"result": {
|
||||
"content": "Solution deployed across 16 sortations, stable in production, supporting 3 protocols (HMI, FTP, HTTP)."
|
||||
}
|
||||
}
|
||||
},
|
||||
"awb-detection": {
|
||||
"summary": "Applied Computer Vision and Machine Learning to automatically detect and OCR shipping labels from camera images on sortation lines.",
|
||||
"sections": {
|
||||
"context": {
|
||||
"content": "Sortation machines capture images of packages as they move on conveyor belts. Need to automatically read AWB (Air Waybill) from images for tracking and sorting."
|
||||
},
|
||||
"problem": {
|
||||
"content": "White label on white package — traditional CV methods are not robust enough. Needed ML-based detection."
|
||||
},
|
||||
"result": {
|
||||
"content": "Model fine-tuned for AWB detection, processing 70,000 images/month. Presented at Tech Talk workshop."
|
||||
}
|
||||
}
|
||||
},
|
||||
"facility-management": {
|
||||
"summary": "Built a digital twin platform for logistics facilities — facility modeling, real-time monitoring, and recommendation system.",
|
||||
"sections": {
|
||||
"vision": {
|
||||
"content": "Transition from manual operations to an Operation Intelligence Platform — collect data, monitor, analyze, recommend, decide."
|
||||
},
|
||||
"result": {
|
||||
"content": "Platform supports facility modeling, real-time visibility, and recommendations for capacity planning."
|
||||
}
|
||||
}
|
||||
},
|
||||
"local-llm-experiments": {
|
||||
"summary": "Technical exploration of running local MoE LLMs with llama.cpp — GPU offloading, VRAM optimization, performance tracing.",
|
||||
"sections": {
|
||||
"exploration": {
|
||||
"content": "Technical exploration of MoE (Mixture of Experts), expert routing, GPU offloading, VRAM optimization, prefill/decode pipeline."
|
||||
},
|
||||
"learnings": {
|
||||
"content": "Understand the system → Measure → Analyze → Optimize. Not about showing off hardware — but demonstrating engineering approach."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"nav": {
|
||||
"home": "Home",
|
||||
"resume": "Get resume",
|
||||
"about": "About",
|
||||
"experience": "Experience",
|
||||
"projects": "Projects",
|
||||
"philosophy": "Philosophy",
|
||||
"contact": "Contact",
|
||||
"palette": "Theme",
|
||||
"paletteAria": "Switch theme color",
|
||||
"menuAria": "Site menu",
|
||||
"openMenu": "Open menu",
|
||||
"closeMenu": "Close menu",
|
||||
"groupMenu": "Menu",
|
||||
"groupAppearance": "Appearance",
|
||||
"themeGroup": "Mode",
|
||||
"themeDark": "Dark",
|
||||
"themeLight": "Light",
|
||||
"langGroup": "Language",
|
||||
"langEn": "English",
|
||||
"langVi": "Tiếng Việt",
|
||||
"langSwitch": "Switch language",
|
||||
"switchTo": "Switch to",
|
||||
"mainNav": "Main navigation",
|
||||
"themeSwitch": "Switch display mode",
|
||||
"themeMode": "Display mode"
|
||||
},
|
||||
"social": {
|
||||
"heading": "Connect",
|
||||
"aria": {
|
||||
"github": "View GitHub profile",
|
||||
"linkedin": "View LinkedIn profile",
|
||||
"email": "Send email",
|
||||
"telegram": "Open Telegram chat"
|
||||
}
|
||||
},
|
||||
"footer": {
|
||||
"copyright": "All rights reserved",
|
||||
"links": {
|
||||
"home": "Home",
|
||||
"about": "About",
|
||||
"projects": "Projects",
|
||||
"contact": "Contact"
|
||||
}
|
||||
},
|
||||
"hero": {
|
||||
"greeting": "Hi, I'm",
|
||||
"ctaProjects": "View Projects",
|
||||
"ctaContact": "Contact Me",
|
||||
"scroll": "Scroll"
|
||||
},
|
||||
"about": {
|
||||
"heading": "About Me",
|
||||
"subtitle": "Senior Software Engineer with deep expertise in distributed systems, logistics technology, and practical AI applications.",
|
||||
"engineeringTitle": "How I Think About Engineering",
|
||||
"exploringTitle": "What I'm Exploring",
|
||||
"exploringTitlePage": "What I'm Currently Exploring",
|
||||
"expertise": "Core Expertise"
|
||||
},
|
||||
"expertise": {
|
||||
"heading": "Core Expertise"
|
||||
},
|
||||
"experience": {
|
||||
"heading": "Experience",
|
||||
"tldr": "TL;DR",
|
||||
"tldrText": "15 years of experience, more than 8 companies along the way. Too long to tell."
|
||||
},
|
||||
"projects": {
|
||||
"featured": "Featured Projects",
|
||||
"all": "Projects",
|
||||
"viewAll": "View All",
|
||||
"viewDetails": "View Details",
|
||||
"categories": {
|
||||
"software-engineering": "Software Engineering",
|
||||
"logistics": "Logistics",
|
||||
"ai-ml": "AI / ML",
|
||||
"computer-vision": "Computer Vision",
|
||||
"architecture": "Architecture",
|
||||
"experiment": "Experiment"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"heading": "Contact",
|
||||
"email": "Email",
|
||||
"github": "GitHub",
|
||||
"linkedin": "LinkedIn",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"projectDetail": {
|
||||
"notFound": "Project Not Found",
|
||||
"backToProjects": "Back to Projects",
|
||||
"impact": "Impact",
|
||||
"role": "Role",
|
||||
"technologies": "Technologies",
|
||||
"experiments": "Engineering Experiments"
|
||||
},
|
||||
"philosophy": {
|
||||
"heading": "Philosophy",
|
||||
"quotes": [
|
||||
{
|
||||
"title": "Time is priceless",
|
||||
"details": [
|
||||
"Time is priceless. You can’t buy it, pause it, or rewind it. Once it’s gone, it’s gone for good.",
|
||||
"We spend so much of our lives chasing things—money, status, validation—but time is the one thing we can never earn back.",
|
||||
"So be mindful of how you use it. Invest it in what truly matters: the people you love, the goals that inspire you, the moments that feed your soul."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"common": {
|
||||
"resumeDownload": "Get Resume",
|
||||
"resumeModalTitle": "Get Resume",
|
||||
"resumeModalAria": "Choose resume language",
|
||||
"resumeModalHint": "Choose a language — the PDF downloads to your device.",
|
||||
"resumeModalClose": "Close resume options",
|
||||
"backToTop": "Scroll to top",
|
||||
"contactTag": "Contact",
|
||||
"experienceTag": "Experience"
|
||||
},
|
||||
"resume": {
|
||||
"EXPERIENCE": "Experience",
|
||||
"SKILLS": "Skills",
|
||||
"PROJECTS": "Projects",
|
||||
"UPDATED": "Last updated",
|
||||
"QR_ALT": "QR code"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
{
|
||||
"profile": {
|
||||
"name": "Nguyễn Đông",
|
||||
"title": "Senior Software Engineer",
|
||||
"bio": "Senior Software Engineer với kinh nghiệm xây dựng hệ thống phân tán, logistics technology, và ứng dụng AI/ML vào bài toán thực tế. Tập trung vào system architecture, integration, và production-grade solutions.",
|
||||
"tagline": [
|
||||
{
|
||||
"text": "Phần lớn thời gian tôi là Backend Software Engineer. Muốn tôi là Full Stack Developer, "
|
||||
},
|
||||
{
|
||||
"text": "yes",
|
||||
"emphasis": true
|
||||
},
|
||||
{
|
||||
"text": ", có thể."
|
||||
}
|
||||
],
|
||||
"philosophy": {
|
||||
"build-for-the-real-problem": {
|
||||
"title": "Giải pháp được xây dựng dựa trên vấn đề thực tế",
|
||||
"description": "Không bắt đầu bằng technology. Bắt đầu bằng problem."
|
||||
},
|
||||
"think-in-systems": {
|
||||
"title": "Think in systems",
|
||||
"description": "Quan tâm đến kiến trúc tổng thể, không chỉ từng component."
|
||||
},
|
||||
"measure-impact": {
|
||||
"title": "Measure impact",
|
||||
"description": "Technical implementation phải gắn với measurable outcome."
|
||||
},
|
||||
"keep-learning": {
|
||||
"title": "Keep learning",
|
||||
"description": "Continuous exploration of new technologies and approaches."
|
||||
},
|
||||
"business-domain-knowledge-is-a-key-of-success": {
|
||||
"title": "Kiến thức nghiệp vụ là chìa khóa thành công",
|
||||
"description": "Hiểu sâu về business domain giúp hiểu rõ vấn đề và đưa ra giải pháp phù hợp."
|
||||
}
|
||||
}
|
||||
},
|
||||
"skills": {
|
||||
"software-engineering": {
|
||||
"title": "Software Engineering"
|
||||
},
|
||||
"system-architecture": {
|
||||
"title": "System Architecture"
|
||||
},
|
||||
"logistics-technology": {
|
||||
"title": "Logistics Technology"
|
||||
},
|
||||
"ai-ml": {
|
||||
"title": "AI / ML"
|
||||
},
|
||||
"infrastructure": {
|
||||
"title": "Infrastructure"
|
||||
},
|
||||
"engineering-practices": {
|
||||
"title": "Engineering Practices"
|
||||
}
|
||||
},
|
||||
"experience": {
|
||||
"open-to-work": {
|
||||
"title": "Đang tìm nơi làm việc mới",
|
||||
"responsibilities": [
|
||||
"Sẵn sàng cho vai trò Senior Engineer: system architecture, integration platform, full-stack delivery"
|
||||
]
|
||||
},
|
||||
"relax-gap": {
|
||||
"title": "Nghỉ ngơi",
|
||||
"responsibilities": [
|
||||
"Nghỉ có chủ đích giữa hai vai trò — lấy lại nhịp trước khi nhận hệ thống tiếp theo",
|
||||
"Tự thử nghiệm theo nhịp riêng: local LLM với llama.cpp, đọc về Computer Vision"
|
||||
]
|
||||
},
|
||||
"lazada-senior-swe": {
|
||||
"title": "Senior Software Engineer",
|
||||
"responsibilities": [
|
||||
"System ownership và architecture design cho logistics integration systems",
|
||||
"Developed IoT-DWS integration solution deployed across 16 sortations",
|
||||
"Led system maintenance and modernization for production environments",
|
||||
"Applied Computer Vision and ML to solve real-world operational problems",
|
||||
"Scrum Master responsibilities — team achieved Scrum Level L3"
|
||||
]
|
||||
},
|
||||
"nexts-founder": {
|
||||
"title": "Người sáng lập",
|
||||
"responsibilities": [
|
||||
"Phát triển giải pháp cho xe tự hành, thu thập dữ liệu thời gian thực từ cảm biến và hệ thống onboard: LiDAR, camera, GPS, CAN bus."
|
||||
]
|
||||
},
|
||||
"sap-senior-swe": {
|
||||
"title": "Senior Software Engineer",
|
||||
"responsibilities": [
|
||||
"Team leader quản lý sản phẩm B1 Integration"
|
||||
]
|
||||
}
|
||||
},
|
||||
"projects": {
|
||||
"iot-dws-integration": {
|
||||
"title": "Tích hợp hệ thống IoT-DWS",
|
||||
"summary": "Thiết kế và triển khai hệ thống integration giữa IoT devices và DWS (Dimensioning Weighing Scanning) machines cho 16 sortations.",
|
||||
"sections": {
|
||||
"context": {
|
||||
"title": "Context",
|
||||
"content": "Tiếp nhận và nhanh chóng làm chủ một hệ thống IoT-DWS sau khi thành viên phụ trách trước đó rời project. Cần hiểu nhanh architecture hiện tại và tiếp tục phát triển integration solution."
|
||||
},
|
||||
"problem": {
|
||||
"title": "Problem",
|
||||
"content": "Cần integration giữa các IoT devices (sensors, cameras) và DWS machines — hệ thống vật lý phức tạp với nhiều protocol khác nhau (HMI, FTP, HTTP)."
|
||||
},
|
||||
"solution": {
|
||||
"title": "Solution",
|
||||
"content": "Thiết kế HTTP-based integration engine với HMAC security, RocketMQ messaging, và protocol adapters cho HMI/FTP/HTTP."
|
||||
},
|
||||
"architecture": {
|
||||
"title": "Architecture",
|
||||
"content": "```text\nIoT Devices\n ↓\nProtocol Adapters (HMI/FTP/HTTP)\n ↓\nHTTP Engine + HMAC Security\n ↓\nRocketMQ\n ↓\nDWS Machines\n```"
|
||||
},
|
||||
"challenges": {
|
||||
"title": "Challenges",
|
||||
"content": "Nhiều protocol khác nhau, security requirements (HMAC signature), real-time data processing, production reliability."
|
||||
},
|
||||
"result": {
|
||||
"title": "Result",
|
||||
"content": "Giải pháp được triển khai cho 16 sortations, ổn định trong production, hỗ trợ 3 protocols (HMI, FTP, HTTP)."
|
||||
}
|
||||
}
|
||||
},
|
||||
"awb-detection": {
|
||||
"title": "AWB Detection / Computer Vision",
|
||||
"summary": "Ứng dụng Computer Vision và Machine Learning để tự động phát hiện và OCR shipping label từ hình ảnh camera trên sortation.",
|
||||
"sections": {
|
||||
"context": {
|
||||
"title": "Context",
|
||||
"content": "Sortation machines chụp ảnh packages khi di chuyển trên băng chuyền. Cần tự động đọc AWB (Air Waybill) từ ảnh để tracking và sorting."
|
||||
},
|
||||
"problem": {
|
||||
"title": "Problem",
|
||||
"content": "White label trên white package — traditional CV methods không đủ robust. Cần ML-based detection."
|
||||
},
|
||||
"pipeline": {
|
||||
"title": "Pipeline",
|
||||
"content": "```text\nImage\n ↓\nAWB/Label Detection (YOLO)\n ↓\nBounding Box / OBB\n ↓\nRotation Correction\n ↓\nCrop\n ↓\nOCR\n ↓\nText Extraction\n```"
|
||||
},
|
||||
"challenges": {
|
||||
"title": "Challenges",
|
||||
"content": "White label on white package, rotated labels, varying lighting conditions, real-time inference requirements."
|
||||
},
|
||||
"result": {
|
||||
"title": "Result",
|
||||
"content": "Model fine-tuned cho AWB detection, xử lý 70,000 images/month. Presentation tại Tech Talk workshop."
|
||||
}
|
||||
}
|
||||
},
|
||||
"facility-management": {
|
||||
"title": "Facility Management Platform",
|
||||
"summary": "Xây dựng nền tảng digital twin cho logistics facilities — mô hình hóa facility, theo dõi real-time, và recommendation system.",
|
||||
"sections": {
|
||||
"vision": {
|
||||
"title": "Vision",
|
||||
"content": "Chuyển đổi từ manual operations sang Operation Intelligence Platform — thu thập data, monitor, analyze, recommend, decide."
|
||||
},
|
||||
"architecture": {
|
||||
"title": "Architecture",
|
||||
"content": "```text\nPhysical Facility\n ↓\nData Collection\n ↓\nFacility Model\n ↓\nDigital Twin\n ↓\nSimulation\n ↓\nAnalytics\n ↓\nRecommendation\n ↓\nOperation Decision\n```"
|
||||
},
|
||||
"result": {
|
||||
"title": "Result",
|
||||
"content": "Platform hỗ trợ facility modeling, real-time visibility, và recommendation cho capacity planning."
|
||||
}
|
||||
}
|
||||
},
|
||||
"local-llm-experiments": {
|
||||
"title": "Local LLM Experiments",
|
||||
"summary": "Technical exploration về running local MoE LLMs với llama.cpp — GPU offloading, VRAM optimization, performance tracing.",
|
||||
"sections": {
|
||||
"exploration": {
|
||||
"title": "Exploration",
|
||||
"content": "Technical exploration về MoE (Mixture of Experts), expert routing, GPU offloading, VRAM optimization, prefill/decode pipeline."
|
||||
},
|
||||
"learnings": {
|
||||
"title": "Lessons Learned",
|
||||
"content": "Understand the system → Measure → Analyze → Optimize. Không phải khoe hardware — mà thể hiện engineering approach."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"nav": {
|
||||
"home": "Trang chủ",
|
||||
"resume": "Tải CV",
|
||||
"about": "Giới thiệu",
|
||||
"experience": "Kinh nghiệm",
|
||||
"projects": "Dự án",
|
||||
"philosophy": "Triết lý",
|
||||
"contact": "Liên hệ",
|
||||
"palette": "Giao diện",
|
||||
"paletteAria": "Đổi màu giao diện",
|
||||
"menuAria": "Menu trang",
|
||||
"openMenu": "Mở menu",
|
||||
"closeMenu": "Đóng menu",
|
||||
"groupMenu": "Menu",
|
||||
"groupAppearance": "Giao diện",
|
||||
"themeGroup": "Chế độ",
|
||||
"themeDark": "Tối",
|
||||
"themeLight": "Sáng",
|
||||
"langGroup": "Ngôn ngữ",
|
||||
"langEn": "English",
|
||||
"langVi": "Tiếng Việt",
|
||||
"langSwitch": "Đổi ngôn ngữ",
|
||||
"switchTo": "Chuyển sang",
|
||||
"mainNav": "Điều hướng chính",
|
||||
"themeSwitch": "Đổi chế độ hiển thị",
|
||||
"themeMode": "Chế độ hiển thị"
|
||||
},
|
||||
"social": {
|
||||
"heading": "Kết nối",
|
||||
"aria": {
|
||||
"github": "Xem hồ sơ GitHub",
|
||||
"linkedin": "Xem hồ sơ LinkedIn",
|
||||
"email": "Gửi email",
|
||||
"telegram": "Mở chat Telegram"
|
||||
}
|
||||
},
|
||||
"footer": {
|
||||
"copyright": "Bảo lưu mọi quyền",
|
||||
"links": {
|
||||
"home": "Trang chủ",
|
||||
"about": "Giới thiệu",
|
||||
"projects": "Dự án",
|
||||
"contact": "Liên hệ"
|
||||
}
|
||||
},
|
||||
"hero": {
|
||||
"greeting": "Xin chào, tôi là",
|
||||
"ctaProjects": "Xem dự án",
|
||||
"ctaContact": "Liên hệ",
|
||||
"scroll": "Cuộn"
|
||||
},
|
||||
"about": {
|
||||
"heading": "Giới thiệu",
|
||||
"subtitle": "Kỹ sư phần mềm cao cấp với chuyên môn sâu về hệ thống phân tán, công nghệ logistics và ứng dụng AI thực tiễn.",
|
||||
"engineeringTitle": "Cách tôi tư duy về kỹ thuật",
|
||||
"exploringTitle": "Những điều tôi đang tìm hiểu",
|
||||
"exploringTitlePage": "Những điều tôi đang tìm hiểu",
|
||||
"expertise": "Chuyên môn"
|
||||
},
|
||||
"expertise": {
|
||||
"heading": "Chuyên môn"
|
||||
},
|
||||
"experience": {
|
||||
"heading": "Kinh nghiệm",
|
||||
"tldr": "TL;DR",
|
||||
"tldrText": "15 năm kinh nghiệm, hơn 8 công ty đã đi qua. Quá dài để kể hết."
|
||||
},
|
||||
"projects": {
|
||||
"featured": "Dự án nổi bật",
|
||||
"all": "Dự án",
|
||||
"viewAll": "Xem tất cả",
|
||||
"viewDetails": "Xem chi tiết",
|
||||
"categories": {
|
||||
"software-engineering": "Kỹ thuật phần mềm",
|
||||
"logistics": "Logistics",
|
||||
"ai-ml": "AI / ML",
|
||||
"computer-vision": "Computer Vision",
|
||||
"architecture": "Kiến trúc",
|
||||
"experiment": "Thử nghiệm"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"heading": "Liên hệ",
|
||||
"email": "Email",
|
||||
"github": "GitHub",
|
||||
"linkedin": "LinkedIn",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"projectDetail": {
|
||||
"notFound": "Không tìm thấy dự án",
|
||||
"backToProjects": "Quay lại dự án",
|
||||
"impact": "Tác động",
|
||||
"role": "Vai trò",
|
||||
"technologies": "Công nghệ",
|
||||
"experiments": "Thí nghiệm kỹ thuật"
|
||||
},
|
||||
"philosophy": {
|
||||
"heading": "Triết lý",
|
||||
"quotes": [
|
||||
{
|
||||
"title": "Thời gian là vô giá",
|
||||
"details": [
|
||||
"Thời gian là vô giá. Bạn không thể mua nó bằng tiền, không thể khiến nó dừng lại, cũng chẳng thể quay ngược về quá khứ. Một khi thời gian đã trôi qua, nó sẽ mãi mãi không trở lại.",
|
||||
"Chúng ta dành quá nhiều thời gian trong cuộc đời để theo đuổi những thứ như tiền bạc, địa vị và sự công nhận từ người khác. Nhưng thời gian là thứ duy nhất mà chúng ta không bao giờ có thể lấy lại.",
|
||||
"Vì vậy, hãy luôn ý thức về cách bạn sử dụng thời gian của mình. Hãy dành thời gian cho những điều thực sự quan trọng: những người bạn yêu thương, những mục tiêu truyền cảm hứng cho bạn và những khoảnh khắc nuôi dưỡng tâm hồn bạn."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"common": {
|
||||
"resumeDownload": "Tải CV",
|
||||
"resumeModalTitle": "Tải CV",
|
||||
"resumeModalAria": "Chọn ngôn ngữ CV",
|
||||
"resumeModalHint": "Chọn ngôn ngữ — PDF sẽ tải về máy của bạn.",
|
||||
"resumeModalClose": "Đóng tùy chọn tải CV",
|
||||
"backToTop": "Cuộn lên đầu trang",
|
||||
"contactTag": "Liên hệ",
|
||||
"experienceTag": "Kinh nghiệm"
|
||||
},
|
||||
"resume": {
|
||||
"EXPERIENCE": "Kinh nghiệm",
|
||||
"SKILLS": "Kỹ năng",
|
||||
"PROJECTS": "Dự án",
|
||||
"UPDATED": "Cập nhật lần cuối",
|
||||
"QR_ALT": "mã QR"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// I18nProvider / useI18n (spec-v4 §3.5, D3): content and UI strings flow
|
||||
// through one context whose default value is the build-time documents.
|
||||
// Phase 3 overrides this value with draft state; the real components then
|
||||
// render the draft — preview is the production app.
|
||||
import { createContext, useContext } from 'react';
|
||||
import { useLanguage } from '../hooks/useLanguage';
|
||||
import { CONTENT, UI } from './index';
|
||||
import type { ResolvedContent } from './index';
|
||||
import type { UIDict } from './dict-types';
|
||||
import type { Language } from '../types/index';
|
||||
|
||||
export type ResolvedI18n = { ui: UIDict; content: ResolvedContent };
|
||||
|
||||
// Module-level constants: the context value for a given language is the same
|
||||
// object on every render. A value rebuilt per render would re-render every
|
||||
// consumer in the tree on any provider state change.
|
||||
const DEFAULTS: Record<Language, ResolvedI18n> = {
|
||||
en: { ui: UI.en, content: CONTENT.en },
|
||||
vi: { ui: UI.vi, content: CONTENT.vi },
|
||||
};
|
||||
|
||||
const I18nContext = createContext<ResolvedI18n | null>(null);
|
||||
|
||||
export function I18nProvider({
|
||||
children,
|
||||
override,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
override?: ResolvedI18n;
|
||||
}) {
|
||||
const { lang } = useLanguage();
|
||||
return (
|
||||
<I18nContext.Provider value={override ?? DEFAULTS[lang]}>
|
||||
{children}
|
||||
</I18nContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useI18n(): ResolvedI18n {
|
||||
const context = useContext(I18nContext);
|
||||
if (!context) {
|
||||
throw new Error('useI18n must be used within I18nProvider');
|
||||
}
|
||||
return context;
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
export const strings = {
|
||||
nav: {
|
||||
home: {en: 'Home', vi: 'Trang chủ'},
|
||||
resume: {en: 'Get resume', vi: 'Tải CV'},
|
||||
about: {en: 'About', vi: 'Giới thiệu'},
|
||||
experience: {en: 'Experience', vi: 'Kinh nghiệm'},
|
||||
projects: {en: 'Projects', vi: 'Dự án'},
|
||||
philosophy: {en: 'Philosophy', vi: 'Triết lý'},
|
||||
contact: {en: 'Contact', vi: 'Liên hệ'},
|
||||
palette: {en: 'Theme', vi: 'Giao diện'},
|
||||
paletteAria: {en: 'Switch theme color', vi: 'Đổi màu giao diện'},
|
||||
menuAria: {en: 'Site menu', vi: 'Menu trang'},
|
||||
openMenu: {en: 'Open menu', vi: 'Mở menu'},
|
||||
closeMenu: {en: 'Close menu', vi: 'Đóng menu'},
|
||||
groupMenu: {en: 'Menu', vi: 'Menu'},
|
||||
groupAppearance: {en: 'Appearance', vi: 'Giao diện'},
|
||||
themeGroup: {en: 'Mode', vi: 'Chế độ'},
|
||||
themeDark: {en: 'Dark', vi: 'Tối'},
|
||||
themeLight: {en: 'Light', vi: 'Sáng'},
|
||||
langGroup: {en: 'Language', vi: 'Ngôn ngữ'},
|
||||
langEn: {en: 'English', vi: 'English'},
|
||||
langVi: {en: 'Tiếng Việt', vi: 'Tiếng Việt'},
|
||||
langSwitch: {en: 'Switch language', vi: 'Đổi ngôn ngữ'},
|
||||
switchTo: {en: 'Switch to', vi: 'Chuyển sang'},
|
||||
mainNav: {en: 'Main navigation', vi: 'Điều hướng chính'},
|
||||
themeSwitch: {en: 'Switch display mode', vi: 'Đổi chế độ hiển thị'},
|
||||
themeMode: {en: 'Display mode', vi: 'Chế độ hiển thị'},
|
||||
},
|
||||
social: {
|
||||
heading: {en: 'Connect', vi: 'Kết nối'},
|
||||
aria: {
|
||||
github: {en: 'View GitHub profile', vi: 'Xem hồ sơ GitHub'},
|
||||
linkedin: {en: 'View LinkedIn profile', vi: 'Xem hồ sơ LinkedIn'},
|
||||
email: {en: 'Send email', vi: 'Gửi email'},
|
||||
telegram: {en: 'Open Telegram chat', vi: 'Mở chat Telegram'},
|
||||
},
|
||||
},
|
||||
footer: {
|
||||
copyright: {en: 'All rights reserved', vi: 'Bảo lưu mọi quyền'},
|
||||
links: {
|
||||
home: {en: 'Home', vi: 'Trang chủ'},
|
||||
about: {en: 'About', vi: 'Giới thiệu'},
|
||||
projects: {en: 'Projects', vi: 'Dự án'},
|
||||
contact: {en: 'Contact', vi: 'Liên hệ'},
|
||||
},
|
||||
},
|
||||
hero: {
|
||||
greeting: {en: "Hi, I'm", vi: 'Xin chào, tôi là'},
|
||||
ctaProjects: {en: 'View Projects', vi: 'Xem dự án'},
|
||||
ctaContact: {en: 'Contact Me', vi: 'Liên hệ'},
|
||||
scroll: {en: 'Scroll', vi: 'Cuộn'},
|
||||
},
|
||||
about: {
|
||||
heading: {en: 'About Me', vi: 'Giới thiệu'},
|
||||
subtitle: {
|
||||
en: 'Senior Software Engineer with deep expertise in distributed systems, logistics technology, and practical AI applications.',
|
||||
vi: 'Kỹ sư phần mềm cao cấp với chuyên môn sâu về hệ thống phân tán, công nghệ logistics và ứng dụng AI thực tiễn.'
|
||||
},
|
||||
engineeringTitle: {en: 'How I Think About Engineering', vi: 'Cách tôi tư duy về kỹ thuật'},
|
||||
exploringTitle: {en: "What I'm Exploring", vi: 'Những điều tôi đang tìm hiểu'},
|
||||
exploringTitlePage: {en: "What I'm Currently Exploring", vi: 'Những điều tôi đang tìm hiểu'},
|
||||
expertise: {en: 'Core Expertise', vi: 'Chuyên môn'},
|
||||
},
|
||||
expertise: {
|
||||
heading: {en: 'Core Expertise', vi: 'Chuyên môn'},
|
||||
},
|
||||
experience: {
|
||||
heading: {en: 'Experience', vi: 'Kinh nghiệm'},
|
||||
tldr: {en: 'TL;DR', vi: 'TL;DR'},
|
||||
tldrText: {
|
||||
en: '15 years of experience, more than 8 companies along the way. Too long to tell.',
|
||||
vi: '15 năm kinh nghiệm, hơn 8 công ty đã đi qua. Quá dài để kể hết.'
|
||||
},
|
||||
},
|
||||
projects: {
|
||||
featured: {en: 'Featured Projects', vi: 'Dự án nổi bật'},
|
||||
all: {en: 'Projects', vi: 'Dự án'},
|
||||
viewAll: {en: 'View All', vi: 'Xem tất cả'},
|
||||
viewDetails: {en: 'View Details', vi: 'Xem chi tiết'},
|
||||
categories: {
|
||||
'software-engineering': {en: 'Software Engineering', vi: 'Kỹ thuật phần mềm'},
|
||||
logistics: {en: 'Logistics', vi: 'Logistics'},
|
||||
'ai-ml': {en: 'AI / ML', vi: 'AI / ML'},
|
||||
'computer-vision': {en: 'Computer Vision', vi: 'Computer Vision'},
|
||||
architecture: {en: 'Architecture', vi: 'Kiến trúc'},
|
||||
experiment: {en: 'Experiment', vi: 'Thử nghiệm'},
|
||||
},
|
||||
},
|
||||
contact: {
|
||||
heading: {en: 'Contact', vi: 'Liên hệ'},
|
||||
email: {en: 'Email', vi: 'Email'},
|
||||
github: {en: 'GitHub', vi: 'GitHub'},
|
||||
linkedin: {en: 'LinkedIn', vi: 'LinkedIn'},
|
||||
telegram: {en: 'Telegram', vi: 'Telegram'},
|
||||
},
|
||||
projectDetail: {
|
||||
notFound: {en: 'Project Not Found', vi: 'Không tìm thấy dự án'},
|
||||
backToProjects: {en: 'Back to Projects', vi: 'Quay lại dự án'},
|
||||
impact: {en: 'Impact', vi: 'Tác động'},
|
||||
role: {en: 'Role', vi: 'Vai trò'},
|
||||
technologies: {en: 'Technologies', vi: 'Công nghệ'},
|
||||
experiments: {en: 'Engineering Experiments', vi: 'Thí nghiệm kỹ thuật'},
|
||||
},
|
||||
philosophy: {
|
||||
heading: {en: 'Philosophy', vi: 'Triết lý'},
|
||||
quotes: [
|
||||
{
|
||||
title: {en: 'Time is priceless', vi: 'Thời gian là vô giá'},
|
||||
details: {
|
||||
en: '<p>Time is priceless. You can’t buy it, pause it, or rewind it. Once it’s gone, it’s gone for good.</p>' +
|
||||
'<p>We spend so much of our lives chasing things—money, status, validation—but time is the one thing we can never earn back.</p>' +
|
||||
'<p>So be mindful of how you use it. Invest it in what truly matters: the people you love, the goals that inspire you, the moments that feed your soul.</p>',
|
||||
vi: '<p>Thời gian là vô giá. Bạn không thể mua nó bằng tiền, không thể khiến nó dừng lại, cũng chẳng thể quay ngược về quá khứ. Một khi thời gian đã trôi qua, nó sẽ mãi mãi không trở lại.</p>' +
|
||||
'<p>Chúng ta dành quá nhiều thời gian trong cuộc đời để theo đuổi những thứ như tiền bạc, địa vị và sự công nhận từ người khác. Nhưng thời gian là thứ duy nhất mà chúng ta không bao giờ có thể lấy lại.</p>' +
|
||||
'<p>Vì vậy, hãy luôn ý thức về cách bạn sử dụng thời gian của mình. Hãy dành thời gian cho những điều thực sự quan trọng: những người bạn yêu thương, những mục tiêu truyền cảm hứng cho bạn và những khoảnh khắc nuôi dưỡng tâm hồn bạn.</p>'
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
common: {
|
||||
resumeDownload: {en: 'Get Resume', vi: 'Tải CV'},
|
||||
resumeModalTitle: {en: 'Get Resume', vi: 'Tải CV'},
|
||||
resumeModalAria: {en: 'Choose resume language', vi: 'Chọn ngôn ngữ CV'},
|
||||
resumeModalHint: {en: 'Choose a language — the PDF downloads to your device.', vi: 'Chọn ngôn ngữ — PDF sẽ tải về máy của bạn.'},
|
||||
resumeModalClose: {en: 'Close resume options', vi: 'Đóng tùy chọn tải CV'},
|
||||
backToTop: {en: 'Scroll to top', vi: 'Cuộn lên đầu trang'},
|
||||
contactTag: {en: 'Contact', vi: 'Liên hệ'},
|
||||
experienceTag: {en: 'Experience', vi: 'Kinh nghiệm'},
|
||||
},
|
||||
} as const
|
||||
@@ -0,0 +1,144 @@
|
||||
// Cross-document consistency rules (spec-v4 §3.6) — what types cannot express
|
||||
// across two JSON files. Runs at load (dev), in CI (`scripts/validate-content.ts`),
|
||||
// and in the browser before save (edit mode, Phase 3).
|
||||
//
|
||||
// tsc already guarantees each document individually satisfies its declared type
|
||||
// and that `content.vi.json` covers every union id; this module enforces the
|
||||
// relationships BETWEEN documents and reports exact document paths so a content
|
||||
// edit can be fixed in the JSON panel.
|
||||
import type {
|
||||
ContentEn,
|
||||
ContentVi,
|
||||
ExperienceStructure,
|
||||
ProfileStructure,
|
||||
ProjectStructure,
|
||||
SkillGroupStructure,
|
||||
} from './dict-types';
|
||||
|
||||
export type ContentIssue = { path: string; message: string };
|
||||
|
||||
export type ContentStructures = {
|
||||
profile: ProfileStructure;
|
||||
skills: SkillGroupStructure[];
|
||||
experience: ExperienceStructure[];
|
||||
projects: ProjectStructure[];
|
||||
};
|
||||
|
||||
const hasHtml = (value: string) => value.includes('<') || value.includes('>');
|
||||
|
||||
// Walks every string value of a text document, collecting its document path.
|
||||
function findHtmlStrings(value: unknown, docPath: string): string[] {
|
||||
if (typeof value === 'string') return hasHtml(value) ? [docPath] : [];
|
||||
if (Array.isArray(value))
|
||||
return value.flatMap((item, i) => findHtmlStrings(item, `${docPath}[${i}]`));
|
||||
if (value && typeof value === 'object')
|
||||
return Object.entries(value).flatMap(([key, item]) =>
|
||||
findHtmlStrings(item, `${docPath}.${key}`),
|
||||
);
|
||||
return [];
|
||||
}
|
||||
|
||||
export function collectContentIssues(
|
||||
structures: ContentStructures,
|
||||
vi: ContentVi,
|
||||
en: ContentEn,
|
||||
): ContentIssue[] {
|
||||
const issues: ContentIssue[] = [];
|
||||
|
||||
// Rule 1: every structure id — and every section id inside a project —
|
||||
// has Vietnamese text. (Section ids collide across projects, so coverage is
|
||||
// enforced per project, not by a global union.)
|
||||
for (const group of structures.skills) {
|
||||
if (!vi.skills[group.id])
|
||||
issues.push({ path: `content.vi.json: skills.${group.id}`, message: 'missing Vietnamese text' });
|
||||
}
|
||||
for (const entry of structures.experience) {
|
||||
if (!vi.experience[entry.id])
|
||||
issues.push({ path: `content.vi.json: experience.${entry.id}`, message: 'missing Vietnamese text' });
|
||||
}
|
||||
for (const project of structures.projects) {
|
||||
const text = vi.projects[project.id];
|
||||
if (!text) {
|
||||
issues.push({ path: `content.vi.json: projects.${project.id}`, message: 'missing Vietnamese text' });
|
||||
continue;
|
||||
}
|
||||
for (const section of project.sections) {
|
||||
if (!text.sections[section.id])
|
||||
issues.push({
|
||||
path: `content.vi.json: projects.${project.id}.sections.${section.id}`,
|
||||
message: 'missing Vietnamese text for section',
|
||||
});
|
||||
}
|
||||
}
|
||||
for (const point of structures.profile.philosophy) {
|
||||
if (!vi.profile.philosophy[point.id])
|
||||
issues.push({
|
||||
path: `content.vi.json: profile.philosophy.${point.id}`,
|
||||
message: 'missing Vietnamese text',
|
||||
});
|
||||
}
|
||||
|
||||
// Rules 2–3: no orphan text keys — every key in either language must
|
||||
// correspond to an id present in structure (partial en coverage is allowed).
|
||||
const skillIds = new Set(structures.skills.map((g) => g.id));
|
||||
const experienceIds = new Set(structures.experience.map((e) => e.id));
|
||||
const projectIds = new Set(structures.projects.map((p) => p.id));
|
||||
const sectionIds = new Map(
|
||||
structures.projects.map((p) => [p.id, new Set(p.sections.map((s) => s.id))]),
|
||||
);
|
||||
const philosophyIds = new Set(structures.profile.philosophy.map((p) => p.id));
|
||||
|
||||
const checkTextDoc = (doc: Partial<ContentVi> | ContentEn, lang: 'vi' | 'en') => {
|
||||
const file = `content.${lang}.json`;
|
||||
for (const id of Object.keys(doc.skills ?? {})) {
|
||||
if (!skillIds.has(id as never))
|
||||
issues.push({ path: `${file}: skills.${id}`, message: 'orphan text key — no such skill group in structure' });
|
||||
}
|
||||
for (const id of Object.keys(doc.experience ?? {})) {
|
||||
if (!experienceIds.has(id as never))
|
||||
issues.push({ path: `${file}: experience.${id}`, message: 'orphan text key — no such experience in structure' });
|
||||
}
|
||||
for (const [id, text] of Object.entries(doc.projects ?? {})) {
|
||||
if (!projectIds.has(id as never)) {
|
||||
issues.push({ path: `${file}: projects.${id}`, message: 'orphan text key — no such project in structure' });
|
||||
continue;
|
||||
}
|
||||
const known = sectionIds.get(id as never)!;
|
||||
for (const sectionId of Object.keys(text.sections ?? {})) {
|
||||
if (!known.has(sectionId))
|
||||
issues.push({
|
||||
path: `${file}: projects.${id}.sections.${sectionId}`,
|
||||
message: "orphan section text key — not in the project's structure",
|
||||
});
|
||||
}
|
||||
}
|
||||
for (const id of Object.keys(doc.profile?.philosophy ?? {})) {
|
||||
if (!philosophyIds.has(id as never))
|
||||
issues.push({ path: `${file}: profile.philosophy.${id}`, message: 'orphan text key — no such philosophy point' });
|
||||
}
|
||||
};
|
||||
checkTextDoc(vi, 'vi');
|
||||
checkTextDoc(en, 'en');
|
||||
|
||||
// Rule 5: text values are plain text — no HTML markup in any content
|
||||
// document (after D9 nothing needs markup; §3.2 keeps rendering separate).
|
||||
for (const [lang, doc] of [['vi', vi], ['en', en]] as const) {
|
||||
for (const path of findHtmlStrings(doc, `content.${lang}.json`)) {
|
||||
issues.push({ path, message: 'text value contains HTML markup' });
|
||||
}
|
||||
}
|
||||
|
||||
return issues;
|
||||
}
|
||||
|
||||
export function validateContent(
|
||||
structures: ContentStructures,
|
||||
vi: ContentVi,
|
||||
en: ContentEn,
|
||||
): void {
|
||||
const issues = collectContentIssues(structures, vi, en);
|
||||
if (issues.length > 0) {
|
||||
const detail = issues.map((i) => ` ${i.path}: ${i.message}`).join('\n');
|
||||
throw new Error(`content validation failed (${issues.length} issue(s)):\n${detail}`);
|
||||
}
|
||||
}
|
||||
+17
-21
@@ -2,14 +2,10 @@ import { motion } from 'motion/react'
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { profile } from '@/data/profile'
|
||||
import { skillGroups } from '@/data/skills'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function AboutPage() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
return (
|
||||
<>
|
||||
<InView>
|
||||
@@ -25,21 +21,21 @@ export function AboutPage() {
|
||||
}}
|
||||
>
|
||||
<SectionHeading
|
||||
title={strings.about.heading[lang]}
|
||||
subtitle={strings.about.subtitle[lang]}
|
||||
tag={strings.about.heading[lang]}
|
||||
title={s.about.heading}
|
||||
subtitle={s.about.subtitle}
|
||||
tag={s.about.heading}
|
||||
/>
|
||||
<p className="prose-lede lede-wide">
|
||||
{field(lang, profile.bio, profile.bioEn)}
|
||||
{c.profile.bio}
|
||||
</p>
|
||||
|
||||
<h3 className="subheading">
|
||||
{strings.about.engineeringTitle[lang]}
|
||||
{s.about.engineeringTitle}
|
||||
</h3>
|
||||
<div className="philosophy-grid">
|
||||
{profile.philosophy.map((point, i) => (
|
||||
{c.profile.philosophy.map((point, i) => (
|
||||
<motion.div
|
||||
key={point.title}
|
||||
key={point.id}
|
||||
className="philosophy-card"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
@@ -48,8 +44,8 @@ export function AboutPage() {
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{field(lang, point.title, point.titleEn)}</h3>
|
||||
<p>{field(lang, point.description, point.descriptionEn)}</p>
|
||||
<h3>{point.title}</h3>
|
||||
<p>{point.description}</p>
|
||||
<div className="philosophy-keywords">
|
||||
{point.keywords.map((kw) => (
|
||||
<Tag key={kw}>{kw}</Tag>
|
||||
@@ -60,10 +56,10 @@ export function AboutPage() {
|
||||
</div>
|
||||
|
||||
<h3 className="subheading">
|
||||
{strings.about.exploringTitlePage[lang]}
|
||||
{s.about.exploringTitlePage}
|
||||
</h3>
|
||||
<div className="interests-list">
|
||||
{profile.currentInterests.map((interest) => (
|
||||
{c.profile.currentInterests.map((interest) => (
|
||||
<Tag key={interest} accent>
|
||||
{interest}
|
||||
</Tag>
|
||||
@@ -83,11 +79,11 @@ export function AboutPage() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.about.expertise[lang]} />
|
||||
<SectionHeading title={s.about.expertise} />
|
||||
<div className="expertise-grid">
|
||||
{skillGroups.map((group, i) => (
|
||||
{c.skillGroups.map((group, i) => (
|
||||
<motion.div
|
||||
key={group.title}
|
||||
key={group.id}
|
||||
className="expertise-card"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
@@ -96,7 +92,7 @@ export function AboutPage() {
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{field(lang, group.title, group.titleEn)}</h3>
|
||||
<h3>{group.title}</h3>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill: string) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
|
||||
@@ -2,10 +2,9 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { ContactLinks } from '@/components/ui/ContactLinks'
|
||||
import { motion } from 'motion/react'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
export function ContactPage() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s } = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -19,7 +18,7 @@ export function ContactPage() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.contact.heading[lang]} tag={strings.common.contactTag[lang]} />
|
||||
<SectionHeading title={s.contact.heading} tag={s.common.contactTag} />
|
||||
<ContactLinks />
|
||||
</motion.section>
|
||||
</InView>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { motion } from 'motion/react'
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { experiences } from '@/data/experience'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function ExperiencePage() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -21,9 +18,9 @@ export function ExperiencePage() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.experience.heading[lang]} tag={strings.common.experienceTag[lang]} />
|
||||
<SectionHeading title={s.experience.heading} tag={s.common.experienceTag} />
|
||||
<div className="timeline">
|
||||
{experiences.map((exp, i) => (
|
||||
{c.experiences.map((exp, i) => (
|
||||
<motion.div
|
||||
key={exp.id}
|
||||
className={exp.variant ? `timeline-entry timeline-entry-${exp.variant}` : 'timeline-entry'}
|
||||
@@ -34,7 +31,7 @@ export function ExperiencePage() {
|
||||
>
|
||||
<div className="timeline-marker" />
|
||||
<div className="timeline-header">
|
||||
<div className="timeline-title">{field(lang, exp.title, exp.titleEn)}</div>
|
||||
<div className="timeline-title">{exp.title}</div>
|
||||
<div className="timeline-company">{exp.company}</div>
|
||||
<div className="timeline-meta">
|
||||
<span className="timeline-duration">{exp.duration}</span>
|
||||
@@ -42,7 +39,7 @@ export function ExperiencePage() {
|
||||
</div>
|
||||
</div>
|
||||
<ul className="timeline-responsibilities">
|
||||
{field(lang, exp.responsibilities, exp.responsibilitiesEn).map((r) => (
|
||||
{exp.responsibilities.map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
))}
|
||||
</ul>
|
||||
@@ -50,8 +47,8 @@ export function ExperiencePage() {
|
||||
))}
|
||||
<div className="timeline-tldr">
|
||||
<span className="timeline-tldr-marker" aria-hidden="true" />
|
||||
<span className="timeline-tldr-chip">{strings.experience.tldr[lang]}</span>
|
||||
<p className="timeline-tldr-text">{strings.experience.tldrText[lang]}</p>
|
||||
<span className="timeline-tldr-chip">{s.experience.tldr}</span>
|
||||
<p className="timeline-tldr-text">{s.experience.tldrText}</p>
|
||||
</div>
|
||||
</div>
|
||||
</motion.section>
|
||||
|
||||
@@ -2,11 +2,10 @@ import {SectionHeading} from '@/components/ui/SectionHeading'
|
||||
import {motion} from 'motion/react'
|
||||
import {InView} from '@/components/ui/InView'
|
||||
|
||||
import {useLanguage} from '@/hooks/useLanguage'
|
||||
import {strings} from '@/i18n/strings'
|
||||
import {useI18n} from '@/i18n/provider'
|
||||
|
||||
export function PhilosophyPage() {
|
||||
const {lang} = useLanguage()
|
||||
const {ui: s} = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -20,11 +19,11 @@ export function PhilosophyPage() {
|
||||
visible: {opacity: 1, transition: {duration: 0.5}},
|
||||
}}
|
||||
>
|
||||
<SectionHeading id="philosophy-heading" title={strings.philosophy.heading[lang]} tag={strings.philosophy.heading[lang]}/>
|
||||
<SectionHeading id="philosophy-heading" title={s.philosophy.heading} tag={s.philosophy.heading}/>
|
||||
<div className="prose prose-wide">
|
||||
{strings.philosophy.quotes.map((quote, i) => (
|
||||
{s.philosophy.quotes.map((quote, i) => (
|
||||
<motion.div
|
||||
key={quote.title[lang]}
|
||||
key={i}
|
||||
className="philosophy-quote"
|
||||
initial={{opacity: 0, y: 24}}
|
||||
whileInView={{opacity: 1, y: 0}}
|
||||
@@ -32,9 +31,13 @@ export function PhilosophyPage() {
|
||||
transition={{duration: 0.45, ease: 'easeOut', delay: i * 0.08}}
|
||||
>
|
||||
<h3>
|
||||
{quote.title[lang]}
|
||||
{quote.title}
|
||||
</h3>
|
||||
<div dangerouslySetInnerHTML={{__html: quote.details[lang]}}/>
|
||||
<div>
|
||||
{quote.details.map((detail, j) => (
|
||||
<p key={j}>{detail}</p>
|
||||
))}
|
||||
</div>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -3,10 +3,7 @@ import { motion, type Transition } from 'motion/react'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { projects } from '@/data/projects'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
const sectionVariants = {
|
||||
hidden: { opacity: 0 },
|
||||
@@ -21,8 +18,8 @@ const itemTransition = (delay: number): Transition => ({
|
||||
|
||||
export function ProjectDetailPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const { lang } = useLanguage()
|
||||
const project = projects.find((p) => p.id === id)
|
||||
const { ui: s, content: c } = useI18n()
|
||||
const project = c.projects.find((p) => p.id === id)
|
||||
|
||||
if (!project) {
|
||||
return (
|
||||
@@ -34,9 +31,9 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={sectionVariants}
|
||||
>
|
||||
<h2>{strings.projectDetail.notFound[lang]}</h2>
|
||||
<h2>{s.projectDetail.notFound}</h2>
|
||||
<p>
|
||||
<Link to="/projects">{strings.projectDetail.backToProjects[lang]} ←</Link>
|
||||
<Link to="/projects">{s.projectDetail.backToProjects} ←</Link>
|
||||
</p>
|
||||
</motion.section>
|
||||
</InView>
|
||||
@@ -54,7 +51,7 @@ export function ProjectDetailPage() {
|
||||
variants={sectionVariants}
|
||||
>
|
||||
<Link to="/projects" className="back-link">
|
||||
{strings.projectDetail.backToProjects[lang]} ←
|
||||
{s.projectDetail.backToProjects} ←
|
||||
</Link>
|
||||
|
||||
<motion.div
|
||||
@@ -64,8 +61,8 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0)}
|
||||
>
|
||||
<h1 id="project-title" style={{ flex: 1 }}>{field(lang, project.title, project.titleEn)}</h1>
|
||||
<Badge variant="outline">{strings.projects.categories[project.category][lang]}</Badge>
|
||||
<h1 id="project-title" style={{ flex: 1 }}>{project.title}</h1>
|
||||
<Badge variant="outline">{s.projects.categories[project.category]}</Badge>
|
||||
</motion.div>
|
||||
|
||||
<motion.p
|
||||
@@ -75,7 +72,7 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.08)}
|
||||
>
|
||||
{field(lang, project.summary, project.summaryEn)}
|
||||
{project.summary}
|
||||
</motion.p>
|
||||
|
||||
<div className="prose">
|
||||
@@ -86,7 +83,7 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.16)}
|
||||
>
|
||||
<h3>{strings.projectDetail.impact[lang]}</h3>
|
||||
<h3>{s.projectDetail.impact}</h3>
|
||||
<div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>
|
||||
{project.metrics.map((m) => (
|
||||
<span key={m} className="achievement-metric">
|
||||
@@ -103,7 +100,7 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.24)}
|
||||
>
|
||||
<h3>{strings.projectDetail.role[lang]}</h3>
|
||||
<h3>{s.projectDetail.role}</h3>
|
||||
<p>{project.role}</p>
|
||||
</motion.div>
|
||||
|
||||
@@ -113,7 +110,7 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.32)}
|
||||
>
|
||||
<h3>{strings.projectDetail.technologies[lang]}</h3>
|
||||
<h3>{s.projectDetail.technologies}</h3>
|
||||
<div className="philosophy-keywords">
|
||||
{project.technologies.map((tech) => (
|
||||
<Tag key={tech}>{tech}</Tag>
|
||||
@@ -129,7 +126,7 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.4)}
|
||||
>
|
||||
{strings.projectDetail.experiments[lang]}
|
||||
{s.projectDetail.experiments}
|
||||
</motion.h3>
|
||||
{project.sections.map((section, idx) => (
|
||||
<motion.div
|
||||
@@ -140,8 +137,8 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.48 + idx * 0.08)}
|
||||
>
|
||||
<h4>{field(lang, section.title, section.titleEn)}</h4>
|
||||
<p>{field(lang, section.content, section.contentEn)}</p>
|
||||
<h4>{section.title}</h4>
|
||||
<p>{section.content}</p>
|
||||
<Tag accent>{section.type}</Tag>
|
||||
</motion.div>
|
||||
))}
|
||||
|
||||
@@ -2,17 +2,15 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { motion } from 'motion/react'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { projects } from '@/data/projects'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { field } from '@/i18n/field'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
import { Link } from 'react-router'
|
||||
|
||||
|
||||
const MotionLink = motion.create(Link)
|
||||
|
||||
export function ProjectsListPage() {
|
||||
const { lang } = useLanguage()
|
||||
const { ui: s, content: c } = useI18n()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -26,9 +24,9 @@ export function ProjectsListPage() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.projects.all[lang]} tag={strings.projects.all[lang]} />
|
||||
<SectionHeading title={s.projects.all} tag={s.projects.all} />
|
||||
<div className="projects-grid">
|
||||
{projects.map((project, i) => (
|
||||
{c.projects.map((project, i) => (
|
||||
<MotionLink
|
||||
key={project.id}
|
||||
to={`/projects/${project.id}`}
|
||||
@@ -41,12 +39,12 @@ export function ProjectsListPage() {
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<div className="project-card-header">
|
||||
<h3>{field(lang, project.title, project.titleEn)}</h3>
|
||||
<h3>{project.title}</h3>
|
||||
<Badge variant="outline">
|
||||
{strings.projects.categories[project.category][lang]}
|
||||
{s.projects.categories[project.category]}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="project-card-summary">{field(lang, project.summary, project.summaryEn)}</p>
|
||||
<p className="project-card-summary">{project.summary}</p>
|
||||
<div className="project-card-techs">
|
||||
{project.technologies.slice(0, 4).map((tech) => (
|
||||
<span key={tech} className="tag">
|
||||
@@ -54,7 +52,7 @@ export function ProjectsListPage() {
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="project-card-cta">{strings.projects.viewDetails[lang]} →</span>
|
||||
<span className="project-card-cta">{s.projects.viewDetails} →</span>
|
||||
</MotionLink>
|
||||
))}
|
||||
</div>
|
||||
|
||||
+29
-72
@@ -12,78 +12,35 @@ export type ProjectCategory =
|
||||
| "architecture"
|
||||
| "experiment";
|
||||
|
||||
export interface Project {
|
||||
id: string;
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
summary: string;
|
||||
summaryEn?: string;
|
||||
category: ProjectCategory;
|
||||
role: string;
|
||||
technologies: string[];
|
||||
metrics?: string[];
|
||||
featured: boolean;
|
||||
}
|
||||
// Stable id unions (spec-v4 §3.1). Text dictionaries are type-safe only against
|
||||
// closed unions: adding a content item means adding a union member, a structure
|
||||
// record, and its Vietnamese text — tsc catches a missing text entry, the
|
||||
// validator (src/i18n/validate.ts) catches id mismatches across documents.
|
||||
// SkillGroupId and PhilosophyId are internal keys and never appear in URLs.
|
||||
export type ProjectId =
|
||||
| 'iot-dws-integration'
|
||||
| 'awb-detection'
|
||||
| 'facility-management'
|
||||
| 'local-llm-experiments';
|
||||
|
||||
export interface ProjectSection {
|
||||
id: string;
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
content: string;
|
||||
contentEn?: string;
|
||||
type: "text" | "diagram" | "metrics" | "code";
|
||||
}
|
||||
export type ExperienceId =
|
||||
| 'open-to-work'
|
||||
| 'relax-gap'
|
||||
| 'lazada-senior-swe'
|
||||
| 'nexts-founder'
|
||||
| 'sap-senior-swe';
|
||||
|
||||
export interface ProjectDetail extends Project {
|
||||
sections: ProjectSection[];
|
||||
}
|
||||
export type SkillGroupId =
|
||||
| 'software-engineering'
|
||||
| 'system-architecture'
|
||||
| 'logistics-technology'
|
||||
| 'ai-ml'
|
||||
| 'infrastructure'
|
||||
| 'engineering-practices';
|
||||
|
||||
export interface ExperienceEntry {
|
||||
id: string;
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
company: string;
|
||||
duration: string;
|
||||
location?: string;
|
||||
responsibilities: string[];
|
||||
responsibilitiesEn?: string[];
|
||||
variant?: 'current' | 'gap';
|
||||
logo?: string;
|
||||
}
|
||||
|
||||
export interface SkillGroup {
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
skills: string[];
|
||||
}
|
||||
|
||||
export interface PhilosophyPoint {
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
description: string;
|
||||
descriptionEn?: string;
|
||||
keywords: string[];
|
||||
}
|
||||
|
||||
export interface Profile {
|
||||
name: string;
|
||||
nameEn: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
tagline: string;
|
||||
taglineEn?: string;
|
||||
bio: string;
|
||||
bioEn?: string;
|
||||
email: string;
|
||||
githubUrl: string;
|
||||
linkedinUrl: string;
|
||||
githubHandle: string;
|
||||
linkedinHandle: string;
|
||||
telegramUrl: string;
|
||||
telegramHandle: string;
|
||||
currentInterests: string[];
|
||||
roles: string[];
|
||||
philosophy: PhilosophyPoint[];
|
||||
}
|
||||
export type PhilosophyId =
|
||||
| 'build-for-the-real-problem'
|
||||
| 'think-in-systems'
|
||||
| 'measure-impact'
|
||||
| 'keep-learning'
|
||||
| 'business-domain-knowledge-is-a-key-of-success';
|
||||
@@ -6,6 +6,7 @@
|
||||
"module": "esnext",
|
||||
"types": ["vite/client"],
|
||||
"allowArbitraryExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
|
||||
Reference in new issue
Block a user