# astroshweta/astroshwetasite architecture

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

- Interactive diagram: https://gitdiagram.com/astroshweta/astroshwetasite
- Repository: https://github.com/astroshweta/astroshwetasite

## Overview

##### Project Type and Purpose
- This project is a Next.js web application bootstrapped using create-next-app. It’s set up for a modern web interface and leverages Next.js features such as routing, dynamic page rendering, and server-side capabilities.
- The README primarily guides development and deployment (especially via Vercel) and does not describe any deep domain logic – the focus is largely on UI rendering and page organization.

##### Analyzing the File Structure
- Top-Level Organization:
- The root contains configuration files (package.json, next.config.ts, tsconfig.json, tailwind.config.ts, postcss.config.mjs, eslint.config.mjs) that set up the development, linting, styling, and building processes.
- The “public” directory is used for static assets.
- The “app” Directory:
- Contains the Next.js application’s core pages and layout logic (app/page.tsx, app/layout.tsx).
- “app/components” holds both generic UI components (in the “ui” subfolder) and the more feature-specific “sections” like About, Chat, Contact, FAQs, etc. This suggests an abstraction where section components form modular pieces of different pages.
- The “app/packages” Directory:
- Contains domain-specific packages (career, direct, emergency, health, marriage) each having its own page.tsx, indicating separate page routes corresponding to different application sections.
- Additional Folders:
- “app/lib” (e.g., emotionCache.ts) likely handles caching or style optimizations.
- “app/utils” provides constants and slot definitions (constants.js, slots.json) which are shared across components.

##### Key Architectural Elements and Patterns
- Next.js App Directory – making use of file-based routing; page.tsx files in “app”, “app/packages”, etc. automatically map to routes.
- Separation into Reusable Components – clear segregation between “sections” (content-specific components) and “ui” (generic interactive or display components).
- Modular Page Design – each “package” (like career, direct, etc.) encapsulates self-contained pages, suggesting a component-driven, modular architecture.
- Global Styling and Libraries – “global.css”, Tailwind (configured in tailwind.config.ts), and potential theming (via emotionCache in lib) indicates presentational architecture concerns.

