# anzarbaig/abg-competency architecture

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

- Interactive diagram: https://gitdiagram.com/anzarbaig/abg-competency
- Repository: https://github.com/anzarbaig/abg-competency

## Overview

##### Main components
- Frontend (Client-Side)
- Browser/User Interface: Represents the client accessing the web application.
- Next.js Pages: These are located in the src/pages/ directory (e.g., index.js, competency.jsx, split-view.jsx). They manage both rendered pages and serve as endpoints for API calls.
- Components Layer: Within src/components/ and its subdirectories, you have various UI components (e.g., Navbar.jsx, SVGComponent.jsx, HomeSvgComp.jsx, layout.jsx, and UI-specific elements in src/components/ui). These represent the building blocks of the user interface.
- Backend/UI Server Side
- API Routes: Found in src/pages/api (for example, hello.js) which are mapped to `/api/*` endpoints. They handle server-side logic, data fetching, or any backend processing required by the application.
- Store / State Management: With a dedicated src/store/store.js, this module likely handles application state which might be shared across components.
- Configuration and Styling
- Global Styles and Configuration: Files like tailwind.config.js, postcss.config.js, and src/styles/globals.css manage styling and design. Next.config.mjs and jsconfig.json configure build and project-specific behaviors.
- Utilities and Libraries
- Utility Functions: The src/lib/utils.js stores helper functions that can be used throughout the project.
- ESLint and other config files at the root provide quality and linting configuration for the whole project.

##### Relationships and Data Flow
- The browser makes HTTP requests to the Next.js application.
- Requests for rendered pages go to the Next.js server (SSR or static generation), which then renders pages based on the code in src/pages/.
- Components in src/components/ are used within these pages to compose the UI.
- Any state or shared logic is handled through the store (src/store/store.js) and utility functions (src/lib/utils.js).
- API endpoints (in src/pages/api/) receive requests from the frontend (or external clients) to perform backend operations or expose data services.
- Global assets in the public directory serve static content (images, fonts, etc.) and are accessible to the client.

##### Architectural Patterns
- The application follows a component-based architecture typical of React and Next.js.
- It leverages the file-based routing mechanism of Next.js: files in the pages directory correspond to accessible routes.
- There is a separation between presentation (UI components), page logic, API/backend capabilities, and utility modules.
- State management is centralized within a store module.

## Diagram (Mermaid)

```mermaid
graph TD
    Browser["Browser / Client"]:::client
    Browser -->|"HTTP_Request"| NextServer["Next.js Server"]:::backend

    subgraph "Next.js Server"
        direction TB
        Pages["Pages (src/pages/)"]:::pages
        API["API Routes (src/pages/api/hello.js)"]:::api
        CoreComp["Core Components (src/components/)"]:::components
        UIComp["UI Elements (src/components/ui/)"]:::components
    end

    Pages -->|"renders"| CoreComp
    Pages -->|"renders"| UIComp
    CoreComp -->|"uses"| Store["State Management (src/store/store.js)"]:::state
    UIComp -->|"uses"| Store
    Pages -->|"calls"| Utils["Utility Functions (src/lib/utils.js)"]:::utils

    NextServer -->|"applies"| Styles["Global Styles (src/styles/globals.css)"]:::config
    NextServer -->|"configures"| Tailwind["Tailwind_Config (tailwind.config.js)"]:::config
    NextServer -->|"uses"| PostCSS["PostCSS_Config (postcss.config.js)"]:::config
    NextServer -->|"configures"| NextConf["Next.js_Config (next.config.mjs)"]:::config
    NextServer -->|"configures"| JsConfig["JS_Config (jsconfig.json)"]:::config

    Browser -->|"loads"| Public["Public Assets (public/)"]:::assets

    classDef client fill:#ccf,stroke:#333,stroke-width:2px;
    classDef backend fill:#fcf,stroke:#333,stroke-width:2px;
    classDef pages fill:#cff,stroke:#333,stroke-width:2px;
    classDef api fill:#fcc,stroke:#333,stroke-width:2px;
    classDef components fill:#cfc,stroke:#333,stroke-width:2px;
    classDef state fill:#fc9,stroke:#333,stroke-width:2px;
    classDef utils fill:#ff9,stroke:#333,stroke-width:2px;
    classDef config fill:#9cf,stroke:#333,stroke-width:2px;
    classDef assets fill:#cff,stroke:#333,stroke-width:2px;

    click Pages "https://github.com/anzarbaig/abg-competency/tree/main/src/pages/"
    click API "https://github.com/anzarbaig/abg-competency/blob/main/src/pages/api/hello.js"
    click CoreComp "https://github.com/anzarbaig/abg-competency/tree/main/src/components/"
    click UIComp "https://github.com/anzarbaig/abg-competency/tree/main/src/components/ui/"
    click Store "https://github.com/anzarbaig/abg-competency/blob/main/src/store/store.js"
    click Utils "https://github.com/anzarbaig/abg-competency/blob/main/src/lib/utils.js"
    click Styles "https://github.com/anzarbaig/abg-competency/blob/main/src/styles/globals.css"
    click Tailwind "https://github.com/anzarbaig/abg-competency/blob/main/tailwind.config.js"
    click PostCSS "https://github.com/anzarbaig/abg-competency/blob/main/postcss.config.js"
    click NextConf "https://github.com/anzarbaig/abg-competency/blob/main/next.config.mjs"
    click JsConfig "https://github.com/anzarbaig/abg-competency/blob/main/jsconfig.json"
    click Public "https://github.com/anzarbaig/abg-competency/tree/main/public/"
```
