# erdemmgunal/hakki-araniyor architecture

> Architecture diagram of the GitHub repository erdemmgunal/hakki-araniyor, 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/erdemmgunal/hakki-araniyor
- Repository: https://github.com/erdemmgunal/hakki-araniyor

## Overview

##### Main System Components

a) Client Layer:
- Next.js frontend with its app router structure
- Main UI components hierarchy
- Static assets handling

b) API Layer:
- API routes structure
- Game statistics handling

c) Data Layer:
- Games data storage
- Localization system
- State management system

##### Detailed Component Breakdown

Frontend Components:
- Core components (Header, Footer, GameCard, etc.)
- Game-specific components (GameFilters, VoteForm, etc.)

State Management:
- GameContext and its connections to components
- Last viewed games functionality

Data Flow:
- API calls between frontend and backend
- Data flow between components
- State updates and context usage

##### Specific Implementation Details

Technical aspects:

a) Framework Features:
- Next.js App Router structure
- API routes implementation
- Static and dynamic rendering paths

b) External Integrations:
- Google Adsense integration
- Tailwind CSS styling system
- Internationalization system

##### Key Relationships to Highlight

Critical connections:
- Game data flow from games.json to components
- Context provider hierarchy
- API route interactions with game statistics
- Localization system integration

##### External Services Layer

→ for data flow
⟲ for state updates
-- for dependencies

This structure will provide a clear visualization of how the Yes/No Game application works, from user interaction to data storage, while maintaining the appropriate level of detail for a principal software engineer to understand the system architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        direction TB
        Pages --> |renders| Components
        Components --> |uses| UILib
        Components --> |uses| GameComponents
        
        subgraph Pages
            direction TB
            Home["Home Page"]
            GameDetails["Game Details"]
            About["About Page"]
            Rules["Rules Page"]
        end

        subgraph Components
            direction TB
            Header["Header"]
            Footer["Footer"]
            GameCard["GameCard"]
            GameGrid["GameGrid"]
            VoteForm["VoteForm"]
        end

        subgraph UILib
            direction TB
            Button["Button"]
            Card["Card"]
            Alert["Alert"]
        end

        subgraph GameComponents
            direction TB
            Categories["Categories"]
            GameFilters["GameFilters"]
            RelatedGames["RelatedGames"]
            LastViewedGames["LastViewedGames"]
            Adsense["Google Adsense"]
        end
    end

    subgraph State
        direction TB
        GameContext["Game Context"]
        LastViewedUtils["Last Viewed Utils"]
    end

    subgraph API
        direction TB
        GameStatsAPI["Game Statistics API"]
    end

    subgraph Data
        direction TB
        GamesData["Games Data"]
        GameUtils["Game Utilities"]
        RelatedGamesLogic["Related Games Logic"]
    end

    subgraph Localization
        direction TB
        EnglishMsgs["English Messages"]
        TurkishMsgs["Turkish Messages"]
    end

    Components --> |uses| State
    GameComponents --> |uses| State
    Components --> |calls| API
    API --> |reads/writes| Data
    Components --> |uses| Localization
    
    %% Click events for file mapping
    click Home "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/app/page.js"
    click GameDetails "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/app/games/[id]/page.js"
    click About "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/app/about/page.js"
    click Rules "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/app/rules/page.js"
    click Header "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/Header.js"
    click Footer "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/Footer.js"
    click GameCard "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/GameCard.js"
    click GameGrid "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/GameGrid.js"
    click VoteForm "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/VoteForm.js"
    click Button "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/ui/button.jsx"
    click Card "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/ui/card.jsx"
    click Alert "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/ui/alert.jsx"
    click Categories "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/Categories.js"
    click GameFilters "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/GameFilters.js"
    click RelatedGames "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/RelatedGames.js"
    click LastViewedGames "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/LastViewedGames.js"
    click GameContext "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/GameContext.js"
    click LastViewedUtils "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/lib/lastViewedGames.js"
    click GameStatsAPI "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/app/api/gameStats/route.js"
    click GamesData "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/data/games.json"
    click GameUtils "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/lib/getGameById.js"
    click RelatedGamesLogic "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/lib/getRelatedGames.js"
    click EnglishMsgs "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/messages/en.json"
    click TurkishMsgs "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/messages/tr.json"
    click Adsense "https://github.com/erdemmgunal/hakki-araniyor/blob/main/src/components/GoogleAdsense.js"

    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef pages fill:#e1f5fe,stroke:#01579b
    classDef components fill:#e8f5e9,stroke:#1b5e20
    classDef ui fill:#f3e5f5,stroke:#4a148c
    classDef game fill:#fff3e0,stroke:#e65100
    classDef state fill:#ffebee,stroke:#b71c1c
    classDef api fill:#e8eaf6,stroke:#1a237e
    classDef data fill:#fce4ec,stroke:#880e4f
    classDef localization fill:#f1f8e9,stroke:#33691e

    class Home,GameDetails,About,Rules pages
    class Header,Footer,GameCard,GameGrid,VoteForm components
    class Button,Card,Alert ui
    class Categories,GameFilters,RelatedGames,LastViewedGames,Adsense game
    class GameContext,LastViewedUtils state
    class GameStatsAPI api
    class GamesData,GameUtils,RelatedGamesLogic data
    class EnglishMsgs,TurkishMsgs localization
```
