# natnaelsisay/reactfolio architecture

> Architecture diagram of the GitHub repository natnaelsisay/reactfolio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/natnaelsisay/reactfolio
- Repository: https://github.com/natnaelsisay/reactfolio

## Overview

##### Project Type and Purpose
- This is a front-end only, component-based React single-page application (SPA).
- Purpose: Serve as a personal portfolio site with pages for Home, About, Articles, Projects, Contact, and a Resume link.

##### File Structure
- Top-level artifacts:
- public/: static entrypoint (index.html, robots.txt)
- src/: React source code
- src/components/: feature and common UI components
- src/pages/: route-based page components
- src/data/: static data modules (user info, API abstractions)
- configuration/build scripts (package.json, script.sh, sonar-project.properties)

##### Architecture Patterns
- Component-based design (reusable UI building blocks under src/components).
- Page routing (each file in src/pages corresponds to a route in the SPA).
- Single bundle build via Create React App (CRA) conventions (index.js → App → ReactDOM.render).
- Static data layer (src/data) supplying user content to components.

##### Main Components and Relationships
a. Client (Browser)
- Serves index.html → loads JavaScript bundle.
b. React App Root
- src/index.js → App.jsx
- App contains router logic and global CSS imports.
c. Pages (Route Handlers)
- Homepage, About, Articles, Projects, Contact, 404, ReadArticle
- Each page imports specific component modules.
d. Feature Components
- ContactForm, Article, AllProjects, Project, Resume, DynamicIcon, Socials, etc.
e. Common UI Components
- NavBar, Footer, Logo, Card
f. Data Layer
- src/data/api.js: abstraction for fetching or serving data
- src/data/user.js: static user profile data
g. Styling
- CSS modules scoped to each component/page
h. Build & Deployment
- package.json scripts (start, build, test)
- script.sh (custom scripts)
- sonar-project.properties (static code analysis)

