# notbigo/swayam-web architecture

> Architecture diagram of the GitHub repository notbigo/swayam-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/notbigo/swayam-web
- Repository: https://github.com/notbigo/swayam-web

## Overview

##### Project Type and Purpose
- This is a Next.js project, created with create-next-app. Its purpose is to serve a web application with dynamic routes (shown by the events/[slug] directory) and rich user interfaces, including featured events, sliders, cards, and a 3D card from the UI components.
- The project appears to be a front-end heavy application (with Next.js handling both SSR/SSG and client-side interactions) and uses Tailwind CSS for styling and custom UI components.

##### File Structure
- The top-level files (package.json, next.config.mjs, tailwind.config.js, etc.) are standard for a Next.js project with configurations for ESLint, Tailwind, and PostCSS.
- The src directory contains most code:
- The app directory holds entry points: the main page (app/page.js), layout (app/layout.js), globals (app/globals.css), and nested dynamic routing (app/events and app/events/[slug]). This indicates the use of the new Next.js app directory structure.
- The components directory contains UI components (e.g., Navbar, Footer, various EventCards, sliders and parallax components) – these form the reusable UI building blocks.
- The utils directory has helper functions (like cn.js) that support various components.
- The public directory holds static assets like images, fonts, and videos, suggesting that media content is a key part of the presentation layer.

- Next.js framework as the central engine that manages routing, server-side rendering, and static site generation. This is the foundation that ties all the pieces together.
- Frontend (UI) Components:
- Create subcomponents for key UI areas: Navbar, Footer, and the various event-related components (FeaturedEventCard, MainEventCard, FeaturedEventsSlider, and 3D card components).
- That these components are rendered as part of the pages located under src/app (for instance, the home page and the events pages).
- Page Routing & Layout:
- The app/layout.js and app/page.js should be depicted as the global layout and homepage respectively.
- Static Assets:
- Utility Layer:
- Configuration & Build:
- Configuration files (eslintrc.json, tailwind.config.js, postcss.config.js, etc.) and the package.json as part of the build and deployment layer, influencing how the application is bundled and optimized.
- Deployment and External Services:

