How jonashackt/spring-boot-vuejs works
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.