# sayantanmpaul/artistry-atlas architecture

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

- Interactive diagram: https://gitdiagram.com/sayantanmpaul/artistry-atlas
- Repository: https://github.com/sayantanmpaul/artistry-atlas

## Overview

##### Project Type & Purpose
- It is a Next.js web application bootstrapped with create‑next‑app.
- The project appears to be a portfolio or personal website that features both a client-facing experience (with pages like “learning”, “projects”, “work”, “technologies”, etc.) and an administrator section for managing content.
- There is integration with Sanity (a headless CMS) for managing dynamic content (as seen in the “sanity” directory and associated schemas).

##### File Structure
- The “app” folder is central – it contains distinct subdirectories for “(administrator)” and “(client)”. This routing segmentation indicates two different user flows: an admin interface and a public client interface.
- The “app” folder holds global layouts (layout.tsx, globals.css, page-wrapper.tsx), shared utility functions, and modular sections (such as “about-section”, “learning-section”, etc.) which are then pieced together across pages.
- The “components” folder provides reusable UI components (e.g., navigation, footer, preloader, theme switch) and even a nested “ui” subfolder, suggesting a component-driven design.
- Integration with Sanity is evident in the “sanity” folder (which includes configuration files, schema definitions for pages such as “about”, “education”, “experience”, etc.) and its supporting lib files for client interactions.
- Other directories like “constant”, “lib”, “types”, and configuration files (e.g., tailwind.config.ts, next.config.mjs) indicate standard dependency management, styling, and type safety elements.

##### Key Components
a. Client Interface:
- Primary public-facing pages: landing page (app/page.tsx), specific client pages (learning, projects, linktree, work, technologies) and corresponding sections assembled in “app/sections”.
- Role of shared UI components (in the “components” directory) that are integrated within these pages.
- Routing and layout management provided by the “app/layout.tsx” and related files.

b. Administrator Interface:
- Admin area under “app/(administrator)/admin” which universally handles administrative tasks (using dynamic routes like [[...index]] and layout files).
- That this part of the app is likely separate from the client route and is intended for content/admin management.

c. CMS Integration:
- Sanity as an external or integrated CMS component.
- Schemas (e.g., about, education, experience, links, projects, tools) and client libraries that allow the Next.js app to query and update content.

d. Shared Utilities & Global Services:
- “app/utils” and “lib” directories which contain helper functions and logic used across the app.
- Mention configuration files and utilities (like provider.tsx for context providers, animate.ts for transitions).

e. External Services & Deployment:
- External dependencies and services: Next.js framework itself, Vercel deployment pipeline (as suggested in the README), Tailwind CSS for styling, and possibly external APIs coming from Sanity.

##### Relationships & Interactions
- That the “app” folder is the hub where various routes and layouts come together.
- That utility modules and shared components provide services and UI consistency to both interfaces.
- That global configuration files (like next.config.mjs and tailwind.config.ts) underpin overall app behavior and styling.

##### Important Architectural Patterns/Design Principles
- A clear separation of concerns: distinct routing for admin vs. client, modular components (separation between views and reusable components), and integration with a headless CMS.
- Utilization of Next.js’s file-based routing (using the “app” folder structure) to handle dynamic layouts and lazy loading.
- Adoption of component-driven design with reusable UI elements.
- Incorporation of micro-frontends in a sense of mixing various page sections assembled from smaller components.

##### Specific Elements
- Clear labels for each main component (e.g., “Client Interface,” “Administrator Dashboard,” “CMS (Sanity),” “Global UI Components,” “Utilities & Services”).
- Notations for architectural patterns like “Next.js file-based routing”, “Component-driven UI”, and integrations such as “Tailwind CSS” and “Sanity”.

## Diagram (Mermaid)

```mermaid
flowchart TD
    U["User Request"]:::external
    A["Next.js App (app folder)"]:::app
    GL["Global Layout & Routing"]:::layout
    CI["Client Interface"]:::client
    AD["Administrator Dashboard"]:::admin
    MS["Modular Sections"]:::modules
    UI["Reusable UI Components"]:::components
    SU["Shared Utilities & Global Services"]:::utilities
    LIB["Lib Utilities"]:::utilities
    CMS["CMS (Sanity)"]:::cms
    EC["External Configurations & Styling"]:::externalConfig

    %% Flow of requests and configuration
    U --> A
    A --> GL
    GL --> CI
    GL --> AD

    %% Client Interface composition
    CI --> UI
    CI --> MS
    CI --> SU

    %% Administrator part composition
    AD --> SU

    %% Both interfaces interact with CMS
    CI -->|"fetch"| CMS
    AD -->|"manage"| CMS
    CMS -->|"sendContent"| SU

    %% External configurations support layouts and utilities
    EC --> GL
    EC --> SU

    %% Lib utilities as part of shared services
    SU --> LIB

    %% Click Events
    click CI "https://github.com/sayantanmpaul/artistry-atlas/tree/main/app/(client)"
    click AD "https://github.com/sayantanmpaul/artistry-atlas/tree/main/app/(administrator)/admin"
    click GL "https://github.com/sayantanmpaul/artistry-atlas/blob/main/app/layout.tsx"
    click MS "https://github.com/sayantanmpaul/artistry-atlas/tree/main/app/sections"
    click UI "https://github.com/sayantanmpaul/artistry-atlas/tree/main/components"
    click CMS "https://github.com/sayantanmpaul/artistry-atlas/tree/main/sanity"
    click SU "https://github.com/sayantanmpaul/artistry-atlas/tree/main/app/utils"
    click LIB "https://github.com/sayantanmpaul/artistry-atlas/blob/main/lib/utils.ts"
    click EC "https://github.com/sayantanmpaul/artistry-atlas/blob/main/next.config.mjs"

    %% Styles
    classDef external fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef app fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef layout fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef client fill:#d1ecf1,stroke:#333,stroke-width:2px;
    classDef admin fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef modules fill:#e2e3e5,stroke:#333,stroke-width:2px;
    classDef components fill:#cfe2ff,stroke:#333,stroke-width:2px;
    classDef utilities fill:#ffe5cc,stroke:#333,stroke-width:2px;
    classDef cms fill:#d1c4e9,stroke:#333,stroke-width:2px;
    classDef externalConfig fill:#fadcdc,stroke:#333,stroke-width:2px;
```
