# neo-ayush-jha/nyaydetect architecture

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

- Interactive diagram: https://gitdiagram.com/neo-ayush-jha/nyaydetect
- Repository: https://github.com/neo-ayush-jha/nyaydetect

## Overview

##### Main Components
- Next.js Server/Runtime: Represent the server component that handles routing and rendering (both server-side and client-side aspects).
- Application Pages (APP Folder): Include key pages like app/page.tsx, app/layout.tsx, and the additional page components (app/case/page.tsx). This layer illustrates how Next.js handles routing and global application layouts.
- UI Components (Components Folder): Identify individual UI modules such as Button, Navbar, Footer, Hero, and others. These provide the building blocks for the pages.
- Global Styles and Configuration: Include the globals.css, tailwind.config.ts, next.config.ts, postcss configuration files, and TypeScript configuration (tsconfig.json). These files dictate styling, optimization (e.g., next/font usage for Geist), and build behavior.
- Constants: Represent any application-wide constants (from the “constants” directory) that are imported in various modules.
- External Resources and Deployment: Note integration with external services and best practices for deployment (e.g., Vercel as referenced in the README).

##### Relationships and Data Flow
- Data flow from the client (browser) making an HTTP request to the Next.js application.
- A split between the Next.js back-end rendering logic (using file-based routing from the “app” folder) and the reusability of components housed in the “components” folder.
- How global configuration and style settings (e.g., tailwind, postcss, and the custom font loading in next/font) affect the overall rendering output.

##### Architectural Patterns and Design Principles
- Next.js file-based routing pattern as a core architectural choice.
- Component-based architecture where UI elements are isolated in the “components” folder, promoting reusability and separation of concerns.
- Point out the separation of pages (in “app”) versus reusable UI widgets (in “components”) as an implementation of the container/presenter or composition pattern.
- Dependency injection of constants or configuration settings where applicable.

##### Relevant Technologies and Framework Details
- Next.js: Outline how it manages both server- and client-side rendering.
- React: Since the components are .tsx files, it is built on React.
- Tailwind CSS: Shown by the tailwind.config.ts and globals.css, highlighting the styling approach.
- TypeScript: All files are TypeScript (.tsx, .ts), ensuring type safety.
- Various config files (eslint, postcss, etc.) that support development best practices.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser Request"]:::browser
    Server["Next.js Server/Runtime"]:::server

    subgraph "Application Pages"
        AppPage["app/page.tsx"]:::page
        LayoutPage["app/layout.tsx"]:::page
        CasePage["app/case/page.tsx"]:::page
    end

    subgraph "UI Components (Reusable)"
        Navbar["Navbar"]:::component
        Hero["Hero"]:::component
        Features["Features"]:::component
        CaseDetails["CaseDetails"]:::component
        CasePageComp["CasePage"]:::component
        Button["Button"]:::component
        GetApp["GetApp"]:::component
        Guids["Guids"]:::component
        SuspectInterrogation["SuspectInterrogation"]:::component
        Camp["Camp"]:::component
        LanguageSelector["LanguageSelector"]:::component
        Footer["Footer"]:::component
    end

    subgraph "Global Styles & Config"
        Globals["globals.css"]:::config
        Tailwind["tailwind.config.ts"]:::config
        Postcss["postcss.config.js"]:::config
        NextConfig["next.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        ESLint["eslint.config.mjs"]:::config
    end

    Constants["constants/index.ts"]:::config

    %% Connections
    Browser -->|"HTTP_Request"| Server

    Server --> AppPage
    Server --> LayoutPage
    Server --> CasePage

    Globals -.-> Server
    Tailwind -.-> Server
    Postcss -.-> Server
    NextConfig -.-> Server
    TSConfig -.-> Server
    ESLint -.-> Server
    Constants -.-> Server

    AppPage -->|"imports"| Navbar
    AppPage -->|"imports"| Hero
    AppPage -->|"imports"| Button
    AppPage -->|"imports"| GetApp
    AppPage -->|"imports"| Guids
    AppPage -->|"imports"| SuspectInterrogation
    AppPage -->|"imports"| Camp
    AppPage -->|"imports"| LanguageSelector
    LayoutPage -->|"imports"| Footer
    CasePage -->|"imports"| CaseDetails
    CasePage -->|"imports"| CasePageComp
    CasePage -->|"imports"| Features

    %% Click Events for Next.js Server/Runtime and Application Pages
    click Server "https://github.com/neo-ayush-jha/nyaydetect/blob/main/app/layout.tsx"
    click AppPage "https://github.com/neo-ayush-jha/nyaydetect/blob/main/app/page.tsx"
    click LayoutPage "https://github.com/neo-ayush-jha/nyaydetect/blob/main/app/layout.tsx"
    click CasePage "https://github.com/neo-ayush-jha/nyaydetect/blob/main/app/case/page.tsx"

    %% Click Events for UI Components
    click Navbar "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/Navbar.tsx"
    click Hero "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/Hero.tsx"
    click Features "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/Features.tsx"
    click CaseDetails "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/CaseDetails.tsx"
    click CasePageComp "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/CasePage.tsx"
    click Button "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/Button.tsx"
    click GetApp "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/GetApp.tsx"
    click Guids "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/Guids.tsx"
    click SuspectInterrogation "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/SuspectInterrogation.tsx"
    click Camp "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/Camp.tsx"
    click LanguageSelector "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/LanguageSelector.tsx"
    click Footer "https://github.com/neo-ayush-jha/nyaydetect/blob/main/components/Footer.tsx"

    %% Click Events for Global Styles & Config and Constants
    click Globals "https://github.com/neo-ayush-jha/nyaydetect/blob/main/app/globals.css"
    click Tailwind "https://github.com/neo-ayush-jha/nyaydetect/blob/main/tailwind.config.ts"
    click Postcss "https://github.com/neo-ayush-jha/nyaydetect/blob/main/postcss.config.js"
    click NextConfig "https://github.com/neo-ayush-jha/nyaydetect/blob/main/next.config.ts"
    click TSConfig "https://github.com/neo-ayush-jha/nyaydetect/blob/main/tsconfig.json"
    click ESLint "https://github.com/neo-ayush-jha/nyaydetect/blob/main/eslint.config.mjs"
    click Constants "https://github.com/neo-ayush-jha/nyaydetect/blob/main/constants/index.ts"

    %% Styles
    classDef browser fill:#ffcc00,stroke:#000,stroke-width:2px;
    classDef server fill:#aaffaa,stroke:#000,stroke-width:2px;
    classDef page fill:#ccffff,stroke:#000,stroke-width:2px;
    classDef component fill:#ffb3ff,stroke:#000,stroke-width:2px;
    classDef config fill:#d9d2e9,stroke:#000,stroke-width:2px;
```
