How moncydev/portfolio-website works
Overall Project Breakdown
• Project Type: A single-page, full-stack front-end application (portfolio website).
• Core Technologies: React for UI, TypeScript as the language, GSAP for animations, and ThreeJS/WebGL for rendering 3D models.
• Project Layers: Component layers (UI components), animation/interaction layers, asset management (public models and images), and context management (e.g., LoadingProvider).
Main Components
– Entry Point & Configuration:
• index.html and main.tsx: The HTML container and TypeScript entry point where React mounts.
• Configuration Files: Package.json, Vite config, ESLint, and various TS configs for building and linting.
– Public Assets:
• Public Folder: Contains static assets like images, models, and Draco decoders for optimized 3D model delivery.
• 3D Models: Under public/models, these include GLB and encrypted 3D assets, pointing to a specialized usage for interactive 3D content.
– Source Code (src directory):
• Core Application (App.tsx, App.css): The main container for the SPA.
• Components: A rich library of React components, such as Landing, About, Contact, Navbar, and a dedicated Character component which handles the 3D model scene (e.g., Scene.tsx, exports.ts, and multiple utilities for animation, decryption, mouse interactions, and resizing).
• Utility Modules: Provided in src/components/utils and src/components/Character/utils for handling animation (GSAP), text splitting, and other effects.
• Context and State Management: The context folder (LoadingProvider.tsx) manages application states such as loading states which are likely critical given the heavy animated/3D content.
• Data: Static data like boneData in the src/data directory which may be used for 3D character rigging or animations.
Relationships & Interactions
– The React UI (rendered via App.tsx) interacts with multiple component modules (Navbar, Landing, About, etc.) that make up the portfolio.
– The Character component integrates 3D rendering by using ThreeJS/WebGL. It interacts with specialized utilities for animations (using GSAP) and model handling (decryption, lighting, and mouse-based interactions).
– The LoadingProvider in the context layer provides global state control, ensuring the UI manages asynchronous loading of assets and initial animations.
– The public assets directory supports the dynamic loading of static files for images and 3D models that are consumed by various components.
Important Architectural Patterns/Design Principles
– Component-Based Architecture: React components are organized in a modular and hierarchical structure (e.g., separate folders for Character, utilities, styles).
– Separation of Concerns: The separation of UI, animations, state management, and asset handling is clearly visible (components vs. utilities vs. context).
– Integration of Animation and 3D Rendering: Specialized components and utilities show intentional modularity for smoothly integrating GSAP animations with ThreeJS's 3D rendering capabilities.
– Asset Management: Use of public directories for static resources, including encrypted/encoded models and decoders for efficient loading.