# rkc3000/modern-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/rkc3000/modern-portfolio
- Repository: https://github.com/rkc3000/modern-portfolio

## Overview

##### Project type and purpose
- This is a full-stack Next.js application using React and Tailwind CSS for the frontend, Next.js API routes (serverless functions) for the backend, and Sanity.io as a headless CMS/data store.
- Its primary purpose is to fetch content (page info, experiences, projects, skills, socials) from the Sanity CMS and render a developer portfolio website.

##### File structure
Top-level directories and files:
- pages/
– pages/index.tsx (entry point)
– pages/_app.tsx (app wrapper)
– pages/api/*.ts (API routes: getExperience, getPageInfo, getProjects, getSkills, getSocials, plus hello)
- components/
– Reusable UI pieces (Header, Hero, About, Skills, Projects, ContactMe, ExperienceCard, ArcReactor, etc.)
- utils/
– fetchXXX.ts (client-side helpers that call either API routes or Sanity directly)
- sanity/
– Sanity Studio configuration (schemas, plugins, config, static assets)
- public/
- styles/
– CSS modules (Home.module.css) and global CSS (globals.css), Tailwind config
- sanity.ts
– Sanity client setup (dataset, project ID, token)

Configuration files:
- next.config.js
- package.json
- postcss.config.js, tailwind.config.js
- tsconfig.json, .eslintrc.json
- .env.example

##### README for additional insights
- Confirms that the project is bootstrapped with Create-Next-App.
- Mentions Next.js API routes and development commands.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client
    subgraph "Client"
        Browser["Web Browser"]:::ext
    end

    %% Frontend
    subgraph "Next.js Frontend"
        Index["pages/index.tsx"]:::frontend
        App["pages/_app.tsx"]:::frontend
        subgraph "UI Components"
            Hero["Hero"]:::ui
            Header["Header"]:::ui
            About["About"]:::ui
            SkillsComp["Skills"]:::ui
            Skill["Skill"]:::ui
            ProjectsComp["Projects"]:::ui
            ExperienceCard["ExperienceCard"]:::ui
            WorkExperience["WorkExperience"]:::ui
            ArcCenter["ArcCenterPart"]:::ui
            ArcReactor["ArcReactor"]:::ui
            BackgroundCircles["BackgroundCircles"]:::ui
            ContactMe["ContactMe"]:::ui
        end
    end

    %% API Layer
    subgraph "Next.js API Layer"
        subgraph "API Routes"
            ExpAPI["getExperience"]:::api
            PageInfoAPI["getPageInfo"]:::api
            ProjAPI["getProjects"]:::api
            SkillsAPI["getSkills"]:::api
            SocialsAPI["getSocials"]:::api
            HelloAPI["hello"]:::api
        end
    end

    %% Utilities
    subgraph Utilities
        fetchExp["fetchExperiences.ts"]:::util
        fetchPage["fetchPageInfo.ts"]:::util
        fetchProj["fetchProjects.ts"]:::util
        fetchSkills["fetchSkills.ts"]:::util
        fetchSocials["fetchSocials.ts"]:::util
        SanityClient["sanity.ts"]:::util
    end

    %% Sanity Headless CMS
    subgraph "Sanity Studio"
        Studio["Sanity Studio"]:::cms
        Schemas["schemas/*.js"]:::cms
    end

    SanityDB[(Sanity Datastore)]:::data

    %% Data Flows
    Browser -->|"HTTP GET"| Index
    Index -->|"renders UI"| Hero & Header & About & SkillsComp & ProjectsComp & ExperienceCard & WorkExperience & ArcCenter & ArcReactor & BackgroundCircles & ContactMe
    Index -.->|"CSR calls"| fetchPage & fetchExp & fetchProj & fetchSkills & fetchSocials
    fetchPage -->|"calls"| PageInfoAPI
    fetchExp -->|"calls"| ExpAPI
    fetchProj -->|"calls"| ProjAPI
    fetchSkills -->|"calls"| SkillsAPI
    fetchSocials -->|"calls"| SocialsAPI

    PageInfoAPI -->|"GROQ via"| SanityClient
    ExpAPI -->|"GROQ via"| SanityClient
    ProjAPI -->|"GROQ via"| SanityClient
    SkillsAPI -->|"GROQ via"| SanityClient
    SocialsAPI -->|"GROQ via"| SanityClient

    SanityClient -->|"reads/writes"| SanityDB
    Studio -->|"edits content"| SanityDB

    %% Click Events
    click Index "https://github.com/rkc3000/modern-portfolio/blob/main/pages/index.tsx"
    click App "https://github.com/rkc3000/modern-portfolio/blob/main/pages/_app.tsx"
    click About "https://github.com/rkc3000/modern-portfolio/blob/main/components/About.tsx"
    click ArcCenter "https://github.com/rkc3000/modern-portfolio/blob/main/components/ArcCenterPart.tsx"
    click ArcReactor "https://github.com/rkc3000/modern-portfolio/blob/main/components/ArcReactor.tsx"
    click BackgroundCircles "https://github.com/rkc3000/modern-portfolio/blob/main/components/BackgroundCircles.tsx"
    click ContactMe "https://github.com/rkc3000/modern-portfolio/blob/main/components/ContactMe.tsx"
    click ExperienceCard "https://github.com/rkc3000/modern-portfolio/blob/main/components/ExperienceCard.tsx"
    click Hero "https://github.com/rkc3000/modern-portfolio/blob/main/components/Hero.tsx"
    click Header "https://github.com/rkc3000/modern-portfolio/blob/main/components/Header.tsx"
    click ProjectsComp "https://github.com/rkc3000/modern-portfolio/blob/main/components/Projects.tsx"
    click SkillsComp "https://github.com/rkc3000/modern-portfolio/blob/main/components/Skills.tsx"
    click Skill "https://github.com/rkc3000/modern-portfolio/blob/main/components/Skill.tsx"
    click WorkExperience "https://github.com/rkc3000/modern-portfolio/blob/main/components/WorkExperience.tsx"
    click ExpAPI "https://github.com/rkc3000/modern-portfolio/blob/main/pages/api/getExperience.ts"
    click PageInfoAPI "https://github.com/rkc3000/modern-portfolio/blob/main/pages/api/getPageInfo.ts"
    click ProjAPI "https://github.com/rkc3000/modern-portfolio/blob/main/pages/api/getProjects.ts"
    click SkillsAPI "https://github.com/rkc3000/modern-portfolio/blob/main/pages/api/getSkills.ts"
    click SocialsAPI "https://github.com/rkc3000/modern-portfolio/blob/main/pages/api/getSocials.ts"
    click HelloAPI "https://github.com/rkc3000/modern-portfolio/blob/main/pages/api/hello.ts"
    click SanityClient "https://github.com/rkc3000/modern-portfolio/blob/main/sanity.ts"
    click fetchExp "https://github.com/rkc3000/modern-portfolio/blob/main/utils/fetchExperiences.ts"
    click fetchPage "https://github.com/rkc3000/modern-portfolio/blob/main/utils/fetchPageInfo.ts"
    click fetchProj "https://github.com/rkc3000/modern-portfolio/blob/main/utils/fetchProjects.ts"
    click fetchSkills "https://github.com/rkc3000/modern-portfolio/blob/main/utils/fetchSkills.ts"
    click fetchSocials "https://github.com/rkc3000/modern-portfolio/blob/main/utils/fetchSocials.ts"
    click Studio "https://github.com/rkc3000/modern-portfolio/tree/main/sanity/"
    click Schemas "https://github.com/rkc3000/modern-portfolio/tree/main/sanity/schemas/"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef frontend fill:#BBDEFB,stroke:#000,stroke-width:1px
    classDef api fill:#A5D6A7,stroke:#000,stroke-width:1px
    classDef util fill:#FFE082,stroke:#000,stroke-width:1px
    classDef cms fill:#FFCC80,stroke:#000,stroke-width:1px
    classDef data fill:#FFF59D,stroke:#000,stroke-width:1px
    classDef ext fill:#CFD8DC,stroke:#000,stroke-width:1px
```