##### Architectural Patterns and Technologies
- That the project follows the Next.js “app directory” pattern, leveraging server components and dynamic page routing.
- Separation of concerns by isolating UI components (in the components folder) from the structural layout and routing (in the app folder).
- Use of Tailwind CSS for styling along with a structured public asset management for multimedia content.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Request
    Browser("Browser Request"):::external

    %% Next.js Application Core (Routing & Layout)
    subgraph "Next.js Application Core (Routing & Layout)"
        A1["app/page.js (Homepage)"]:::routing
        A2["app/layout.js (Global Layout)"]:::routing
        A3["app/events/[slug]/page.js (Dynamic Event Page)"]:::routing
    end

    %% UI Components
    subgraph "UI Components"
        B1["Navbar"]:::ui
        B2["Footer"]:::ui
        B3["Featured Event Card"]:::ui
        B4["Main Event Card"]:::ui
        B5["Featured Events Slider"]:::ui
        B6["Parallax Scroll Effect"]:::ui
        subgraph "3D Card Components"
            B7["Card3D"]:::ui
            B8["Main3DCard"]:::ui
            B9["Sticky Scroll Reveal"]:::ui
        end
    end

    %% Utility Functions
    subgraph "Utility Functions"
        C1["Helper Functions (cn.js)"]:::util
    end

    %% Static Assets
    subgraph "Static Assets"
        D1["Assets (images, fonts, videos)"]:::assets
    end

    %% Configuration & Build
    subgraph "Configuration & Build"
        E1[".eslintrc.json"]:::config
        E2["next.config.mjs"]:::config
        E3["jsconfig.json"]:::config
        E4["package.json"]:::config
        E5["package-lock.json"]:::config
        E6["tailwind.config.js"]:::config
        E7["postcss.config.js"]:::config
        E8["README.md"]:::config
        E9["globals.css"]:::config
    end

    %% Deployment
    subgraph "Deployment"
        F1("Vercel"):::deployment
    end

    %% Connections
    Browser -->|"requests"| A1
    Browser --> A2
    A2 -->|"applies layout to"| A1
    A1 -->|"renders UI"| B1
    A1 --> B3
    A1 --> B4
    A1 -->|"navigates to"| A3
    A3 --> B2

    %% UI Components using Static Assets
    B1 -->|"uses"| D1
    B2 -->|"uses"| D1
    B3 -->|"uses"| D1
    B4 -->|"uses"| D1
    B5 -->|"uses"| D1
    B6 -->|"uses"| D1
    B7 -->|"uses"| D1
    B8 -->|"uses"| D1
    B9 -->|"uses"| D1

    %% Utility functions supporting UI Components
    C1 -->|"supports styling"| B1
    C1 --> B3
    C1 --> B4

    %% Configuration influencing UI and layout
    E6 -->|"styles"| B1
    E6 --> B3
    E6 --> B4
    E9 -->|"global styles"| B1
    E9 --> B2

    %% Build and Deployment
    A2 --> F1
    E2 --> F1

    %% Click Events
    click A1 "https://github.com/notbigo/swayam-web/blob/main/src/app/page.js"
    click A2 "https://github.com/notbigo/swayam-web/blob/main/src/app/layout.js"
    click A3 "https://github.com/notbigo/swayam-web/blob/main/src/app/events/[slug]/page.js"

    click B1 "https://github.com/notbigo/swayam-web/blob/main/src/components/Navbar.jsx"
    click B2 "https://github.com/notbigo/swayam-web/blob/main/src/components/Footer.jsx"
    click B3 "https://github.com/notbigo/swayam-web/blob/main/src/components/FeaturedEventCard.jsx"
    click B4 "https://github.com/notbigo/swayam-web/blob/main/src/components/MainEventCard.jsx"
    click B5 "https://github.com/notbigo/swayam-web/blob/main/src/components/FeaturedEventsSlider.jsx"
    click B6 "https://github.com/notbigo/swayam-web/blob/main/src/components/ParallaxScroll.jsx"
    click B7 "https://github.com/notbigo/swayam-web/blob/main/src/components/ui/Card3D.jsx"
    click B8 "https://github.com/notbigo/swayam-web/blob/main/src/components/ui/Main3DCard.jsx"
    click B9 "https://github.com/notbigo/swayam-web/blob/main/src/components/ui/sticky-scroll-reveal.jsx"

    click C1 "https://github.com/notbigo/swayam-web/blob/main/src/utils/cn.js"

    click D1 "https://github.com/notbigo/swayam-web/tree/main/public/assets"
    click D1 "https://github.com/notbigo/swayam-web/tree/main/public/images"

    click E1 "https://github.com/notbigo/swayam-web/blob/main/.eslintrc.json"
    click E2 "https://github.com/notbigo/swayam-web/blob/main/next.config.mjs"
    click E3 "https://github.com/notbigo/swayam-web/blob/main/jsconfig.json"
    click E4 "https://github.com/notbigo/swayam-web/blob/main/package.json"
    click E5 "https://github.com/notbigo/swayam-web/blob/main/package-lock.json"
    click E6 "https://github.com/notbigo/swayam-web/blob/main/tailwind.config.js"
    click E7 "https://github.com/notbigo/swayam-web/blob/main/postcss.config.js"
    click E8 "https://github.com/notbigo/swayam-web/blob/main/README.md"
    click E9 "https://github.com/notbigo/swayam-web/blob/main/src/app/globals.css"

    %% Styles
    classDef routing fill:#f9c74f,stroke:#000,stroke-width:2px;
    classDef ui fill:#90be6d,stroke:#000,stroke-width:2px;
    classDef util fill:#f9844a,stroke:#000,stroke-width:2px;
    classDef assets fill:#577590,stroke:#000,stroke-width:2px;
    classDef config fill:#277da1,stroke:#000,stroke-width:2px;
    classDef deployment fill:#f94144,stroke:#000,stroke-width:2px;
    classDef external fill:#f3722c,stroke:#000,stroke-width:2px;
```
