# ilkcanirturk/carcostapp architecture

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

- Interactive diagram: https://gitdiagram.com/ilkcanirturk/carcostapp
- Repository: https://github.com/ilkcanirturk/carcostapp

## Overview

##### Main Components Structure

a) Client-Side Application (Browser)

##### Detailed Component Breakdown

A. Presentation Layer (React Components)
- App (root component)
- CarForm
- CarList
- CarSearch
- CarValue

B. State Management Layer (Redux)
- Two main slices:
- carsSlice (for car data management)
- formSlice (for form state management)

##### Data Flow Representation

Following interactions:
- Actions dispatched from components to Redux store
- State updates flowing back to components
- Search filtering flow
- Total cost calculation flow

**[Browser]**

- [React Application]

- [Components]
- App.js
- CarForm.js (Add Cars)
- CarList.js (Display & Remove)
- CarSearch.js (Filter)
- CarValue.js (Calculate Total)

- [Redux Store]
- carsSlice
- searchTerm
- carsList

- formSlice
- name
- cost

##### Important Details to Highlight

- Unidirectional data flow:
- Components dispatch actions
- Store updates state
- Components receive updated state

- Features:
- Car addition/removal flow
- Search functionality
- Cost calculation pipeline

##### Technical Stack Indicators

- React
- Redux Toolkit
- Bulma CSS

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Browser
        ReactApp["React Application"]
        
        subgraph Components
            App["App Component"]:::component
            CarForm["Car Form Component"]:::component
            CarList["Car List Component"]:::component
            CarSearch["Car Search Component"]:::component
            CarValue["Car Value Component"]:::component
        end
        
        subgraph "Redux Store"
            Store["Store Configuration"]:::store
            
            subgraph "State Slices"
                CarsSlice["Cars Slice"]:::slice
                FormSlice["Form Slice"]:::slice
                
                CarsState["Cars State<br/>- searchTerm<br/>- carsList"]:::state
                FormState["Form State<br/>- name<br/>- cost"]:::state
            end
        end
        
        Entry["Application Entry"]:::entry
        Styles["Styles"]:::styles
        HTML["HTML Entry"]:::html
    end
    
    %% Component Relationships
    Entry --> ReactApp
    ReactApp --> App
    App --> CarForm
    App --> CarList
    App --> CarSearch
    App --> CarValue
    
    %% Redux Store Relationships
    Store --> CarsSlice
    Store --> FormSlice
    CarsSlice --> CarsState
    FormSlice --> FormState
    
    %% Data Flow
    CarForm -- "Dispatches Actions" --> FormSlice
    CarList -- "Dispatches Actions" --> CarsSlice
    CarSearch -- "Dispatches Actions" --> CarsSlice
    CarsState -- "Updates" --> CarList
    CarsState -- "Updates" --> CarValue
    FormState -- "Updates" --> CarForm
    
    %% Styling
    classDef component fill:#2196F3,stroke:#1565C0,color:white
    classDef store fill:#4CAF50,stroke:#2E7D32,color:white
    classDef slice fill:#FF9800,stroke:#EF6C00,color:white
    classDef state fill:#9E9E9E,stroke:#616161,color:white
    classDef entry fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef styles fill:#00BCD4,stroke:#00838F,color:white
    classDef html fill:#795548,stroke:#4E342E,color:white
    
    %% Click Events
    click App "https://github.com/ilkcanirturk/carCostApp/blob/main/src/App.js"
    click CarForm "https://github.com/ilkcanirturk/carCostApp/blob/main/src/components/CarForm.js"
    click CarList "https://github.com/ilkcanirturk/carCostApp/blob/main/src/components/CarList.js"
    click CarSearch "https://github.com/ilkcanirturk/carCostApp/blob/main/src/components/CarSearch.js"
    click CarValue "https://github.com/ilkcanirturk/carCostApp/blob/main/src/components/CarValue.js"
    click Store "https://github.com/ilkcanirturk/carCostApp/blob/main/src/store/index.js"
    click CarsSlice "https://github.com/ilkcanirturk/carCostApp/blob/main/src/store/slices/carsSlice.js"
    click FormSlice "https://github.com/ilkcanirturk/carCostApp/blob/main/src/store/slices/formSlice.js"
    click Entry "https://github.com/ilkcanirturk/carCostApp/blob/main/src/index.js"
    click Styles "https://github.com/ilkcanirturk/carCostApp/blob/main/src/styles.css"
    click HTML "https://github.com/ilkcanirturk/carCostApp/blob/main/public/index.html"
    
    %% Legend
    subgraph Legend
        L1["Component"]:::component
        L2["Store"]:::store
        L3["Slice"]:::slice
        L4["State"]:::state
        L5["Entry Point"]:::entry
        L6["Styles"]:::styles
        L7["HTML"]:::html
    end
```
