# kevicole/fullstack-starter architecture

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

- Interactive diagram: https://gitdiagram.com/kevicole/fullstack-starter
- Repository: https://github.com/kevicole/fullstack-starter

## Overview

##### Project Type and Purpose
- This is a full-stack web application starter project.
- Backend: Java Spring Boot service exposing REST endpoints for Inventory and Product management.
- Frontend: React application (with Redux “ducks” pattern) that consumes those endpoints.
- Sample-data and import script are provided to seed/refresh the database.

##### File Structure
- Top-level:
- sample-data/ (import.sh + JSON data)
- starter/ (Spring Boot backend)
- ui/ (React/Redux frontend)
- starter/src/main/java/com/starter/fullstack:
- api/ → DTOs (Inventory, Product, UnitOfMeasurement)
- dao/ → data access classes
- rest/ → Spring MVC controllers
- config/ → Boot config, security config+properties
- StarterApp.java → main entry point
- ui/src:
- components/ → reusable React components (forms, tables, modals)
- containers/ → layout + view containers per route
- ducks/ → Redux modules (actions + reducers)
- middleware/, reducers/, constants/, hooks/, themes/

##### README for Additional Insights
- Confirms Spring Boot + Gradle for backend; NodeJS + npm for frontend.
- Instructions to build/run each side separately.
- Sample-data import seeds the backing DB.

- Break the backend into:
- Entry point (StarterApp)
- Configuration modules (StarterConfig, WebSecurityConfig)
- API layer (InventoryController, ProductController)
- Data layer (InventoryDAO, ProductDAO)
- Persistence (DB + sample data script)
- Break the frontend into:
- UI Components (forms, modals, tables)
- Containers (page/layout components)
- State management (ducks: actions + reducers, middleware)
- Routing (if any) + constants + themes
- Third-party frameworks (Spring Security, Redux Thunk or Saga if used)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        User["User"]:::external
        Browser["Browser"]:::frontend
        ReactApp["React App"]:::frontend
        ReduxStore["Redux Store"]:::frontend
        HTTPClient["HTTP Client (fetch/axios)"]:::frontend

        User -->|"interacts with"| Browser
        Browser -->|"renders"| ReactApp
        ReactApp -->|"dispatches actions"| ReduxStore
        ReduxStore -->|"uses"| HTTPClient
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        StarterApp["StarterApp.java"]:::backend
        StarterConfig["StarterConfig.java"]:::backend
        WebSecurityConfig["WebSecurityConfig.java"]:::backend
        WebSecurityProps["WebSecurityProperties.java"]:::backend
        InventoryController["InventoryController"]:::api
        ProductController["ProductController"]:::api
        InventoryDAO["InventoryDAO"]:::dao
        ProductDAO["ProductDAO"]:::dao
        ApplicationProps["application.properties"]:::config
        DTOs["API DTOs (Inventory, Product, UnitOfMeasurement)"]:::api

        StarterApp --> StarterConfig
        StarterApp --> WebSecurityConfig
        WebSecurityConfig --> WebSecurityProps
        StarterApp --> InventoryController
        StarterApp --> ProductController
        InventoryController --> InventoryDAO
        ProductController --> ProductDAO
        InventoryDAO --> ApplicationProps
        ProductDAO --> ApplicationProps
        InventoryController --> DTOs
        ProductController --> DTOs
    end

    %% Database
    Database["Database"]:::db

    %% Data Flow
    HTTPClient -->|"HTTP requests"| InventoryController
    HTTPClient -->|"HTTP requests"| ProductController
    InventoryController -->|"CRUD operations"| InventoryDAO
    ProductController -->|"CRUD operations"| ProductDAO
    InventoryDAO -->|"queries"| Database
    ProductDAO -->|"queries"| Database
    Database -->|"results"| InventoryDAO
    Database -->|"results"| ProductDAO
    InventoryDAO --> InventoryController
    ProductDAO --> ProductController
    InventoryController -->|"JSON response"| HTTPClient
    ProductController -->|"JSON response"| HTTPClient
    HTTPClient --> ReduxStore
    ReduxStore --> ReactApp
    ReactApp --> Browser

    %% Sample Data Import
    SampleData["sample-data/import.sh"]:::script
    InventoryJSON["sample-data/inventory.json"]:::script
    ProductJSON["sample-data/product.json"]:::script
    SampleData -.->|"loads data"| Database
    InventoryJSON -.-> Database
    ProductJSON -.-> Database

    %% Click Events
    click SampleData "https://github.com/kevicole/fullstack-starter/blob/main/sample-data/import.sh"
    click InventoryJSON "https://github.com/kevicole/fullstack-starter/blob/main/sample-data/inventory.json"
    click ProductJSON "https://github.com/kevicole/fullstack-starter/blob/main/sample-data/product.json"
    click StarterApp "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/StarterApp.java"
    click StarterConfig "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/config/StarterConfig.java"
    click WebSecurityConfig "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/config/WebSecurityConfig.java"
    click WebSecurityProps "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/config/WebSecurityProperties.java"
    click InventoryController "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/rest/InventoryController.java"
    click ProductController "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/rest/ProductController.java"
    click InventoryDAO "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/dao/InventoryDAO.java"
    click ProductDAO "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/dao/ProductDAO.java"
    click ApplicationProps "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/resources/application.properties"
    click DTOs "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/api/Inventory.java"
    click DTOs "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/api/Product.java"
    click DTOs "https://github.com/kevicole/fullstack-starter/blob/main/starter/src/main/java/com/starter/fullstack/api/UnitOfMeasurement.java"
    click ReactApp "https://github.com/kevicole/fullstack-starter/blob/main/ui/src/index.js"
    click HTTPClient "https://github.com/kevicole/fullstack-starter/blob/main/ui/src/middleware/index.js"
    click ReduxStore "https://github.com/kevicole/fullstack-starter/blob/main/ui/src/reducers/index.js"
    click ReactApp "https://github.com/kevicole/fullstack-starter/blob/main/ui/src/index.js"
    click Browser "https://github.com/kevicole/fullstack-starter/blob/main/ui/public/index.html"
    click ReactApp "https://github.com/kevicole/fullstack-starter/blob/main/ui/public/config.json"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0288D1,color:#000
    classDef backend fill:#D0FFD0,stroke:#388E3C,color:#000
    classDef api fill:#E8F5E9,stroke:#66BB6A,color:#000
    classDef dao fill:#F1F8E9,stroke:#8BC34A,color:#000
    classDef config fill:#FFF8E1,stroke:#FFA000,color:#000
    classDef db fill:#FFE0B2,stroke:#FB8C00,color:#000
    classDef script fill:#F3E5F5,stroke:#8E24AA,color:#000
    classDef external fill:#FFEBEE,stroke:#E53935,color:#000
```
