# chandrathen28/developer-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/chandrathen28/developer-portfolio
- Repository: https://github.com/chandrathen28/developer-portfolio

## Overview

##### Main Components Identification
- Frontend/UI Layer: Represented by the Next.js “app” directory. This includes pages (app/page.js, app/blog/page.js), layout (app/layout.js), and a variety of components that construct different sections of the portfolio (hero section, about, skills, projects, blog, etc.). Also include the static assets in “app/assets” (SVGs, Lottie files, images) and styling from “app/css”.
- Utility Layer: The “utils” folder contains helper scripts and data files (data for contacts, experience, skills, etc.). This layer supports both rendering UI content and API responses.
- Deployment & Infrastructure: Include Docker (with Dockerfile.dev, Dockerfile.prod, docker-compose.yml) which encapsulates the environment configuration. Also note the presence of environment variables from “.env.example” and deployment instructions (Vercel/Netlify) described in the README.
- External Services: Highlight external integrations such as GitHub (portfolio source), dev.to (for fetching blog posts), Telegram (for bot notifications), and Gmail (via nodemailer).

##### Relationships and Interactions
- Frontend interacts with the backend API endpoints for functionality like form submissions (contact form) and data fetching.
- The API endpoints may call external services (Google, Gmail, Telegram) to process requests.
- The utils folder is used by both the UI components and API endpoints to provide consistent data and helper functions.
- Docker is used to bundle and deploy the application; it interacts with both development and production environments, ensuring consistency across deployments.

##### Architectural Patterns and Design Principles
- The project follows the Next.js “app” directory structure which is similar to a component-based architecture, incorporating both server-side and client-side rendering.
- API routes within “app/api” allow for a separation of concerns between view rendering and server logic.
- Organized reuse of UI components (e.g., hero sections, blogs, cards) supports modular design.
- Dockerization and environment variable configuration reflect best practices for deployment and scalability.

##### Relevant Technologies and Frameworks
- Next.js for server-side rendering and routing.
- React for component-based UI.
- Tailwind CSS and SCSS for styling.
- Docker for containerized development.
- Integration with GitHub, Vercel/Netlify for CI/CD and deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD

    subgraph "Frontend/UI"
        F1["Page (app/page.js)"]:::frontend
        F2["Layout (app/layout.js)"]:::frontend
        F3["Blog Page (app/blog/page.js)"]:::frontend
        F4["Components (app/components)"]:::frontend
        F5["Assets (app/assets)"]:::frontend
        F6["Styles (app/css)"]:::frontend
    end

    subgraph "Backend/API"
        B1["Contact API (app/api/contact/route.js)"]:::api
        B2["Data API (app/api/data/route.js)"]:::api
        B3["Google API (app/api/google/route.js)"]:::api
    end

    subgraph "Utils/Helpers"
        U1["Email Check (utils/check-email.js)"]:::utils
        U2["Data Utils (utils/data)"]:::utils
    end

    subgraph "Deployment & Infrastructure"
        D1["Dockerfile.dev"]:::deploy
        D2["Dockerfile.prod"]:::deploy
        D3["docker-compose.yml"]:::deploy
        D4[".env.example"]:::deploy
    end

    subgraph "External Services"
        E1["GitHub"]:::external
        E2["Gmail (nodemailer)"]:::external
        E3["Telegram Bot"]:::external
        E4["dev.to"]:::external
        E5["Google"]:::external
    end

    %% Relationships between Frontend and API
    F4 -->|"submitContact"| B1
    F4 -->|"fetchBlogs"| B2
    F4 -->|"googleIntegration"| B3

    %% Relationships from Utils to Frontend and API
    U1 ---|"support"| F4
    U1 ---|"support"| B1
    U2 ---|"support"| F4
    U2 ---|"support"| B2

    %% Deployment supports Frontend and API
    D1 -->|"build"| F4
    D2 -->|"build"| F4
    D3 -->|"orchestrate"| B1
    D3 -->|"orchestrate"| B2
    D3 -->|"orchestrate"| B3
    D4 -->|"config"| F4

    %% API to External Services interactions
    B1 -->|"sendEmail"| E2
    B1 -->|"notify"| E3
    B2 -->|"fetchPosts"| E4
    B3 -->|"integrate"| E5

    %% Source control integration from Frontend to External
    F4 -->|"sourceControl"| E1

    %% Styling Classes
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef api fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef utils fill:#FFFACD,stroke:#000,stroke-width:2px;
    classDef deploy fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef external fill:#FFA07A,stroke:#000,stroke-width:2px;

    %% Click Events for Frontend/UI Layer
    click F1 "https://github.com/chandrathen28/developer-portfolio/blob/main/app/page.js"
    click F2 "https://github.com/chandrathen28/developer-portfolio/blob/main/app/layout.js"
    click F3 "https://github.com/chandrathen28/developer-portfolio/blob/main/app/blog/page.js"
    click F4 "https://github.com/chandrathen28/developer-portfolio/tree/main/app/components"
    click F5 "https://github.com/chandrathen28/developer-portfolio/tree/main/app/assets"
    click F6 "https://github.com/chandrathen28/developer-portfolio/tree/main/app/css"

    %% Click Events for API Layer
    click B1 "https://github.com/chandrathen28/developer-portfolio/blob/main/app/api/contact/route.js"
    click B2 "https://github.com/chandrathen28/developer-portfolio/blob/main/app/api/data/route.js"
    click B3 "https://github.com/chandrathen28/developer-portfolio/blob/main/app/api/google/route.js"

    %% Click Events for Utils/Helpers
    click U1 "https://github.com/chandrathen28/developer-portfolio/blob/main/utils/check-email.js"
    click U2 "https://github.com/chandrathen28/developer-portfolio/tree/main/utils/data"

    %% Click Events for Deployment & Infrastructure
    click D1 "https://github.com/chandrathen28/developer-portfolio/blob/main/Dockerfile.dev"
    click D2 "https://github.com/chandrathen28/developer-portfolio/blob/main/Dockerfile.prod"
    click D3 "https://github.com/chandrathen28/developer-portfolio/blob/main/docker-compose.yml"
    click D4 "https://github.com/chandrathen28/developer-portfolio/blob/main/.env.example"
```
