# curl-kawsar/kawsar-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/curl-kawsar/kawsar-portfolio
- Repository: https://github.com/curl-kawsar/kawsar-portfolio

## Overview

##### Project type and purpose
- The project is a Next.js web application bootstrapped with create‑next‑app. Its purpose is to serve a modern web experience, combining rich interactive UI components (such as 3D visuals, timelines, animated tooltips, a code editor, and more) with API endpoints and static content. The presence of data files (e.g., achievementData.js, projectData.js, globe.json) and visual UI components suggests that it’s designed as an interactive, content‐rich personal or portfolio site, possibly with elements of data visualization.
- The README highlights basic Next.js usage, server startup techniques, and deployment on Vercel, confirming its nature as a full-stack, server-side rendered / statically optimized web application.

##### File structure
- Top-level files: Standard configuration files like package.json, jsconfig.json, next.config.mjs, and styling files (globals.css) indicate a well‐configured Next.js app.
- Key directories:
- The “src/app” directory holds core pages and API routes (e.g., the API at src/app/api/code/route.js). This is the entry point for routing and server-side functionality.
- The “src/components/ui” directory contains a variety of UI elements (e.g., 3d-card, achievements, globe, timeline, etc.) that are used throughout the site.
- The “src/data” directory provides JSON and JavaScript files supplying dynamic content (experience, education, skills, projects, and more), supporting the visualization through components.
- “src/lib” and “src/utils” host shared utilities and helper functions, contributing to the overall project functionality.
- This structure indicates a clear separation of concerns: static assets, components/UI, API logic, and data management.

##### README for extra insights
- Although the README is brief, key points include the usage of Next.js’ built‑in features (like next/font) and guidance for development and deployment.
- The README points to Next.js documentation, which means the design should accommodate both client-side interactions (rich UI components) and server-side logic (API endpoints).

a. Main components:
- Client/Browser: Represents the end-user device viewing the application.
- Next.js Frontend: This includes:
- The “app” directory housing layouts, page components, global styles (layout.jsx, globals.css, and page.jsx).
- The “components/ui” folder encapsulating all individual UI components (e.g., animated-tooltip, 3d visualizations, timelines). These components contribute to the UI rendering and interactivity.
- API Layer: Located within “src/app/api”, this is the serverless backend that handles data requests (for example, the route at src/app/api/code/route.js) and any dynamic server-side processing.
- Data Layer: Consists of data files in “src/data” that feed content to the UI. Think of these as content providers (achievements, skills, experience, etc.).
- Utility/Helper Modules: Found in “src/lib” and “src/utils”, these include utility functions and shared helper code used across the application.
- Static Assets: The “public” directory, containing assets like images, PDFs, and manifest files.
- (Optional) External Services: Although not explicitly listed, include a note that deployment is typically done on Vercel, so Vercel’s hosting/CDN could be represented as an external dependency.

b. Relationships and interactions between these components:
- The client (browser) sends requests that are routed via Next.js’ internal routing. The main “app” pages serve as entry points, which then integrate various reusable UI components.
- UI components retrieve content from the local data layer or interact with API endpoints for dynamic operations.
- Utility libraries support various operations across both frontend and API routes.
- Static assets are directly served to the client as needed.
- Vercel (or another hosting provider) manages the deployment and CDN distribution, ensuring fast global delivery.

c. Architectural patterns and design principles:
- Component-Based Architecture: The project’s modular design (via “src/components/ui”) makes it easy to maintain and extend.
- Separation of Concerns: Clean division between pages (routing), UI components (presentation), API endpoints (backend logic), static data, and helper utilities.
- Server-Side Rendering (SSR) and/or Static Site Generation (SSG): Leveraging Next.js’ native capabilities for optimal performance.
- Modern Web Practices: Use of a configuration-driven approach (configuration files like tailwind.config.mjs and postcss.config.mjs) that ensure a responsive and scalable design.

d. Relevant technologies/frameworks:
- Next.js as the primary framework.
- Tailwind CSS (as indicated by tailwind.config.mjs) for styling.
- Modern JavaScript and optionally TypeScript (notice the use of .ts and .tsx files, and types declarations like three-globe.d.ts).
- Possibly Three.js or similar 3D libraries (hinted by components like 3d-card.jsx and globe.jsx).
- Vercel for hosting and deployment.

## Diagram (Mermaid)

```mermaid
graph TD
    browser("Browser"):::client

    subgraph "Next.js Frontend - Pages & Layout"
        layout("Layout (src/app/layout.jsx)"):::frontend
        page("Page (src/app/page.jsx)"):::frontend
        globals("Global Styles (src/app/globals.css)"):::frontend
    end

    ui("UI Components"):::frontend
    api("API Endpoints"):::api
    data("Data Providers"):::data

    subgraph "Utility Modules"
        lib("Lib (src/lib)"):::utils
        utils("Utils (src/utils)"):::utils
    end

    static("Static Assets"):::static
    deployment("Vercel Hosting"):::deployment

    browser -->|"load"| layout
    browser -->|"load-assets"| static

    layout -->|"renders-UI"| ui
    page -->|"renders-UI"| ui
    globals -->|"applies-styles"| ui

    layout -->|"calls-API"| api
    page -->|"calls-API"| api

    ui -->|"fetches-data"| data
    ui -->|"calls-API"| api

    lib -->|"supports"| layout
    lib -->|"supports"| page
    lib -->|"supports"| api

    utils -->|"assists"| layout
    utils -->|"assists"| page
    utils -->|"assists"| api

    deployment -->|"serves"| browser
    deployment -->|"hosts-pages"| layout
    deployment -->|"hosts-API"| api
    deployment -->|"serves-assets"| static

    click layout "https://github.com/curl-kawsar/kawsar-portfolio/blob/main/src/app/layout.jsx"
    click page "https://github.com/curl-kawsar/kawsar-portfolio/blob/main/src/app/page.jsx"
    click globals "https://github.com/curl-kawsar/kawsar-portfolio/blob/main/src/app/globals.css"
    click ui "https://github.com/curl-kawsar/kawsar-portfolio/tree/main/src/components/ui"
    click api "https://github.com/curl-kawsar/kawsar-portfolio/blob/main/src/app/api/code/route.js"
    click data "https://github.com/curl-kawsar/kawsar-portfolio/tree/main/src/data"
    click lib "https://github.com/curl-kawsar/kawsar-portfolio/tree/main/src/lib"
    click utils "https://github.com/curl-kawsar/kawsar-portfolio/tree/main/src/utils"
    click static "https://github.com/curl-kawsar/kawsar-portfolio/tree/main/public"

    classDef frontend fill:#ace,stroke:#333,stroke-width:2px;
    classDef client fill:#fdb,stroke:#333,stroke-width:2px;
    classDef api fill:#faa,stroke:#333,stroke-width:2px;
    classDef data fill:#afa,stroke:#333,stroke-width:2px;
    classDef utils fill:#ff9,stroke:#333,stroke-width:2px;
    classDef static fill:#cdf,stroke:#333,stroke-width:2px;
    classDef deployment fill:#cfc,stroke:#333,stroke-width:2px;
```
