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:
dong.nguyen committed 2026-10-22 07:29:06 +07:00
1 parent f5687cce1c
commit e6b4d83084
50 files changed
+2215 -961

No files matched your search

+7 -2
View File
@@ -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>
+8 -7
View File
@@ -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">
&copy; {year} {profile.name}. {strings.footer.copyright[lang]}
&copy; {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">
+23 -22
View File
@@ -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>
+12 -11
View File
@@ -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>
+4 -5
View File
@@ -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 -3
View File
@@ -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
+11 -14
View File
@@ -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>
+3 -4
View File
@@ -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>
+5 -5
View File
@@ -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>
+8 -11
View File
@@ -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>
+7 -10
View File
@@ -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">
+21 -14
View File
@@ -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"
+9 -12
View File
@@ -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>
))}
+3 -4
View File
@@ -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 }}
+13 -15
View File
@@ -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>
))}
+6 -7
View File
@@ -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
+3 -4
View File
@@ -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 }}
>
+34
View File
@@ -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
View File
@@ -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[];
+69
View File
@@ -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
View File
@@ -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;
+131
View File
@@ -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
View File
@@ -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[];
+64
View File
@@ -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
View File
@@ -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[];
+109
View File
@@ -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;
-14
View File
@@ -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)
}
+136
View File
@@ -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),
};
+120
View File
@@ -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."
}
}
}
}
}
+128
View File
@@ -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"
}
}
+188
View File
@@ -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."
}
}
}
}
}
+128
View File
@@ -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"
}
}
+45
View File
@@ -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;
}
-130
View File
@@ -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
+144
View File
@@ -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
View File
@@ -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">
+3 -4
View File
@@ -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>
+8 -11
View File
@@ -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>
+11 -8
View File
@@ -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>
+15 -18
View File
@@ -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>
))}
+9 -11
View File
@@ -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
View File
@@ -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';