# xcriminal1/jarvis architecture

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

- Interactive diagram: https://gitdiagram.com/xcriminal1/jarvis
- Repository: https://github.com/xcriminal1/jarvis

## Overview

##### Main Components
- App Layer (Next.js): Represented by the "app" directory containing the central layout and page routing. This is the entry point to the application and sets up the overall UI structure.
- UI Components: Located in the "components" directory. These include various UI elements such as the Topbar, SideBar, DonutChart, BedOccupancy, and GenderBreakdown components that build up the interactive parts of the user interface.
- Global Assets & Configurations: The global stylesheet (globals.css) and configuration files (next.config.ts, eslint.config.mjs, postcss.config.mjs, tsconfig.json) that dictate styling, linting, and TypeScript behavior.
- Public Assets: The "public" directory for static assets like images and other resources.
- Build and Dependency Management: package.json and package-lock.json are crucial in defining project dependencies and scripts for building and development.

##### Relationships and Interactions
- The "app" directory acts as the entry point where Next.js handles routing and page layout. It wraps and renders multiple components.
- The individual components are imported within pages and layout definitions to assemble the full UI. For instance, the Topbar and SideBar can be viewed as persistent navigation or header elements.
- Global styling is applied across the app via the globals.css file, ensuring consistent design across components.

##### Architectural Patterns & Technologies
- Next.js Framework: Emphasize its use for server-side rendering and routing.
- Component-Based Architecture: The design leverages React components for reusability and separation of concerns.
- Styling via CSS Modules/Global Styling: Capture how styling is applied across components.
- TypeScript for static type checking.
- Build/Development Tools: ESLint and PostCSS play roles in code quality and style processing, respectively.

a. A high-level block representing the Next.js App layer. Inside, sub-divide into sites/pages and the layout.
b. Branch out to show the primary UI components (SideBar, Topbar, DonutChart, BedOccupancy, GenderBreakdown) that are aggregated within the layout or specific pages.
c. A supporting branch for global styles and configurations that feed into the main app.
d. External dependencies (like dependencies declared in package.json) that underpin the runtime environment.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Next.js App Layer"
        Layout["Layout (app/layout.tsx)"]:::appLayer
        Home["Home Page (app/page.tsx)"]:::appLayer
        Layout -->|"renders"| Home
        Layout -->|"includes"| TopbarComponent
        Layout -->|"includes"| SideBarComponent
    end

    subgraph "UI Components"
        TopbarComponent["Topbar Component"]:::component
        SideBarComponent["SideBar Component"]:::component
        DonutChartComponent["DonutChart Component"]:::component
        BedOccupancyComponent["BedOccupancy Component"]:::component
        GenderBreakdownComponent["GenderBreakdown Component"]:::component
        Home -->|"includes"| DonutChartComponent
        Home -->|"includes"| BedOccupancyComponent
        Home -->|"includes"| GenderBreakdownComponent
    end

    subgraph "Global Styles & Configurations"
        Globals["Global Styles (app/globals.css)"]:::config
        PublicAssets["Public Assets (public)"]:::config
        ESLintConfig["ESLint Configuration (eslint.config.mjs)"]:::config
        NextConfig["Next.js Configuration (next.config.ts)"]:::config
        PostCSSConfig["PostCSS Configuration (postcss.config.mjs)"]:::config
        TSConfig["TypeScript Configuration (tsconfig.json)"]:::config
        BuildDeps["Build & Dependency Management (package.json & package-lock.json)"]:::config
    end

    Layout -->|"applies"| Globals
    Layout -->|"serves static"| PublicAssets
    Home -->|"uses"| ESLintConfig
    Home -->|"uses"| NextConfig
    Home -->|"uses"| PostCSSConfig
    Home -->|"uses"| TSConfig
    Home -->|"uses"| BuildDeps

    classDef appLayer fill:#DDEEFF,stroke:#1E90FF,color:#000;
    classDef component fill:#FFE4B5,stroke:#FF8C00,color:#000;
    classDef config fill:#E0FFE0,stroke:#228B22,color:#000;

    click Layout "https://github.com/xcriminal1/jarvis/blob/master/app/layout.tsx"
    click Home "https://github.com/xcriminal1/jarvis/blob/master/app/page.tsx"
    click Globals "https://github.com/xcriminal1/jarvis/blob/master/app/globals.css"
    click PublicAssets "https://github.com/xcriminal1/jarvis/tree/master/public"
    click TopbarComponent "https://github.com/xcriminal1/jarvis/blob/master/components/Topbar.tsx"
    click SideBarComponent "https://github.com/xcriminal1/jarvis/blob/master/components/SideBar.tsx"
    click DonutChartComponent "https://github.com/xcriminal1/jarvis/blob/master/components/DonutChart.tsx"
    click BedOccupancyComponent "https://github.com/xcriminal1/jarvis/blob/master/components/BedOccupancy.tsx"
    click GenderBreakdownComponent "https://github.com/xcriminal1/jarvis/blob/master/components/GenderBreakdown.tsx"
    click ESLintConfig "https://github.com/xcriminal1/jarvis/blob/master/eslint.config.mjs"
    click NextConfig "https://github.com/xcriminal1/jarvis/blob/master/next.config.ts"
    click PostCSSConfig "https://github.com/xcriminal1/jarvis/blob/master/postcss.config.mjs"
    click TSConfig "https://github.com/xcriminal1/jarvis/blob/master/tsconfig.json"
    click BuildDeps "https://github.com/xcriminal1/jarvis/blob/master/package.json & package-lock.json"
```
