sivaprasadreddy / spring-blog

Blogging platform using Java and Spring Boot
MIT License
7 stars 3 forks source link
docker docker-compose flyway java maven postgresql spring-boot spring-data-jpa testcontainers thymeleaf

Spring-Blog

A blogging platform using Java and Spring Boot.

Prerequisites

Install JDK, Maven using SDKMAN

$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk install java 21.0.1-tem
$ sdk install gradle
$ sdk install maven

Verify the prerequisites

$ java -version
$ docker info
$ docker compose version

Tech Stack:

Features

Database Design

Blog DB Schema Design

How to?

Run Unit / Integration Tests

$ ./mvnw verify

Format code

You can format the code automatically using spotless-maven-plugin

$ ./mvnw spotless:apply // to formatting code automatically
$ ./mvnw spotless:check // to verify the code formatting

Run application locally

We can use Docker Compose or Testcontainers to start the dependent services like database, mail server, etc.

To start the application using docker-compose:

$ ./mvnw spring-boot:run

To start the application using Testcontainers:

$ ./mvnw spring-boot:test-run

The application is accessible at http://localhost:8080/.

How to contribute?