# heavenike02/sdg-showcase-3 architecture

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

- Interactive diagram: https://gitdiagram.com/heavenike02/sdg-showcase-3
- Repository: https://github.com/heavenike02/sdg-showcase-3

## Overview

##### Main Components
- Next.js Application Core: Represented by the “app” directory. This includes the main layout (layout.tsx), the root page (page.tsx), and dynamic routes such as the profile pages (app/profile/[id]/page.tsx) and search page (app/search/page.tsx). These components form your primary frontend logic and routing.
- Feature-Specific Components: Inside the “components” directory, focus on non-UI components. Include those that drive the functionality of the home page (e.g., components/home/AboutSection.tsx, HeroSection.tsx, CommitteeSection.tsx, etc.) along with other functional components such as Footer.tsx, Navbar.tsx, SDGImpactChart.tsx, SkeletonDemo.tsx, TestimonialQuote.tsx, WorldwideNetwork.tsx, and specialized items like sdg-circle-summary.tsx and sdg-circle.tsx.
- Business Logic and Utilities: Represent the “lib” folder which holds helper functions like sdg-data.ts, sdgcolor.ts, and utils.ts. These files encapsulate data transformations and business rules.
- Data Fetching and API Layer: Include the “queries” folder (e.g., queries/fetch-assessment-data.ts) as it abstracts communication with external data services or APIs.
- Static Content and Assets: Represent the “public” folder which contains the static assets that the application will use (such as images, fonts, or other media).
- Global Styling: The “app/globals.css” file provides global styling rules that affect the entire application.

##### Relationships and Interactions
- The Next.js Core (app pages) is the entry point where the browser interacts with the user interface. Detail how layout.tsx and page.tsx incorporate these modular components to render dynamic content.
- The “public” directory assets are loaded and served as static files that support the rendered components.

##### Architectural Patterns and Design Principles
- Modular and Reusable Structure: The separation into directories like “app”, “components”, “lib”, and “queries” reflects a clean, modular design.
- Separation of Concerns: The division between page-level components (routing and structure), feature-specific components (UI sections except for the general UI library that should be removed as per instructions), business logic (lib), and data fetching (queries) helps maintain maintainability and scalability.
- Dynamic Routing: The [id] folder under the profile directory shows the use of dynamic routing in Next.js.
- Data Flow: Emphasize the unidirectional data flow where pages use utility libraries and query modules to transform and present data.

##### Technologies
- Next.js framework for React-based server-side rendering and routing.
- Modern JavaScript/TypeScript (as indicated by the presence of .ts and .tsx files).
- Standard use of CSS for global styling.
- Clear separation of modules aids in easy maintenance and potential testing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["App (Routing & Pages)"]:::pages
    B["Feature Components"]:::feature
    C["Utility Libraries"]:::logic
    D["Data Queries"]:::queries
    E["Static Assets"]:::static
    F["Global Styling"]:::styling

    A -->|"renders"| B
    A -.->|"processes"| C
    B -.->|"utilizes"| C
    A -->|"fetches"| D
    D -->|"supplies"| B
    A -->|"styledBy"| F
    A -->|"loads"| E

    click A "https://github.com/heavenike02/sdg-showcase-3/tree/master/app"
    click B "https://github.com/heavenike02/sdg-showcase-3/tree/master/components"
    click C "https://github.com/heavenike02/sdg-showcase-3/tree/master/lib"
    click D "https://github.com/heavenike02/sdg-showcase-3/blob/master/queries/fetch-assessment-data.ts"
    click E "https://github.com/heavenike02/sdg-showcase-3/tree/master/public"
    click F "https://github.com/heavenike02/sdg-showcase-3/blob/master/app/globals.css"

    classDef pages fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef feature fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef logic fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef queries fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef static fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef styling fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
```
