How mahdixd/mahdi-portfolio works
This project is a front-end portfolio template built with React that serves as a personal or developer portfolio website. The goal is to provide a visually appealing and modular interface where developers can display their skills, background, projects, and social media profiles. The codebase follows a component-based design with a clear separation between UI components, containers (which arrange sections), assets (images, fonts, Lottie animations), configuration files, and external integrations (like GitHub, Medium, and Twitter).
Main Components (Nodes)
• Browser/Client – The end-user interface that runs the React application.
• React Application (SPA) – Central node representing the entire app, powered by create‑react‑app.
• App Container – The “src/App.js” that acts as the entry point, integrating various components and setting up routing/layout.
• UI Containers – Each section of the portfolio is encapsulated in its own container (e.g., Greeting, Skills, Education, Experience, Projects, Blogs, Talks, Podcast, and Contact). Represent each container as separate nodes.
• Reusable Components – Within “src/components”, include smaller UI building blocks such as Header, Footer, Button, ToggleSwitch, BlogCard, AchievementCard, etc.
• Context and State Management – Represent the “src/contexts/StyleContext.js” and any hooks (like “useLocalStorage”) that control global state and theming.
• Assets – The “public” folder and “src/assets” directory house static resources (HTML, CSS, images, fonts, and Lottie animations) that the UI components reference.
• Configuration & Environment – Files such as “env.example” and the optional “.env” (configured by the user) provide runtime variables like GitHub tokens and Medium usernames for fetching external data.
• External Data Sources – GitHub APIs (to load GitHub repositories, profile, and pinned projects), Medium blogs, and Twitter timeline embedded via components. Represent these as external nodes that interact with the React application.
Relationships & Data Flow
• Within the React Application, show a hierarchical layout:
• The App Container (src/App.js) sits at the top, passing props and state to UI Containers.
• Each UI Container (greeting, skills, blogs, etc.) incorporates several Reusable Components.
• Connections between the configuration/environment node and the React Application to indicate that the app uses environment variables (e.g., REACT_APP_GITHUB_TOKEN) for external API calls.
• CI/CD pipeline:
• From source code (Git repository) through workflows (GitHub Actions and Docker Build) leading to the deployment target (Netlify, GitHub Pages, or Docker container).
Architectural Patterns & Design Principles
• Component-Based Architecture – Emphasize separation of UI components and containers based on responsibility.
• Single Page Application (SPA) Design – The entire portfolio runs as an SPA, which simplifies routing and state management.
• Separation of Concerns – Static assets, styles (“*.scss” and “*.css”), and configuration files are placed in their dedicated folders.
• Integration via Environment Variables – External API tokens and settings are loaded through a .env configuration file, clearly decoupling sensitive data from the code.