Skip to content

Latest commit

 

History

History

realworld-app

RealWorld Example App

Spring Boot + Elasticsearch 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 Java + Spring Boot + Elasticsearch including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Java + Spring Boot + Elasticsearch community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

The application was made mainly demonstrate the new Elasticsearch Java API Client.

The application was built with:

Tests:

Structure

This is a multimodule gradle project:

  • rw-database
    • Elasticsearch client connection, queries, document classes
  • rw-rest
    • Spring rest controllers
  • rw-server

Getting started

JVM

A version of the JVM has to be installed, openjdk version "21.0.2" was used during development.

Elasticsearch

An Elasticsearch instance needs to be running for the application to start successfully. To start one easily, a docker-compose is provided, it will start Elasticsearch on port 9200 and Kibana on 5601; otherwise, the connection properties can be changed in application.properties.

Build:

./gradlew clean build

Start the server:

./gradlew run

Run

The application will start on 8080 with api context, it can be changed in application.properties.

Unit tests

A basic unit test using testcontainer (docker is required).