How hochu-shunsuke/portfolio works
Main Components
• App Layer (Next.js Application):
– Located in the “app” directory.
– Contains layout.tsx, page.tsx, providers.tsx and globals.css which together set up the overall page structure, layout, and context providers.
• Components Library:
– Numerous portfolio-specific components (e.g., hero-section, profile-card, project-card, and various sections) found under the “components” directory.
– UI-specific reusable components are further organized in the “components/ui” subdirectory containing controls (buttons, alerts, dialog, etc.).
• Hooks and Utilities:
– Custom hooks in the “hooks” directory (e.g., for mobile responsiveness and toast notifications).
– Shared utility functions in “lib” (such as utils.ts) to assist various parts of the application.
• Styling and Configuration:
– Global styles are found in “styles” and “app/globals.css”.
– Tailwind configuration files (tailwind.config.ts) and PostCSS config (postcss.config.mjs) control styling behavior.
• Public Assets:
• Project Infrastructure and Configuration Files:
– Next.js configuration (next.config.mjs and tsconfig.json) and package management files (package.json, pnpm-lock.yaml, package-lock.json) define build and deployment settings.
Relationships and Interactions
• The App Layer is at the core of the project:
– Next.js’s app/page.tsx acts as the entry point and layout.tsx provides the general page structure and wraps pages in providers (from providers.tsx).
– This layer connects directly with both the Components Library and external assets (styles, images).
• Components Library:
– The portfolio-specific section components (hero-section, about/profile sections, projects, etc.) are integrated into the main pages from the App Layer.
– These components, depending on the page, may also leverage components from the UI sublibrary for common interface elements (like buttons, dialogs, etc.).
– Each component is modular and can depend on specific hooks (e.g., mouse-follower, use-toast, use-mobile) for enhanced interactivity.
• Hooks and Lib:
– Custom hooks interact with various components to provide behavioral aspects (e.g., responsiveness or notifications), while the lib directory contains helper functions used across multiple components.
• Configuration and Styling:
– The Tailwind configuration influences the styling of the entire application which is reflected in both app-level CSS files and individual component styles.
• Public Assets:
– These are served by Next.js as static resources and are referenced in components/images, styling files, or configuration.
Architectural Patterns and Design Principles
• Component-Based Architecture:
– The project emphasizes a modular approach where UI elements, portfolio sections, and layout wrappers are all encapsulated as components.
• Separation of Concerns:
– The “app” folder handles routing and layout, the “components” folder provides discrete UI/portfolio elements, “hooks” concentrate on logic and state management, and “lib” focuses on utility functions.
• Reusability and Extensibility:
– The dedicated UI components and the clear separation between custom portfolio sections and generic UI parts allow for easy reuse and future expansion.
• Integration with Next.js Specific Patterns:
– By using the new “app” directory and layout patterns provided by Next.js, the project takes advantage of built-in page routing, dynamic loading, and server-side rendering where needed.