Spring Boot codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API
This codebase was created to demonstrate a fully fledged fullstack application built with Spring Boot including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the Spring community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
Check out the live application on Render:
Resource | URL |
---|---|
api | https://realworld-backend-spring.onrender.com/api |
swagger-ui | https://realworld-backend-spring.onrender.com/swagger-ui/index.html |
💡 The application is deployed on a free tier, so it may take a few seconds to start.
- Spring Boot
- Spring Data JPA with Hibernate
- Liquibase for the database changes management
- Spring Security OAuth2 Resource Server JWT for authentication and authorization
- Spring Boot Actuator built-in endpoints
- Springdoc OpenAPI/Swagger
- Spring Declarative HTTP Clients for integration tests
- H2 in memory database
- GraalVM support
- Github Actions
- Building jar
- Building GraalVM native image for Linux, macOS, and Windows
- Building Docker image with the native executable and pushing it to GitHub Container Registry
- Execution of Realworld Postman collection with newman for all the builds
- Code coverage with Codecov
- Publishing GitHub release with the artifacts
- Triggering deployment on Render
Note that Java 17 or above is required to build the project with Gradle.
Run the application with Gradle:
./gradlew run
Or download the latest artifact from the releases page, and run:
java -jar realworld-backend-spring-*.jar
Run the application with Gradle:
./gradlew nativeRun
Or download the latest artifact for your platform from the releases page, unpack, and run the executable:
./realworld-backend-spring
Run the application with Docker:
docker run -p 8080:8080 ghcr.io/alexey-lapin/realworld-backend-spring:latest
The entry point address of the backend API is at http://localhost:8080/api
The repository contains a lot of test cases to cover both api test and repository test.
./gradlew test