realworld-backend-spring icon indicating copy to clipboard operation
realworld-backend-spring copied to clipboard

Real world backend API built in Spring Boot

RealWorld Example App using Spring

Spring Boot codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API

CI Codecov

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.

Actual application is accessible on Heroku: https://realworld-backend-spring.herokuapp.com/api

How it works

This application basically uses Spring Boot Framework with Java 8 with some other principles and modules:

  • Ports and Adapters architecture
  • Command and Query Responsibility Segregation (CQRS)
  • Spring Data with Hibernate
  • Json Web Token jjwt
  • H2 in memory database

Some other highlights:

Getting started

Java 8 or above is required

./gradlew bootRun

To test that it works, open a browser tab at http://localhost:8080/api/tags .
Alternatively, you can run

curl http://localhost:8080/api/tags

Try it out with a RealWorld frontend

The entry point address of the backend API is at http://localhost:8080/api

Run test

The repository contains a lot of test cases to cover both api test and repository test.

./gradlew test