@@ -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 }}
>
diff --git a/src/data/experience.json b/src/data/experience.json
new file mode 100644
index 0000000..7755419
--- /dev/null
+++ b/src/data/experience.json
@@ -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"
+ }
+]
diff --git a/src/data/experience.ts b/src/data/experience.ts
index 250493c..d72bfc0 100644
--- a/src/data/experience.ts
+++ b/src/data/experience.ts
@@ -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[];
diff --git a/src/data/profile.json b/src/data/profile.json
new file mode 100644
index 0000000..d75b280
--- /dev/null
+++ b/src/data/profile.json
@@ -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"
+ ]
+ }
+ ]
+}
diff --git a/src/data/profile.ts b/src/data/profile.ts
index 0e995fa..d4a68c6 100644
--- a/src/data/profile.ts
+++ b/src/data/profile.ts
@@ -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,
yes, 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;
diff --git a/src/data/projects.json b/src/data/projects.json
new file mode 100644
index 0000000..7273ddf
--- /dev/null
+++ b/src/data/projects.json
@@ -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"
+ }
+ ]
+ }
+]
diff --git a/src/data/projects.ts b/src/data/projects.ts
index dfad229..bb39348 100644
--- a/src/data/projects.ts
+++ b/src/data/projects.ts
@@ -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[];
diff --git a/src/data/skills.json b/src/data/skills.json
new file mode 100644
index 0000000..d47a1a6
--- /dev/null
+++ b/src/data/skills.json
@@ -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"
+ ]
+ }
+]
diff --git a/src/data/skills.ts b/src/data/skills.ts
index 066324a..f2ab923 100644
--- a/src/data/skills.ts
+++ b/src/data/skills.ts
@@ -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[];
diff --git a/src/i18n/dict-types.ts b/src/i18n/dict-types.ts
new file mode 100644
index 0000000..5cd8a27
--- /dev/null
+++ b/src/i18n/dict-types.ts
@@ -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
;
+};
+
+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;
+};
+
+export type ContentVi = {
+ profile: ProfileText;
+ skills: Record;
+ experience: Record;
+ projects: Record;
+};
+
+// Defined here — PartialDeep is NOT a TypeScript builtin.
+// Objects: every key optional + recursed. Arrays: atomic (whole-array
+// fallback, never per-item).
+type PartialDeep = T extends readonly unknown[]
+ ? T
+ : T extends object
+ ? { [K in keyof T]?: PartialDeep }
+ : T;
+
+export type ContentEn = { [K in keyof ContentVi]?: PartialDeep };
+
+// --- 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;
diff --git a/src/i18n/field.ts b/src/i18n/field.ts
deleted file mode 100644
index e0f7610..0000000
--- a/src/i18n/field.ts
+++ /dev/null
@@ -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(lang: Language, value: T, valueEn: T | undefined): T {
- return lang === 'vi' ? value : (valueEn ?? value)
-}
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
new file mode 100644
index 0000000..df53917
--- /dev/null
+++ b/src/i18n/index.ts
@@ -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(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 = { ...(base as Record) };
+ for (const [key, value] of Object.entries(patch as Record)) {
+ out[key] = deepMerge(out[key], value);
+ }
+ return out as T;
+}
+
+const mergedEn: ContentVi = deepMerge(contentVi, contentEn);
+
+export const UI: Record = { 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 & {
+ 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 &
+ Omit & { 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 = {
+ vi: joinContent(contentVi),
+ en: joinContent(mergedEn),
+};
diff --git a/src/i18n/locales/en/content.json b/src/i18n/locales/en/content.json
new file mode 100644
index 0000000..296eb86
--- /dev/null
+++ b/src/i18n/locales/en/content.json
@@ -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."
+ }
+ }
+ }
+ }
+}
diff --git a/src/i18n/locales/en/ui.json b/src/i18n/locales/en/ui.json
new file mode 100644
index 0000000..0c74715
--- /dev/null
+++ b/src/i18n/locales/en/ui.json
@@ -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"
+ }
+}
diff --git a/src/i18n/locales/vi/content.json b/src/i18n/locales/vi/content.json
new file mode 100644
index 0000000..ad7fe74
--- /dev/null
+++ b/src/i18n/locales/vi/content.json
@@ -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."
+ }
+ }
+ }
+ }
+}
diff --git a/src/i18n/locales/vi/ui.json b/src/i18n/locales/vi/ui.json
new file mode 100644
index 0000000..6f5b086
--- /dev/null
+++ b/src/i18n/locales/vi/ui.json
@@ -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"
+ }
+}
diff --git a/src/i18n/provider.tsx b/src/i18n/provider.tsx
new file mode 100644
index 0000000..5a2bcdc
--- /dev/null
+++ b/src/i18n/provider.tsx
@@ -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 = {
+ en: { ui: UI.en, content: CONTENT.en },
+ vi: { ui: UI.vi, content: CONTENT.vi },
+};
+
+const I18nContext = createContext(null);
+
+export function I18nProvider({
+ children,
+ override,
+}: {
+ children: React.ReactNode;
+ override?: ResolvedI18n;
+}) {
+ const { lang } = useLanguage();
+ return (
+
+ {children}
+
+ );
+}
+
+export function useI18n(): ResolvedI18n {
+ const context = useContext(I18nContext);
+ if (!context) {
+ throw new Error('useI18n must be used within I18nProvider');
+ }
+ return context;
+}
diff --git a/src/i18n/strings.ts b/src/i18n/strings.ts
deleted file mode 100644
index d9d9330..0000000
--- a/src/i18n/strings.ts
+++ /dev/null
@@ -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: '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.
',
- vi: '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: {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
diff --git a/src/i18n/validate.ts b/src/i18n/validate.ts
new file mode 100644
index 0000000..d6e2ce3
--- /dev/null
+++ b/src/i18n/validate.ts
@@ -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 | 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}`);
+ }
+}
diff --git a/src/pages/AboutPage.tsx b/src/pages/AboutPage.tsx
index 9e8b4ea..4ab3067 100644
--- a/src/pages/AboutPage.tsx
+++ b/src/pages/AboutPage.tsx
@@ -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 (
<>
@@ -25,21 +21,21 @@ export function AboutPage() {
}}
>
- {field(lang, profile.bio, profile.bioEn)}
+ {c.profile.bio}
- {strings.about.engineeringTitle[lang]}
+ {s.about.engineeringTitle}
- {profile.philosophy.map((point, i) => (
+ {c.profile.philosophy.map((point, i) => (
- {field(lang, point.title, point.titleEn)}
- {field(lang, point.description, point.descriptionEn)}
+ {point.title}
+ {point.description}
{point.keywords.map((kw) => (
{kw}
@@ -60,10 +56,10 @@ export function AboutPage() {
- {strings.about.exploringTitlePage[lang]}
+ {s.about.exploringTitlePage}
- {profile.currentInterests.map((interest) => (
+ {c.profile.currentInterests.map((interest) => (
{interest}
@@ -83,11 +79,11 @@ export function AboutPage() {
visible: { opacity: 1, transition: { duration: 0.5 } },
}}
>
-
+
- {skillGroups.map((group, i) => (
+ {c.skillGroups.map((group, i) => (
- {field(lang, group.title, group.titleEn)}
+ {group.title}
{group.skills.map((skill: string) => (
-
diff --git a/src/pages/ContactPage.tsx b/src/pages/ContactPage.tsx
index 1f080c1..9111d19 100644
--- a/src/pages/ContactPage.tsx
+++ b/src/pages/ContactPage.tsx
@@ -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 (
-
+
diff --git a/src/pages/ExperiencePage.tsx b/src/pages/ExperiencePage.tsx
index 5e3502c..3e83597 100644
--- a/src/pages/ExperiencePage.tsx
+++ b/src/pages/ExperiencePage.tsx
@@ -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 (
-
+
- {experiences.map((exp, i) => (
+ {c.experiences.map((exp, i) => (
-
{field(lang, exp.title, exp.titleEn)}
+
{exp.title}
{exp.company}
{exp.duration}
@@ -42,7 +39,7 @@ export function ExperiencePage() {
- {field(lang, exp.responsibilities, exp.responsibilitiesEn).map((r) => (
+ {exp.responsibilities.map((r) => (
- {r}
))}
@@ -50,8 +47,8 @@ export function ExperiencePage() {
))}
-
{strings.experience.tldr[lang]}
-
{strings.experience.tldrText[lang]}
+
{s.experience.tldr}
+
{s.experience.tldrText}
diff --git a/src/pages/PhilosophyPage.tsx b/src/pages/PhilosophyPage.tsx
index 8a70060..92c69b8 100644
--- a/src/pages/PhilosophyPage.tsx
+++ b/src/pages/PhilosophyPage.tsx
@@ -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 (
-
+
- {strings.philosophy.quotes.map((quote, i) => (
+ {s.philosophy.quotes.map((quote, i) => (
- {quote.title[lang]}
+ {quote.title}
-
+
+ {quote.details.map((detail, j) => (
+
{detail}
+ ))}
+
))}
diff --git a/src/pages/ProjectDetailPage.tsx b/src/pages/ProjectDetailPage.tsx
index 5840d6e..3c21baf 100644
--- a/src/pages/ProjectDetailPage.tsx
+++ b/src/pages/ProjectDetailPage.tsx
@@ -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}
>
- {strings.projectDetail.notFound[lang]}
+ {s.projectDetail.notFound}
- {strings.projectDetail.backToProjects[lang]} ←
+ {s.projectDetail.backToProjects} ←
@@ -54,7 +51,7 @@ export function ProjectDetailPage() {
variants={sectionVariants}
>
- {strings.projectDetail.backToProjects[lang]} ←
+ {s.projectDetail.backToProjects} ←
- {field(lang, project.title, project.titleEn)}
- {strings.projects.categories[project.category][lang]}
+ {project.title}
+ {s.projects.categories[project.category]}
- {field(lang, project.summary, project.summaryEn)}
+ {project.summary}
@@ -86,7 +83,7 @@ export function ProjectDetailPage() {
viewport={{ once: true, amount: 0.2 }}
transition={itemTransition(0.16)}
>
-
{strings.projectDetail.impact[lang]}
+
{s.projectDetail.impact}
{project.metrics.map((m) => (
@@ -103,7 +100,7 @@ export function ProjectDetailPage() {
viewport={{ once: true, amount: 0.2 }}
transition={itemTransition(0.24)}
>
- {strings.projectDetail.role[lang]}
+ {s.projectDetail.role}
{project.role}
@@ -113,7 +110,7 @@ export function ProjectDetailPage() {
viewport={{ once: true, amount: 0.2 }}
transition={itemTransition(0.32)}
>
- {strings.projectDetail.technologies[lang]}
+ {s.projectDetail.technologies}
{project.technologies.map((tech) => (
{tech}
@@ -129,7 +126,7 @@ export function ProjectDetailPage() {
viewport={{ once: true, amount: 0.2 }}
transition={itemTransition(0.4)}
>
- {strings.projectDetail.experiments[lang]}
+ {s.projectDetail.experiments}
{project.sections.map((section, idx) => (
- {field(lang, section.title, section.titleEn)}
- {field(lang, section.content, section.contentEn)}
+ {section.title}
+ {section.content}
{section.type}
))}
diff --git a/src/pages/ProjectsListPage.tsx b/src/pages/ProjectsListPage.tsx
index 6fa2b31..fef0343 100644
--- a/src/pages/ProjectsListPage.tsx
+++ b/src/pages/ProjectsListPage.tsx
@@ -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 (
-
+
- {projects.map((project, i) => (
+ {c.projects.map((project, i) => (
-
{field(lang, project.title, project.titleEn)}
+ {project.title}
- {strings.projects.categories[project.category][lang]}
+ {s.projects.categories[project.category]}
- {field(lang, project.summary, project.summaryEn)}
+ {project.summary}
{project.technologies.slice(0, 4).map((tech) => (
@@ -54,7 +52,7 @@ export function ProjectsListPage() {
))}
- {strings.projects.viewDetails[lang]} →
+ {s.projects.viewDetails} →
))}
diff --git a/src/types/index.ts b/src/types/index.ts
index edee98e..1d38057 100644
--- a/src/types/index.ts
+++ b/src/types/index.ts
@@ -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';
diff --git a/tsconfig.app.json b/tsconfig.app.json
index 2554713..e504e29 100644
--- a/tsconfig.app.json
+++ b/tsconfig.app.json
@@ -6,6 +6,7 @@
"module": "esnext",
"types": ["vite/client"],
"allowArbitraryExtensions": true,
+ "resolveJsonModule": true,
"skipLibCheck": true,
"baseUrl": ".",
"paths": {