# jonashackt/spring-boot-vuejs architecture

> Architecture diagram of the GitHub repository jonashackt/spring-boot-vuejs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jonashackt/spring-boot-vuejs
- Repository: https://github.com/jonashackt/spring-boot-vuejs

## Overview

##### Project Type and Purpose
- This is a full-stack single-page application (SPA) combining
- A Java/Spring Boot backend (REST API, embedded Tomcat)
- A Vue CLI-3 frontend (Vue.js SPA, Vue Router, Vuex store)
- It demonstrates the end-to-end workflow: local dev with webpack-dev-server, Maven-driven builds (frontend-maven-plugin), unit/e2e tests, Docker multi-stage builds, CI/CD via GitHub Actions → Heroku/Docker Hub, and optional Spring Security.

##### File Structure Analysis
- Top-level files: parent pom.xml, Maven wrappers, Dockerfile, .github/workflows, Procfile, system.properties, CI/CD config.
- Modules:
- backend/ – Spring Boot code (controllers, domain, repository, configuration), application.properties, JPA tests.
- frontend/ – Vue.js app (src/, public/, package.json, Vue Router, Vuex, axios wrapper, unit tests with Jest, e2e tests with Nightwatch, vue.config.js to set outputDir & devServer.proxy).
- Build & deployment: frontend-maven-plugin in frontend/pom.xml, Spring Boot Maven Plugin + resources plugin in backend/pom.xml to bundle the SPA, Dockerfile for multi-stage build, Heroku app.json/Procfile.