##### Relationships and Data Flow
- Incoming user requests are handled by Next.js routing. Requests to different URLs are mapped to page.tsx files in the “app” directory (or its packages subdirectory).
- Pages import and compose UI components (e.g., sections like Navbar, Hero, Footer) to build complete pages.
- The layout component (app/layout.tsx) is likely the outer wrapper that provides a consistent look and feels (including shared headers, footers, or styles).
- Utility functions and constants (in app/utils) provide shared data and configuration to components throughout the application.
- The “lib” directory plays a supportive role in handling specialized functions such as caching for the styling library.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    UR("User_Request"):::external

    %% Next.js Application Block
    subgraph "Next.js Application"
        %% Routing & Pages Subgraph
        subgraph "Routing & Pages"
            NXP("app/page.tsx"):::nextjs
            subgraph "Packages"
                Career("Career_Page"):::nextjs
                Direct("Direct_Page"):::nextjs
                Emergency("Emergency_Page"):::nextjs
                Health("Health_Page"):::nextjs
                Marriage("Marriage_Page"):::nextjs
            end
        end

        %% Layout Component
        Layout("app/layout.tsx"):::nextjs

        %% Section Components Subgraph
        subgraph "Section Components"
            Navbar("Navbar"):::section
            Hero("Hero"):::section
            About("About"):::section
            Chat("Chat"):::section
            Contact("Contact"):::section
            FAQs("FAQs"):::section
            Testimonials("Testimonials"):::section
            Footer("Footer"):::section
            PackagesSec("Packages"):::section
            Slot("slot"):::section
            PkgConstants("packages/constants"):::section
        end

        %% UI Components Subgraph
        subgraph "UI Components"
            Card("Card"):::ui
            Button("CustomButton"):::ui
            SectionTitle("SectionTitle"):::ui
            Modal("Modal"):::ui
        end
    end

    %% Utility & Library Modules Subgraph
    subgraph "Utility & Library Modules"
        UtilConstants("constants.js"):::util
        UtilSlots("slots.json"):::util
        EmotionCache("emotionCache.ts"):::util
    end

    %% Connections
    UR -->|"triggers"| NXP
    UR -->|"triggers"| Career
    UR -->|"triggers"| Direct
    UR -->|"triggers"| Emergency
    UR -->|"triggers"| Health
    UR -->|"triggers"| Marriage

    NXP -->|"composes"| Layout
    Career -->|"composes"| Layout
    Direct -->|"composes"| Layout
    Emergency -->|"composes"| Layout
    Health -->|"composes"| Layout
    Marriage -->|"composes"| Layout

    Layout -->|"wraps"| Navbar
    Layout -->|"wraps"| Hero
    Layout -->|"wraps"| About
    Layout -->|"wraps"| Chat
    Layout -->|"wraps"| Contact
    Layout -->|"wraps"| FAQs
    Layout -->|"wraps"| Testimonials
    Layout -->|"wraps"| Footer
    Layout -->|"wraps"| PackagesSec
    Layout -->|"wraps"| Slot
    Layout -->|"wraps"| PkgConstants

    Navbar -->|"uses"| Card
    Hero -->|"uses"| Button
    About -->|"uses"| SectionTitle
    Chat -->|"uses"| Modal

    %% Dashed lines for shared utility dependencies
    Layout ---|"utilizes"| UtilConstants
    Layout ---|"utilizes"| EmotionCache
    Navbar ---|"shares"| UtilSlots
    Hero ---|"shares"| UtilConstants
    Card ---|"shares"| UtilSlots

    %% Click Events for Next.js Pages & Routing
    click NXP "https://github.com/astroshweta/astroshwetasite/blob/main/app/page.tsx"
    click Career "https://github.com/astroshweta/astroshwetasite/blob/main/app/packages/career/page.tsx"
    click Direct "https://github.com/astroshweta/astroshwetasite/blob/main/app/packages/direct/page.tsx"
    click Emergency "https://github.com/astroshweta/astroshwetasite/blob/main/app/packages/emergency/page.tsx"
    click Health "https://github.com/astroshweta/astroshwetasite/blob/main/app/packages/health/page.tsx"
    click Marriage "https://github.com/astroshweta/astroshwetasite/blob/main/app/packages/marriage/page.tsx"

    %% Click Event for Layout Component
    click Layout "https://github.com/astroshweta/astroshwetasite/blob/main/app/layout.tsx"

    %% Click Events for Section Components
    click Navbar "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/Navbar.tsx"
    click Hero "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/Hero.tsx"
    click About "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/About.tsx"
    click Chat "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/Chat.tsx"
    click Contact "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/Contact.tsx"
    click FAQs "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/FAQs.tsx"
    click Testimonials "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/Testimonials.tsx"
    click Footer "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/Footer.tsx"
    click PackagesSec "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/Packages.tsx"
    click Slot "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/slot.tsx"
    click PkgConstants "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/sections/packages/constants.tsx"

    %% Click Events for UI Components
    click Card "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/ui/Card.tsx"
    click Button "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/ui/CustomButton.tsx"
    click SectionTitle "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/ui/SectionTitle.tsx"
    click Modal "https://github.com/astroshweta/astroshwetasite/blob/main/app/components/ui/modal.tsx"

    %% Click Events for Utility & Library Modules
    click UtilConstants "https://github.com/astroshweta/astroshwetasite/blob/main/app/utils/constants.js"
    click UtilSlots "https://github.com/astroshweta/astroshwetasite/blob/main/app/utils/slots.json"
    click EmotionCache "https://github.com/astroshweta/astroshwetasite/blob/main/app/lib/emotionCache.ts"

    %% Styles
    classDef external fill:#f7d794,stroke:#333,stroke-width:2px;
    classDef nextjs fill:#ffe0b3,stroke:#333,stroke-width:2px;
    classDef section fill:#c8e6c9,stroke:#333,stroke-width:2px;
    classDef ui fill:#bbdefb,stroke:#333,stroke-width:2px;
    classDef util fill:#f8bbd0,stroke:#333,stroke-width:2px;
```
