A project for learning Java Spring Boot basics through building a vending machine application.
This is a learning project that implements a vending machine system using Spring Boot. It demonstrates fundamental concepts including REST APIs, JPA data persistence, and dependency injection.
- Java 17
- Spring Boot 4.0.0
- Spring Boot Starter Web MVC
- Spring Boot Starter Data JPA
- H2 Database (in-memory database)
- Lombok (for reducing boilerplate code)
- Maven (dependency management)
vending-machine/
├── src/
│ ├── main/
│ │ ├── java/
│ │ └── resources/
│ └── test/
├── pom.xml
├── mvnw
└── mvnw.cmd
- Java 17 or higher
- Maven (or use the included Maven wrapper)
- Clone the repository:
git clone https://github.com/liantan625/Vending-Machine.git
cd Vending-Machine- Build the project:
./mvnw clean install- Run the application:
./mvnw spring-boot:runThe application will start on http://localhost:8080
- RESTful API endpoints
- JPA entity management
- H2 in-memory database integration
- Lombok annotations for cleaner code
Run the tests using:
./mvnw testThis project covers:
- Setting up a Spring Boot application
- Creating REST controllers
- Working with Spring Data JPA
- Database configuration and management
- Using Lombok for code simplification
- Maven project structure and dependency management
This is a personal learning project, but suggestions and feedback are welcome!
This project is open source and available for educational purposes.
liantan625
- GitHub: @liantan625
Built with ☕ while learning Spring Boot