How hoojinguyen/portfolio-by-ai works
Main Components
a. Frontend Framework: The backbone is Next.js, which manages the server-side rendering, routing, and overall application lifecycle. This is visible in the “src/app” directory (layout.tsx, page.tsx, globals.css).
c. Configuration and Content Data: The “src/config” folder holds JSON files (portfolio.json, profile.json, resume.json, skills.json) which likely provide dynamic content or configuration for the portfolio.
d. Theme and Context Management: The “src/context/ThemeContext.tsx” is dedicated to managing the dark/light mode functionality, ensuring a consistent theme across components.
e. Utility Libraries: The “src/lib” folder contains helper functions (like utils.ts and iconMap.tsx) to support common functionalities and asset mapping.
f. Public Assets: The “public” directory (and its “images” subfolder) contains static resources that are served directly, such as images that the portfolio might display.
g. Build and Configuration Files: Files like next.config.ts, package.json, tsconfig.json, and configuration files for ESLint, Prettier, and PostCSS indicate the toolchain and deployment settings.
Relationships and Data Flow
• A container for the Next.js entry point (src/app).
• Within this container, show how the layout (layout.tsx) and the main page (page.tsx) feed in the various UI components.
• Flow from the layout to individual components:
• A separate block for configuration (src/config) that feeds dynamic data into components via props or context.
• ThemeContext as a provider that wraps around components ensuring consistent theming.
• Animation libraries:
• Separate blocks for “MagicUI” and “ArtifactUI” components (found under “src/components/magicui” and “src/components/artifactui” respectively) that are integrated directly within the UI components to provide advanced animations.
• Static Assets:
• “public” folder supplying assets (images, etc.) directly to components.
• Tooling & Build Process:
• Optionally, include a small block that highlights integration with ESLint, Prettier, and build scripts (like next.config.ts and package-lock.json) that ensure code quality and correct deployment.
Architectural Patterns and Design Principles
• Modular Design: The project divides responsibilities into clear directories (app, components, config, context, lib), following a modular component-based approach.
• Separation of Concerns: UI logic (in components) is separated from configuration (in JSON files) and context (for theming).
• Client-Side and Server-Side Blend: Leveraging Next.js allows you to combine server-side and client-side rendering where needed, even though most of the content here is static or pre-rendered.
• Reusability and Extensibility: The components are built for reusability (with specialized animations as separate components) and can be easily enhanced or replaced.
Final Checklist for Inclusion
• From configuration to UI components.
• From ThemeContext to all parts of the UI.
• Between UI components and external libraries used for animations.
• Keep details that show both the high-level architecture (entry point, modules, libraries) and the nuances inside the application (like the animation components and theme management).