Coder Social home page Coder Social logo

springboot-docker's Introduction

Spring Boot Application Starter

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.

Features

  • 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.

Getting Started

Prerequisites

  • Docker
  • Docker-Compose

Installation

  1. Clone the repository:

    git clone [email protected]:satodu/springboot-docker.git
    cd springboot-docker
  2. Copy the env file based in file .env.example:

    cp .env.example .env
  3. Start the environment with docker-compose:

    docker-compose up

Your application and MySQL database will now be accessible at http://localhost:6868.

Features in Detail

Thymeleaf Integration

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.

User & Event Registration Pages

Access /users/new and /events/new to interact with the user and event registration forms, dynamically rendered using Thymeleaf templates.

OMDB API Example

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.

Database Migrations with Flyway

Flyway simplifies database migrations. Add new migrations in src/main/resources/db/migration to evolve your schema.

Hot-Reload Setup

Spring Boot DevTools and Docker facilitate hot-reload. Enjoy immediate updates to your application without restarts.

Acknowledgements

Thank you to all contributors for their hard work and dedication to this project.

License

This project is under the MIT License - see the LICENSE.md file for details.

springboot-docker's People

Watchers

Eduardo Neres Goulart Sato avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.