# magdalenaszym/ludoteca-react architecture

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

- Interactive diagram: https://gitdiagram.com/magdalenaszym/ludoteca-react
- Repository: https://github.com/magdalenaszym/ludoteca-react

## Overview

##### Project type and purpose
- This is a full-stack “ludoteca” (game library) management application.
- Frontend: a React/TypeScript SPA that manages games, authors, categories, customers and borrows.
- Backend: a Spring Boot service exposing CRUD REST endpoints, persisting to an in-memory H2 database.

##### File structure
- Top level:
- ludoteca-react/ → React frontend
- tutorial/        → Spring Boot backend
- Frontend:
- public/index.html, src/main.tsx → app entry point, bootstrapped via Vite
- src/components, src/pages → UI components, page layouts per domain (author, game, customer, category, borrow)
- src/redux/services/ludotecaApi.ts → Redux Toolkit Query service for HTTP calls
- src/redux/features/messageSlice.ts → global messaging state
- src/context/LoaderProvider.tsx → loading‐indicator context
- Backend:
- src/main/java/com/ccsw/tutorial → Spring Boot app package
- controller/ → REST controllers per entity
- service/ + serviceImpl/ → business logic layer
- repository/ → JPA repositories
- model/ → JPA entities and DTOs
- common/criteria & pagination → custom search/paging abstractions
- config/ModelMapperConfig → DTO↔entity mapping
- resources/application.properties + data.sql → H2 config and seed data

##### README
- Confirms tech stack: React+TypeScript on the front, Java 17 Spring Boot with JPA/Hibernate and H2 on the back.