##### Elements
- UI Layer
- Data Layer
- Build/CI Layer

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        Browser["Browser/Client"]:::external
        IndexHTML["index.html"]:::ui
        click IndexHTML "https://github.com/natnaelsisay/reactfolio/blob/main/public/index.html"
        Browser -->|"serves"| IndexHTML

        IndexJS["src/index.js"]:::ui
        click IndexJS "https://github.com/natnaelsisay/reactfolio/blob/main/src/index.js"
        IndexHTML -->|"loads bundle"| IndexJS

        App["App (src/App.js)"]:::ui
        click App "https://github.com/natnaelsisay/reactfolio/blob/main/src/App.js"
        IndexJS -->|"renders"| App

        GlobalStyles["Global Styles"]:::ui
        GlobalStyles --> App
        click GlobalStyles "https://github.com/natnaelsisay/reactfolio/blob/main/src/index.css"
        click GlobalStyles "https://github.com/natnaelsisay/reactfolio/blob/main/src/app.css"
        click GlobalStyles "https://github.com/natnaelsisay/reactfolio/blob/main/src/styles.css"

        App --> Router["Router"]

        subgraph "Common Components"
            direction TB
            NavBar["NavBar"]:::ui
            click NavBar "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/common/navBar.jsx"
            Footer["Footer"]:::ui
            click Footer "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/common/footer.jsx"
            Logo["Logo"]:::ui
            click Logo "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/common/logo.jsx"
            Card["Card"]:::ui
            click Card "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/common/card.jsx"
        end

        App --> NavBar
        App --> Footer

        subgraph "Feature Components"
            direction TB
            ContactForm["ContactForm"]:::ui
            click ContactForm "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/ContactForm/index.jsx"
            DynamicIcon["DynamicIcon"]:::ui
            click DynamicIcon "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/dynamic-icon/index.jsx"
            ResumeComp["Resume"]:::ui
            click ResumeComp "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/resume/index.jsx"
            Socials["Socials"]:::ui
            click Socials "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/about/socials.jsx"
        end
    end

    %% Pages Layer
    subgraph "Pages"
        direction TB
        HomePage["HomePage"]:::ui
        click HomePage "https://github.com/natnaelsisay/reactfolio/blob/main/src/pages/homepage.jsx"
        AboutPage["About"]:::ui
        click AboutPage "https://github.com/natnaelsisay/reactfolio/blob/main/src/pages/about.jsx"
        ArticlesPage["Articles"]:::ui
        click ArticlesPage "https://github.com/natnaelsisay/reactfolio/blob/main/src/pages/articles.jsx"
        ReadArticlePage["ReadArticle"]:::ui
        click ReadArticlePage "https://github.com/natnaelsisay/reactfolio/blob/main/src/pages/readArticle.jsx"
        ProjectsPage["Projects"]:::ui
        click ProjectsPage "https://github.com/natnaelsisay/reactfolio/blob/main/src/pages/projects.jsx"
        ContactPage["Contact"]:::ui
        click ContactPage "https://github.com/natnaelsisay/reactfolio/blob/main/src/pages/contact.jsx"
        NotFoundPage["404"]:::ui
        click NotFoundPage "https://github.com/natnaelsisay/reactfolio/blob/main/src/pages/404.jsx"

        Router --> HomePage
        Router --> AboutPage
        Router --> ArticlesPage
        Router --> ReadArticlePage
        Router --> ProjectsPage
        Router --> ContactPage
        Router --> NotFoundPage

        %% HomePage children
        subgraph "HomePage Components"
            direction TB
            WorksList["Works"]:::ui
            click WorksList "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/homepage/works.jsx"
            ArticleHome["Article (Home)"]:::ui
            click ArticleHome "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/homepage/article.jsx"
        end
        HomePage --> WorksList
        HomePage --> ArticleHome

        %% Articles Page children
        subgraph "Articles Components"
            direction TB
            ArticleList["Article (Articles)"]:::ui
            click ArticleList "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/articles/article.jsx"
        end
        ArticlesPage --> ArticleList

        %% ReadArticle children
        subgraph "ReadArticle Components"
            direction TB
            ArticleDetail["Article Detail"]:::ui
            click ArticleDetail "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/articles/article.jsx"
        end
        ReadArticlePage --> ArticleDetail

        %% Projects children
        subgraph "Projects Components"
            direction TB
            AllProjects["AllProjects"]:::ui
            click AllProjects "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/projects/allProjects.jsx"
            ProjectComp["Project"]:::ui
            click ProjectComp "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/projects/project.jsx"
        end
        ProjectsPage --> AllProjects
        ProjectsPage --> ProjectComp

        %% Contact children
        subgraph "Contact Components"
            direction TB
            ContactFormPage["ContactForm"]:::ui
            click ContactFormPage "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/ContactForm/index.jsx"
        end
        ContactPage --> ContactFormPage

        %% About children
        subgraph "About Components"
            direction TB
            SocialsPage["Socials"]:::ui
            click SocialsPage "https://github.com/natnaelsisay/reactfolio/blob/main/src/components/about/socials.jsx"
        end
        AboutPage --> SocialsPage
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        API["api.js"]:::data
        click API "https://github.com/natnaelsisay/reactfolio/blob/main/src/data/api.js"
        UserData["user.js"]:::data
        click UserData "https://github.com/natnaelsisay/reactfolio/blob/main/src/data/user.js"
    end
    ArticleHome -->|"fetches/imports"| API
    ArticleList -->|"fetches/imports"| API
    ArticleDetail -->|"fetches/imports"| API
    AllProjects -->|"fetches/imports"| API
    UserData --> App

    %% Build & CI Layer
    subgraph "Build & Deployment"
        direction TB
        PackageJSON["package.json"]:::build
        click PackageJSON "https://github.com/natnaelsisay/reactfolio/blob/main/package.json"
        ScriptSH["script.sh"]:::build
        click ScriptSH "https://github.com/natnaelsisay/reactfolio/blob/main/script.sh"
        SonarProps["sonar-project.properties"]:::build
        click SonarProps "https://github.com/natnaelsisay/reactfolio/blob/main/sonar-project.properties"
    end
    PackageJSON --> App
    ScriptSH --> PackageJSON
    SonarProps --> PackageJSON

    %% Styles
    classDef ui fill:#AED6F1,stroke:#1B4F72,color:#1B2631
    classDef data fill:#A9DFBF,stroke:#196F3D,color:#145A32
    classDef build fill:#F5B041,stroke:#B9770E,color:#7E5109
    classDef external fill:#D7DBDD,stroke:#626567,color:#1C2833
```
