A modern web application built with Spring Boot and Vue.js that demonstrates best practices in full-stack development, REST API architecture, and frontend-backend integration.
- Features
- Technologies
- Architecture
- Installation
- Usage
- API Documentation
- Testing
- Deployment
- Contributing
- 🏗️ REST API Architecture - Well-structured RESTful API following best practices
- 🔄 Hot Reload - Agile development with automatic reload in frontend and backend
- 📊 Dual Database - H2 for development, PostgreSQL for production
- 🧪 Comprehensive Testing - Unit and integration tests with full coverage
- 📚 Automatic Documentation - Auto-generated API documentation
- 🎨 Modern Frontend - Reactive interface with Vue.js and Webpack
- 🔧 Automated Build - Build pipeline with Maven and frontend tools
- Java 8 - Main programming language
- Spring Boot 2.0 - Primary framework for web development
- Spring Data JPA - Data persistence and management
- Maven - Dependency management and build tool
- H2 Database - Embedded database for development
- PostgreSQL - Relational database for production
- Vue.js 2.x - Reactive JavaScript framework
- Webpack - JavaScript module bundler
- Yarn - JavaScript package manager
- Node.js 9.5 - JavaScript runtime
- JUnit - Unit testing framework
- Spring Boot Test - Integration testing
- AsciiDoc - API documentation
src/
├── main/
│ ├── java/ # Java source code
│ ├── resources/ # Configuration resources
│ ├── webapp/ # Vue.js frontend application
│ └── asciidoc/ # API documentation
└── test/
└── java/ # Unit and integration tests
The application follows a separation of concerns architecture:
- Controller Layer: HTTP request and response handling
- Service Layer: Business logic
- Repository Layer: Data access with Spring Data JPA
- Frontend: SPA with Vue.js communicating via REST API
- Java 8 or higher
- Maven 3.6+
- Node.js 9.5+
- Yarn 1.5+
git clone https://github.com/your-username/spring-demo.git
cd spring-demo
# Backend dependencies
mvn clean install
# Frontend dependencies (if webapp exists)
cd src/main/webapp
yarn install
cd ../../..
- Start the backend server:
mvn spring-boot:run
- Start the frontend server (in another terminal):
cd src/main/webapp
yarn start
- Access the application:
- Frontend: http://localhost:8080
- API: http://localhost:8080/api
# Build the complete project
mvn package
# Run the generated JAR
java -jar target/spring-demo-0.1.1.jar
The REST API documentation is automatically generated and available at:
- During development: http://localhost:8080/docs
- After build:
target/generated-docs/index.html
mvn prepare-package
mvn verify
mvn test
mvn failsafe:integration-test
mvn jacoco:report
# Database
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/springdemo
export SPRING_DATASOURCE_USERNAME=your_username
export SPRING_DATASOURCE_PASSWORD=your_password
# Spring Profile
export SPRING_PROFILES_ACTIVE=production
FROM openjdk:8-jre-slim
COPY target/spring-demo-0.1.1.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project demonstrates:
- Clean architecture and separation of concerns
- Full-stack integration between Spring Boot and Vue.js
- Best practices in modern web development
- Comprehensive testing and automatic documentation
- CI/CD ready pipeline with Maven
- Dual configuration for development and production
This project is licensed under the MIT License - see the LICENSE file for details.
⭐ Like this project? Give it a star on GitHub!
📧 Contact: your-email@example.com | LinkedIn | Portfolio