##### Key Architectural Insights from README
- Maven parent POM orchestrates both modules.
- Development:
- npm run serve → webpack-dev-server (proxy /api → Spring Boot on port 8098).
- CORS handled via devServer.proxy instead of @CrossOrigin.
- Production:
- npm run build → target/dist (static assets) → copied into backend’s src/main/resources/public → served by embedded Tomcat.
- Testing pipeline:
- Unit tests: JUnit (backend), Jest (frontend).
- E2E tests: Nightwatch.
- CI/CD: GitHub Actions (matrix JDK 8/11/15), Codecov, Docker Hub automated builds, Heroku automatic deploys.
- Optional features: environment-driven DB (H2 in tests, Heroku Postgres), Spring Security (basic auth), OAuth/JWT extensions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Workstation
    subgraph "Developer Workstation"
        IDE["IDE & Git Checkout"]:::tool
        BrowserDev["Browser & Vue Devtools"]:::tool
    end

    %% Local Development
    subgraph "Local Development"
        DevFrontend["webpack-dev-server (port 8080)"]:::service
        DevBackend["Spring Boot Dev Server (port 8098)"]:::service
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        GitHubActions["GitHub Actions"]:::cloud
        MavenParentPOM["Maven Parent POM"]:::gear
        MavenWrapper["Maven Wrapper"]:::gear
        NpmScripts["npm & frontend-maven-plugin"]:::gear
        UnitTests["Unit Tests\n(JUnit, Jest)"]:::gear
        E2ETests["E2E Tests\n(Nightwatch)"]:::gear
        DockerBuild["Docker Multi-Stage Build"]:::gear
        DockerHub["Docker Hub"]:::cloud
        HerokuRegistry["Heroku Registry"]:::cloud
        BuildConfig["GitHub Workflow\n(.github/workflows/build.yml)"]:::cloud
    end

    %% Production
    subgraph "Production"
        BrowserProd["Browser"]:::user
        HerokuDyno["Heroku Dyno\n(Spring Boot + static SPA)"]:::service
        EmbeddedTomcat["Embedded Tomcat"]:::service
        Database["Database\n(Heroku Postgres / H2)"]:::db
    end

    %% External Services
    subgraph "External Services"
        GitHub["GitHub (Source)"]:::cloud
        Codecov["Codecov"]:::cloud
    end

    %% Developer Flow
    IDE -->|code push| GitHub
    BrowserDev --> DevFrontend
    DevFrontend -->|proxy /api| DevBackend

    %% CI/CD Flow
    GitHub -->|trigger| GitHubActions
    GitHubActions -->|runs| BuildConfig
    GitHubActions --> MavenParentPOM
    GitHubActions --> MavenWrapper
    GitHubActions --> NpmScripts
    MavenParentPOM --> UnitTests
    NpmScripts --> UnitTests
    UnitTests --> Codecov
    MavenParentPOM --> E2ETests
    NpmScripts --> E2ETests
    E2ETests --> Codecov
    GitHubActions --> DockerBuild
    DockerBuild --> DockerHub
    DockerBuild --> HerokuRegistry
    HerokuRegistry --> HerokuDyno

    %% Production Flow
    BrowserProd --> HerokuDyno
    HerokuDyno --> EmbeddedTomcat
    EmbeddedTomcat --> Database
    EmbeddedTomcat --> BrowserProd
    BrowserProd -->|API calls| EmbeddedTomcat

    %% Click Events
    click MavenParentPOM "https://github.com/jonashackt/spring-boot-vuejs/blob/master/pom.xml"
    click MavenWrapper "https://github.com/jonashackt/spring-boot-vuejs/blob/master/.mvn/wrapper/maven-wrapper.jar"
    click MavenWrapper "https://github.com/jonashackt/spring-boot-vuejs/blob/master/.mvn/wrapper/maven-wrapper.properties"
    click BuildConfig "https://github.com/jonashackt/spring-boot-vuejs/blob/master/.github/workflows/build.yml"
    click DockerBuild "https://github.com/jonashackt/spring-boot-vuejs/tree/master/Dockerfile"
    click HerokuRegistry "https://github.com/jonashackt/spring-boot-vuejs/tree/master/Procfile"
    click HerokuRegistry "https://github.com/jonashackt/spring-boot-vuejs/blob/master/app.json"
    click HerokuRegistry "https://github.com/jonashackt/spring-boot-vuejs/blob/master/system.properties"

    %% Component Clicks - Backend
    click SpringApp "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/main/java/de/jonashackt/springbootvuejs/SpringBootVuejsApplication.java"
    click BackendController "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/main/java/de/jonashackt/springbootvuejs/controller/BackendController.java"
    click DomainModel "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/main/java/de/jonashackt/springbootvuejs/domain/User.java"
    click Repository "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/main/java/de/jonashackt/springbootvuejs/repository/UserRepository.java"
    click AppProperties "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/main/resources/application.properties"
    click SpaFilter "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/main/java/de/jonashackt/springbootvuejs/configuration/SpaRedirectFilterConfiguration.java"
    click SecurityConfig "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/main/java/de/jonashackt/springbootvuejs/configuration/WebSecurityConfiguration.java"
    click BackendControllerTest "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/test/java/de/jonashackt/springbootvuejs/controller/BackendControllerTest.java"
    click RepositoryTest "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/test/java/de/jonashackt/springbootvuejs/repository/UserRepositoryTest.java"
    click SpaRedirectTest "https://github.com/jonashackt/spring-boot-vuejs/blob/master/backend/src/test/java/de/jonashackt/springbootvuejs/configuration/SpaRedirectTest.java"

    %% Component Clicks - Frontend
    click MainJS "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/main.js"
    click AppVue "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/App.vue"
    click Router "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/router/index.ts"
    click Store "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/store/index.ts"
    click ApiWrapper "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/api/backend-api.ts"
    click HelloComponent "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/components/HelloSpringWorld.vue"
    click ViewHome "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/views/Home.vue"
    click ViewLogin "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/views/Login.vue"
    click ViewProtected "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/views/Protected.vue"
    click ViewService "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/views/Service.vue"
    click ViewUser "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/views/User.vue"
    click ViewBootstrap "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/src/views/Bootstrap.vue"
    click VueConfig "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/vue.config.js"
    click FrontendPOM "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/pom.xml"
    click PackageJson "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/package.json"
    click UnitTestApp "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/tests/unit/App.spec.ts"
    click UnitTestHello "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/tests/unit/components/HelloSpringWorld.spec.ts"
    click UnitTestUser "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/tests/unit/views/User.spec.ts"
    click E2ETestHello "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/tests/e2e/specs/HelloAcceptance.test.js"
    click E2ETestPage "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/tests/e2e/specs/test-with-pageobjects.js"
    click E2EPageObject "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/tests/e2e/page-objects/homepage.js"
    click E2ECmds "https://github.com/jonashackt/spring-boot-vuejs/tree/master/frontend/tests/e2e/custom-commands/"
    click E2EAsserts "https://github.com/jonashackt/spring-boot-vuejs/tree/master/frontend/tests/e2e/custom-assertions/"
    click TsConfig "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/tsconfig.json"
    click ESLintRC "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/.eslintrc.js"
    click ESLintIgnore "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/.eslintignore"
    click Browserslist "https://github.com/jonashackt/spring-boot-vuejs/blob/master/frontend/.browserslistrc"

    %% Styles
    classDef service fill:#D0E8FF,stroke:#0366D6,color:#0366D6
    classDef db fill:#E3F9E5,stroke:#28A745,color:#22863A
    classDef gear fill:#FFEFD5,stroke:#D2691E,color:#A0522D
    classDef cloud fill:#F0E6FF,stroke:#6F42C1,color:#5A32A3
    classDef tool fill:#FFF5B1,stroke:#735C0F,color:#735C0F
    classDef user fill:#E6F4FF,stroke:#0366D6,color:#0366D6
```
