# mathavanne/maddy-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/mathavanne/maddy-portfolio
- Repository: https://github.com/mathavanne/maddy-portfolio

## Overview

##### Project type and purpose
- This is a full-stack developer portfolio website built with Next.js (app directory), using React components for the UI, Tailwind/Sass for styling, and Node-style serverless API routes (app/api) for contact and Google integrations.
- Purpose: showcase personal data, skills, projects, blog posts, and provide a contact form with email delivery via EmailJS and spam protection via reCAPTCHA.

##### File structure
- Top-level configuration: next.config.js, tailwind.config.js, postcss.config.js, jsconfig.json, .eslintrc.json.
- app/
- api/contact/route.js – handles contact form submissions (POST → EmailJS)
- api/google/route.js – handles Google Analytics or Google-related calls
- blog/[slug] – dynamic routes for blog posts
- components/ – React UI components grouped by feature (homepage sections, helpers, navbar, footer)
- css/ – global and component-level SCSS files
- layout.js, page.js – top-level layout and entry page
- public/ – static assets (images, SVGs, Lottie animations)
- utils/ – client-side helper modules and static “data” (JSON exports for personal data, skills, projects, etc.)

##### Key insights from README
- Uses EmailJS for mail delivery, Google Tag Manager for analytics, and reCAPTCHA for spam protection.
- Data is configurable via utils/data/*.js, and the site is deployed as a static/SSR Next.js app.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Deployment and Hosting
    DevEnv["Yarn/NPM"]:::config
    Build["Next.js Build"]:::config
    CDN["CDN / Hosting (Vercel/Netlify)"]:::external
    PublicAssets["Public Assets<br/>(public/)"]:::external

    DevEnv -->|build| Build
    Build -->|deploy| CDN
    Build -->|includes static assets| PublicAssets

    %% Browser
    Browser["Browser (User Agent)"]:::frontend

    Browser -->|HTTP request| CDN
    CDN -->|serves pages| Frontend

    Browser -->|POST /api/contact| ContactAPI
    Browser -->|analytics events| GoogleTagManager

    %% Frontend Layer
    subgraph "Frontend Layer (React/Next.js)" 
        direction TB
        subgraph "Pages"
            direction TB
            Layout["app/layout.js"]:::frontend
            Entry["app/page.js"]:::frontend
            subgraph "Blog Pages"
                direction TB
                BlogIndex["app/blog/page.js"]:::frontend
                BlogSlug["app/blog/[slug]/page.js"]:::frontend
            end
        end
        subgraph "UI Components"
            direction TB
            Navbar["Navbar<br/>(app/components/navbar.jsx)"]:::frontend
            Footer["Footer<br/>(app/components/footer.jsx)"]:::frontend
            subgraph "Homepage Sections"
                direction TB
                Hero["Hero Section<br/>(app/components/homepage/hero-section/index.jsx)"]:::frontend
                About["About Section<br/>(app/components/homepage/about/index.jsx)"]:::frontend
                BlogPreview["Blog Preview<br/>(app/components/homepage/blog/index.jsx)"]:::frontend
                BlogCard["Blog Card<br/>(app/components/homepage/blog/blog-card.jsx)"]:::frontend
                Education["Education Section<br/>(app/components/homepage/education/index.jsx)"]:::frontend
                Experience["Experience Section<br/>(app/components/homepage/experience/index.jsx)"]:::frontend
                Projects["Projects Section<br/>(app/components/homepage/projects/index.jsx)"]:::frontend
                ProjectCard["Project Card<br/>(app/components/homepage/projects/project-card.jsx)"]:::frontend
                SingleProject["Single Project<br/>(app/components/homepage/projects/single-project.jsx)"]:::frontend
                Skills["Skills Section<br/>(app/components/homepage/skills/index.jsx)"]:::frontend
                ContactIndex["Contact Section<br/>(app/components/homepage/contact/index.jsx)"]:::frontend
                ContactWithCaptcha["Contact w/ reCAPTCHA<br/>(app/components/homepage/contact/contact-with-captcha.jsx)"]:::frontend
                ContactWithoutCaptcha["Contact w/o reCAPTCHA<br/>(app/components/homepage/contact/contact-without-captcha.jsx)"]:::frontend
            end
            subgraph "Helper Components"
                direction TB
                LottieAnimation["Lottie Animations<br/>(app/components/helper/animation-lottie.jsx)"]:::frontend
                GlowCard["Glow Card<br/>(app/components/helper/glow-card.jsx)"]:::frontend
                ScrollTop["Scroll-to-Top<br/>(app/components/helper/scroll-to-top.jsx)"]:::frontend
            end
        end
    end

    Frontend -->|renders with data| DataStore
    Frontend -->|fetch static assets| PublicAssets

    %% API Layer
    subgraph "Serverless API Layer" 
        direction TB
        ContactAPI["app/api/contact/route.js"]:::backend
        GoogleAPI["app/api/google/route.js"]:::backend
    end

    ContactAPI -->|validate| reCAPTCHA
    ContactAPI -->|send email| EmailJS

    %% Data Layer
    subgraph "Data Modules" 
        direction TB
        PersonalData["personal-data.js"]:::data
        SkillsData["skills.js"]:::data
        ProjectsData["projects-data.js"]:::data
        ExperienceData["experience.js"]:::data
        EducationData["educations.js"]:::data
        ContactConfig["contactsData.js"]:::data
    end
    subgraph "Utility Helpers"
        direction TB
        EmailValidation["utils/check-email.js"]:::data
        SkillImage["utils/skill-image.js"]:::data
        TimeConverter["utils/time-converter.js"]:::data
    end

    DataStore((Static Data Store)):::data
    DataStore --> PersonalData
    DataStore --> SkillsData
    DataStore --> ProjectsData
    DataStore --> ExperienceData
    DataStore --> EducationData
    DataStore --> ContactConfig
    DataStore --> EmailValidation
    DataStore --> SkillImage
    DataStore --> TimeConverter

    %% External Services
    subgraph "External Services" 
        direction TB
        EmailJS["EmailJS"]:::external
        reCAPTCHA["reCAPTCHA"]:::external
        GoogleTagManager["Google Tag Manager"]:::external
    end

    %% Build relationships
    Browser -->|build triggers| DevEnv

    %% Click Events
    click Layout "https://github.com/mathavanne/maddy-portfolio/blob/main/app/layout.js"
    click Entry "https://github.com/mathavanne/maddy-portfolio/blob/main/app/page.js"
    click BlogIndex "https://github.com/mathavanne/maddy-portfolio/blob/main/app/blog/page.js"
    click BlogSlug "https://github.com/mathavanne/maddy-portfolio/blob/main/app/blog/[slug]/page.js"
    click Navbar "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/navbar.jsx"
    click Footer "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/footer.jsx"
    click Hero "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/hero-section/index.jsx"
    click About "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/about/index.jsx"
    click BlogPreview "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/blog/index.jsx"
    click BlogCard "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/blog/blog-card.jsx"
    click Education "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/education/index.jsx"
    click Experience "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/experience/index.jsx"
    click Projects "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/projects/index.jsx"
    click ProjectCard "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/projects/project-card.jsx"
    click SingleProject "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/projects/single-project.jsx"
    click Skills "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/skills/index.jsx"
    click ContactIndex "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/contact/index.jsx"
    click ContactWithCaptcha "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/contact/contact-with-captcha.jsx"
    click ContactWithoutCaptcha "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/homepage/contact/contact-without-captcha.jsx"
    click LottieAnimation "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/helper/animation-lottie.jsx"
    click GlowCard "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/helper/glow-card.jsx"
    click ScrollTop "https://github.com/mathavanne/maddy-portfolio/blob/main/app/components/helper/scroll-to-top.jsx"
    click ContactAPI "https://github.com/mathavanne/maddy-portfolio/blob/main/app/api/contact/route.js"
    click GoogleAPI "https://github.com/mathavanne/maddy-portfolio/blob/main/app/api/google/route.js"
    click PersonalData "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/data/personal-data.js"
    click SkillsData "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/data/skills.js"
    click ProjectsData "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/data/projects-data.js"
    click ExperienceData "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/data/experience.js"
    click EducationData "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/data/educations.js"
    click ContactConfig "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/data/contactsData.js"
    click EmailValidation "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/check-email.js"
    click SkillImage "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/skill-image.js"
    click TimeConverter "https://github.com/mathavanne/maddy-portfolio/blob/main/utils/time-converter.js"
    click GlobalsSCSS "https://github.com/mathavanne/maddy-portfolio/blob/main/app/css/globals.scss"
    click CardSCSS "https://github.com/mathavanne/maddy-portfolio/blob/main/app/css/card.scss"
    click TailwindConfig "https://github.com/mathavanne/maddy-portfolio/blob/main/tailwind.config.js"
    click PostCSSConfig "https://github.com/mathavanne/maddy-portfolio/blob/main/postcss.config.js"
    click NextConfig "https://github.com/mathavanne/maddy-portfolio/blob/main/next.config.js"
    click JSConfig "https://github.com/mathavanne/maddy-portfolio/blob/main/jsconfig.json"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef backend fill:#DFF7DF,stroke:#28a745,color:#28a745
    classDef data fill:#FFF4D6,stroke:#DAA520,color:#DAA520
    classDef external fill:#F3D9FF,stroke:#8A2BE2,color:#8A2BE2
    classDef config fill:#E0E0E0,stroke:#666666,color:#333333
```
