This repository contains the source code for the SpringBoot Workshop, a project designed to demonstrate the basics of building web applications using Spring Boot. The workshop includes examples of various Spring Boot features and integrations, including a MySQL database setup using Docker.
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/davidmillan5/SpringBoot_Workshop.git cd SpringBoot_Workshop
-
Ensure you have Java 8 or higher installed. You can check your Java version with:
java -version
-
Ensure you have Gradle installed. You can check your Gradle version with:
gradle -v
-
Ensure you have Docker installed. You can check your Docker version with:
docker --version
The application uses a MySQL database. To set up the MySQL database, use Docker:
docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysql12345678 -p 3308:3306/tcp mysql:latest
Update the src/main/resources/application.properties
file with your database configuration:
spring.datasource.url=jdbc:mysql://localhost:3308/<DB_NAME>
spring.datasource.username=root
spring.datasource.password=mysql12345678
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.generate-ddl=true
spring.jpa.show-sql=true
Replace <DB_NAME>
with your MySQL database name.
To run the application, use the following command:
gradle bootRun
The application will start on http://localhost:8080
.
Once the application is running, you can interact with it using the provided endpoints. Detailed information about the available endpoints and their usage can be found in the project's documentation.
Contributions are welcome! To contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch with your feature or bug fix:
git checkout -b feature-branch
- Commit your changes:
git commit -m "Add new feature"
- Push to the branch:
git push origin feature-branch
- Create a Pull Request.
http://localhost:8080/swagger-ui.html
This project is licensed under the MIT License. See the LICENSE file for details.