##### Detailed coverage
- Integration points: API service endpoint URLs, model mapping, search specifications.
- Build/deploy context (Vite dev server, Maven) if relevant to the engineering discussion.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Tier
    subgraph "Frontend (ludoteca-react)" 
        direction TB
        Browser["Web Browser"]:::external
        ReactSPA["React SPA"]:::frontend
        Layout["Global Layout"]:::frontend
        ConfirmDialog["Confirmation Dialog"]:::frontend
        UIComponentsGrp["UI Components"]:::frontend
        LoaderContext["Loader Context Provider"]:::frontend
        subgraph "Pages"
            direction TB
            AuthorPage["Author.tsx"]:::frontend
            GamePage["Game.tsx"]:::frontend
            CategoryPage["Category.tsx"]:::frontend
            CustomerPage["Customer.tsx"]:::frontend
            BorrowPage["Borrow.tsx"]:::frontend
        end
        subgraph "Create-Entity Dialogs"
            direction TB
            CreateAuthor["CreateAuthor.tsx"]:::frontend
            CreateGame["CreateGame.tsx"]:::frontend
            CreateCategory["CreateCategory.tsx"]:::frontend
            CreateCustomer["CreateCustomer.tsx"]:::frontend
            CreateBorrow["CreateBorrow.tsx"]:::frontend
        end
        subgraph "State Management"
            direction TB
            StoreConfig["store.ts"]:::frontend
            Hooks["hooks.ts"]:::frontend
            MessageSlice["messageSlice.ts"]:::frontend
            RTKQuery["ludotecaApi.ts"]:::api
        end
        Vite["Vite Dev Server"]:::tool
    end

    %% HTTP Layer
    HTTP["HTTP/REST"]:::network

    %% Backend Tier
    subgraph "Backend (tutorial)"
        direction TB
        SpringApp["TutorialApplication.java"]:::backend
        Controllers["Controllers (AuthorController, GameController, ...)"]:::backend
        Services["Services & ModelMapper"]:::backend
        Repositories["JPA Repositories"]:::backend
        Specs["Search Criteria & Specifications"]:::backend
        ModelMapperConfig["ModelMapperConfig.java"]:::backend
        subgraph "Persistence"
            H2["H2 In-Memory DB"]:::db
        end
        Pom["pom.xml"]:::tool
    end

    %% Connections Frontend
    Browser --> ReactSPA
    ReactSPA --> Layout
    ReactSPA --> ConfirmDialog
    ReactSPA --> UIComponentsGrp
    ReactSPA --> LoaderContext
    ReactSPA --> StoreConfig
    ReactSPA --> Hooks
    StoreConfig --> MessageSlice
    StoreConfig --> RTKQuery
    UIComponentsGrp --> AuthorPage
    UIComponentsGrp --> GamePage
    UIComponentsGrp --> CategoryPage
    UIComponentsGrp --> CustomerPage
    UIComponentsGrp --> BorrowPage
    AuthorPage --> CreateAuthor
    GamePage --> CreateGame
    CategoryPage --> CreateCategory
    CustomerPage --> CreateCustomer
    BorrowPage --> CreateBorrow
    ReactSPA --> Vite
    UIComponentsGrp --> RTKQuery
    LoaderContext --> RTKQuery
    RTKQuery -->|HTTP requests| HTTP

    %% Connections to Backend
    HTTP --> SpringApp
    SpringApp --> Controllers
    Controllers --> Services
    Services --> ModelMapperConfig
    Services --> Repositories
    Repositories --> Specs
    Repositories --> H2
    H2 --> Repositories

    %% Click Events Frontend
    click ReactSPA "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/main.tsx"
    click UIComponentsGrp "https://github.com/magdalenaszym/ludoteca-react/tree/master/ludoteca-react/src/components"
    click Layout "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/components/Layout.tsx"
    click ConfirmDialog "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/components/ConfirmDialog.tsx"
    click LoaderContext "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/context/LoaderProvider.tsx"
    click StoreConfig "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/redux/store.ts"
    click Hooks "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/redux/hooks.ts"
    click MessageSlice "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/redux/features/messageSlice.ts"
    click RTKQuery "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/redux/services/ludotecaApi.ts"
    click AuthorPage "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/author/Author.tsx"
    click GamePage "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/game/Game.tsx"
    click CategoryPage "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/category/Category.tsx"
    click CustomerPage "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/customer/Customer.tsx"
    click BorrowPage "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/borrow/Borrow.tsx"
    click CreateAuthor "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/author/components/CreateAuthor.tsx"
    click CreateGame "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/game/components/CreateGame.tsx"
    click CreateCategory "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/category/components/CreateCategory.tsx"
    click CreateCustomer "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/customer/components/CreateCustomer.tsx"
    click CreateBorrow "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/src/pages/borrow/components/CreateBorrow.tsx"
    click Vite "https://github.com/magdalenaszym/ludoteca-react/blob/master/ludoteca-react/vite.config.ts"

    %% Click Events Backend
    click SpringApp "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/src/main/java/com/ccsw/tutorial/TutorialApplication.java"
    click ModelMapperConfig "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/src/main/java/com/ccsw/tutorial/config/ModelMapperConfig.java"
    click Pom "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/pom.xml"
    click Controllers "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/src/main/java/com/ccsw/tutorial/author/AuthorController.java"
    click Controllers "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/src/main/java/com/ccsw/tutorial/game/GameController.java"
    click Controllers "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/src/main/java/com/ccsw/tutorial/category/CategoryController.java"
    click Controllers "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/src/main/java/com/ccsw/tutorial/customer/CustomerController.java"
    click Controllers "https://github.com/magdalenaszym/ludoteca-react/blob/master/tutorial/src/main/java/com/ccsw/tutorial/borrow/BorrowController.java"
    classDef frontend fill:#E3F2FD,stroke:#2196F3,stroke-width:1px
    classDef api fill:#E8F5E9,stroke:#4CAF50,stroke-width:1px
    classDef backend fill:#F1F8E9,stroke:#8BC34A,stroke-width:1px
    classDef db fill:#ECEFF1,stroke:#607D8B,stroke-width:1px,stroke-dasharray: 5 5
    classDef external fill:#FFF3E0,stroke:#FF9800,stroke-width:1px
    classDef network fill:#F3E5F5,stroke:#9C27B0,stroke-width:1px
    classDef tool fill:#FFFDE7,stroke:#FBC02D,stroke-width:1px
```
