• Stars
    star
    1,252
  • Rank 36,091 (Top 0.8 %)
  • Language
    Java
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

RealWorld Example App using Kotlin and Spring

Actions

Spring boot + MyBatis 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 full-stack application built with Spring boot + Mybatis including CRUD operations, authentication, routing, pagination, and more.

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

NEW GraphQL Support

Following some DDD principles. REST or GraphQL is just a kind of adapter. And the domain layer will be consistent all the time. So this repository implement GraphQL and REST at the same time.

The GraphQL schema is https://github.com/gothinkster/spring-boot-realworld-example-app/blob/master/src/main/resources/schema/schema.graphqls and the visualization looks like below.

And this implementation is using dgs-framework which is a quite new java graphql server framework.

How it works

The application uses Spring Boot (Web, Mybatis).

  • Use the idea of Domain Driven Design to separate the business term and infrastructure term.
  • Use MyBatis to implement the Data Mapper pattern for persistence.
  • Use CQRS pattern to separate the read model and write model.

And the code is organized as this:

  1. api is the web layer implemented by Spring MVC
  2. core is the business model including entities and services
  3. application is the high-level services for querying the data transfer objects
  4. infrastructure contains all the implementation classes as the technique details

Security

Integration with Spring Security and add other filter for jwt token process.

The secret key is stored in application.properties.

Database

It uses a H2 in-memory database sqlite database (for easy local test without losing test data after every restart), can be changed easily in the application.properties for any other database.

Getting started

You'll need Java 11 installed.

./gradlew bootRun

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

curl http://localhost:8080/tags

Try it out with Docker

You'll need Docker installed.

./gradlew bootBuildImage --imageName spring-boot-realworld-example-app
docker run -p 8081:8080 spring-boot-realworld-example-app

Try it out with a RealWorld frontend

The entry point address of the backend API is at http://localhost:8080, not http://localhost:8080/api as some of the frontend documentation suggests.

Run test

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

./gradlew test

Code format

Use spotless for code format.

./gradlew spotlessJavaApply

Help

Please fork and PR to improve the project.

More Repositories

1

realworld

"The mother of all demo apps" β€” Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more
TypeScript
78,236
star
2

react-redux-realworld-example-app

Exemplary real world application built with React + Redux
JavaScript
5,538
star
3

angular-realworld-example-app

Exemplary real world application built with Angular
TypeScript
5,079
star
4

vue-realworld-example-app

An exemplary real-world application built with Vue.js, Vuex, axios and different other technologies. This is a good example to discover Vue for beginners.
JavaScript
4,053
star
5

node-express-realworld-example-app

TypeScript
3,524
star
6

golang-gin-realworld-example-app

Exemplary real world application built with Golang + Gin
Go
2,440
star
7

aspnetcore-realworld-example-app

ASP.NET Core backend implementation for RealWorld
C#
1,872
star
8

django-realworld-example-app

Python
1,593
star
9

react-mobx-realworld-example-app

Exemplary real world application built with React + MobX
JavaScript
1,245
star
10

laravel-realworld-example-app

Exemplary real world backend API built with Laravel
PHP
1,186
star
11

flask-realworld-example-app

Exemplary real world JSON API built with Flask (Python)
Python
891
star
12

elixir-phoenix-realworld-example-app

Exemplary real world application built with Elixir + Phoenix
Elixir
887
star
13

angularjs-realworld-example-app

Exemplary real world application built with Angular 1.5 + ES6
JavaScript
450
star
14

kotlin-spring-realworld-example-app

Kotlin
443
star
15

slim-php-realworld-example-app

Exemplary real world application built with Slim
PHP
428
star
16

rails-realworld-example-app

Ruby
427
star
17

realworld-starter-kit

Starter kit for new RealWorld framework implementations
407
star
18

swift

A better way to learn swift.
274
star
19

koa-knex-realworld-example

JavaScript
241
star
20

aurelia-realworld-example-app

Exemplary real world application built with Aurelia
JavaScript
184
star
21

ember-realworld

Ember.js RealWorld Implementation
JavaScript
182
star
22

web-components-realworld-example-app

Exemplary real world application built with Vanilla JS Web Components
JavaScript
171
star
23

scala-play-realworld-example-app

Exemplary real world application built with Scala 2.13 & Play
Scala
154
star
24

node-express-prisma-v1-official-app

Official real world application built with Node + Express + Typescript + Prisma
TypeScript
147
star
25

gcp-datastore-cloud-functions-realworld-example-app

Serverless GCP Cloud Functions + Datastore implementation of RealWorld Backend
JavaScript
144
star
26

cakephp-realworld-example-app

PHP
105
star
27

moleculer-node-realworld-example-app

Exemplary real world application built with Moleculer
JavaScript
103
star
28

clojurescript-reframe-realworld-example-app

Exemplary real world application built with ClojureScript + re-frame
Clojure
102
star
29

apprun-realworld-example-app

Exemplary real world application built with AppRun
TypeScript
101
star
30

fsharp-realworld-example-app

Exemplary real world application built with F#
F#
95
star
31

hapijs-realworld-example-app

Real World Hapi.JS + Mongoose backend implementations
JavaScript
78
star
32

clojurescript-keechma-realworld-example-app

Exemplary real world application built with ClojureScript & Keechma
Clojure
72
star
33

reasonml-realworld-example-app

Exemplary real world application built with ReasonML
Reason
59
star
34

conduit-bootstrap-template

HTML
33
star
35

dojo-realworld-example-app

Exemplary real world application built with Dojo2
TypeScript
29
star
36

angularfire-slack

JavaScript
27
star
37

QEWD-realworld-example-app

JavaScript
22
star
38

crizmas-mvc-realworld-example-app

Exemplary real world application built with Crizmas MVC (React)
JavaScript
17
star
39

express-prisma-official-app

TypeScript
14
star
40

jswiki

The wiki for modern Javascript terminology
HTML
13
star
41

conduit-angularjs-final

JavaScript
10
star
42

conduit-sass

HTML
8
star
43

conduit-django

Python
8
star
44

thinkdown

Preview markdown as it appears on https://thinkster.io
CSS
6
star
45

test-routes

JavaScript
6
star
46

conduit-react-client-final

JavaScript
4
star
47

conduit-rails4-api-final

Ruby
4
star
48

course-boilerplate

3
star
49

mean-stack-tutorial

3
star
50

realworld-api-action

GitHub Action running a Postman collection to test the compliance of a backend implementation of RealWorld specs
JavaScript
3
star
51

api-realworld

TypeScript
2
star
52

gothinkster.github.io

HTML
2
star
53

conduit-rails4

Ruby
2
star
54

conduit-rails

Ruby
2
star
55

conduit-angular

HTML
1
star
56

thinkster-author

Authoring site for Thinkster.io Authors
1
star
57

blog

Thinkster blog
1
star
58

imperial

JavaScript
1
star
59

conduit-api

TypeScript
1
star
60

transactional

1
star
61

realworld-e2e-tests

E2e test suite for RealWorld demo
JavaScript
1
star
62

realworld-tribe-angular-app

HTML
1
star
63

realworld-tribe-nestjs-app

TypeScript
1
star