# satyabotcha/phone-theft architecture

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

- Interactive diagram: https://gitdiagram.com/satyabotcha/phone-theft
- Repository: https://github.com/satyabotcha/phone-theft

## Overview

##### Main Components

a. Frontend Layer:
- Next.js Application Container
- Page Components (/app directory)
- UI Components (/components/ui)
- Client-side Utils
- Styling System
- Tailwind CSS
- Global CSS

b. Core Features:
- Visualization System
- Matrix Background
- Crime Data Processing

c. Utility Layer:
- API Services
- Crime Ratio Calculator
- General Utilities

##### Component Relationships

**[Client Browser] ←→ [Next.js App Container]**
- ↓
**[Next.js App Container] → [Page Components]**
- ↓
- [UI Components] ← [Styling System]
- ↓
- [Utility Layer] → [External APIs]

##### Specific Implementation Details

- Rounded rectangles for UI components
- Hexagons for utility services

##### Important Elements to Highlight

a. Frontend Architecture:
- Next.js 13+ App Router structure
- Component hierarchy
- UI component library
- Integration system

b. Data Flow:
- API service patterns
- Crime data processing pipeline
- State management (if applicable)

##### Technical Stack Indicators

Technology badges or labels for:
- Next.js
- TypeScript
- Tailwind CSS
- Service (likely Mapbox or Google Maps based on map.tsx)
- API Integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph NextApp["Next.js Application"]
        AppContainer["Application Container"]:::nextjs
        click AppContainer "https://github.com/satyabotcha/phone-theft/tree/main/app"
        Layout["App Layout"]:::nextjs
        click Layout "https://github.com/satyabotcha/phone-theft/blob/main/app/layout.tsx"
        MainPage["Main Page"]:::nextjs
        click MainPage "https://github.com/satyabotcha/phone-theft/blob/main/app/page.tsx"
    end

    subgraph UILayer["UI Components Layer"]
        MapVis["Map Visualization"]:::ui
        click MapVis "https://github.com/satyabotcha/phone-theft/blob/main/components/ui/map.tsx"
        MatrixBg["Matrix Background"]:::ui
        click MatrixBg "https://github.com/satyabotcha/phone-theft/blob/main/components/ui/matrixBackground.tsx"
        
        subgraph CommonUI["Common UI Elements"]
            Button["Button"]:::ui
            click Button "https://github.com/satyabotcha/phone-theft/blob/main/components/ui/button.tsx"
            Card["Card"]:::ui
            click Card "https://github.com/satyabotcha/phone-theft/blob/main/components/ui/card.tsx"
            Input["Input"]:::ui
            click Input "https://github.com/satyabotcha/phone-theft/blob/main/components/ui/input.tsx"
            Tooltip["Tooltip"]:::ui
            click Tooltip "https://github.com/satyabotcha/phone-theft/blob/main/components/ui/tooltip.tsx"
        end
    end

    subgraph UtilityLayer["Utility Services"]
        APIService["API Services"]:::util
        click APIService "https://github.com/satyabotcha/phone-theft/blob/main/utils/api.ts"
        CrimeProcess["Crime Data Processing"]:::util
        click CrimeProcess "https://github.com/satyabotcha/phone-theft/blob/main/utils/crimeRatio.ts"
        GenUtils["General Utilities"]:::util
        click GenUtils "https://github.com/satyabotcha/phone-theft/blob/main/lib/utils.ts"
    end

    subgraph ConfigLayer["Configuration"]
        Styling["Styling System"]:::config
        click Styling "https://github.com/satyabotcha/phone-theft/blob/main/app/globals.css"
        TailwindConfig["Tailwind Config"]:::config
        click TailwindConfig "https://github.com/satyabotcha/phone-theft/blob/main/tailwind.config.ts"
        TSConfig["TypeScript Config"]:::config
        click TSConfig "https://github.com/satyabotcha/phone-theft/blob/main/tsconfig.json"
        NextConfig["Next.js Config"]:::config
        click NextConfig "https://github.com/satyabotcha/phone-theft/blob/main/next.config.mjs"
    end

    Browser --> AppContainer
    AppContainer --> Layout
    Layout --> MainPage
    MainPage --> MapVis
    MainPage --> MatrixBg
    MainPage --> CommonUI
    MapVis --> APIService
    MatrixBg --> GenUtils
    APIService --> CrimeProcess
    
    %% Styling Dependencies
    Styling --> UILayer
    TailwindConfig --> UILayer

    classDef nextjs fill:#1E40AF,color:white
    classDef ui fill:#059669,color:white
    classDef util fill:#CA8A04,color:white
    classDef config fill:#6B7280,color:white

    %% Legend
    subgraph Legend
        L1["Next.js Components"]:::nextjs
        L2["UI Components"]:::ui
        L3["Utility Services"]:::util
        L4["Configuration"]:::config
    end
```
