Welcome to our Spring Boot Application Starter! This setup is designed to streamline your development process, featuring hot-reload capabilities, database migrations with Flyway, MySQL in Docker, and dynamic HTML rendering with Thymeleaf. Get started quickly with just docker-compose up
.
- Spring Boot & Maven: Simplify your Java development with Spring Boot and manage dependencies with Maven.
- Hot-Reload with Docker: Develop seamlessly with hot-reload enabled through Docker, allowing instant feedback.
- Flyway Database Migrations: Manage your database schema with Flyway for reliable migrations.
- MySQL in Docker: Use a pre-configured MySQL database within Docker for a consistent development environment.
- Thymeleaf Templates: Create dynamic HTML views with Thymeleaf, a modern server-side Java template engine.
- User & Event Registration System: Built-in functionality for registering users and events.
- OMDB API Consumption: Example of consuming external APIs, such as OMDB for movie data.
- Docker
- Docker-Compose
-
Clone the repository:
git clone [email protected]:satodu/springboot-docker.git cd springboot-docker
-
Copy the env file based in file
.env.example
:cp .env.example .env
-
Start the environment with docker-compose:
docker-compose up
Your application and MySQL database will now be accessible at http://localhost:6868
.
Thymeleaf is integrated for rendering dynamic HTML content. It allows for clear separation of server-side logic and HTML design, enhancing maintainability and developer productivity.
Access /users/new
and /events/new
to interact with the user and event registration forms, dynamically rendered using Thymeleaf templates.
Fetch movie data with an example controller method using Thymeleaf to display the results:
@GetMapping("/movies/{title}")
public String getMovieData(@PathVariable String title, Model model) {
// Example of consuming OMDB API
String omdbUrl = "http://www.omdbapi.com/?t=" + title + "&apikey=yourapikey";
Movie movie = restTemplate.getForObject(omdbUrl, Movie.class);
model.addAttribute("movie", movie);
return "movie-view";
}
Replace yourapikey with your OMDB API key. Thymeleaf will render movie-view.html to display the fetched movie data.
Flyway simplifies database migrations. Add new migrations in src/main/resources/db/migration to evolve your schema.
Spring Boot DevTools and Docker facilitate hot-reload. Enjoy immediate updates to your application without restarts.
Thank you to all contributors for their hard work and dedication to this project.
This project is under the MIT License - see the LICENSE.md file for details.