Go to file
2018-05-10 23:27:57 -07:00
gradle/wrapper Spring Boot 2.0.2 2018-05-10 09:50:14 +03:00
src Fix deprecation warnings 2018-05-10 09:50:44 +03:00
.gitignore register api 2017-08-08 11:01:06 +08:00
build.gradle Spring Boot 2.0.2 2018-05-10 09:50:14 +03:00
docker-compose.yml adding docker-compose file 2018-01-02 23:25:49 -08:00
Dockerfile adding a dockerfile and instructions on how to try out the app in a container 2018-01-01 20:55:43 -08:00
example-logo.png update readme 2017-08-18 17:40:21 +08:00
gradlew Spring Boot 2.0.2 2018-05-10 09:50:14 +03:00
gradlew.bat register api 2017-08-08 11:01:06 +08:00
README.md adding docker-compose file 2018-01-02 23:25:49 -08:00

RealWorld Example App using Kotlin and Spring

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 fullstack 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.

How it works

The application uses Spring boot (Web, Mybatis).

  • Use the idea of Domain Driven Design to separate the business term and infrastruture 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 organize as this:

  1. api is the web layer to implement by Spring MVC
  2. core is the business model including entities and services
  3. application is the high level services for query with 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 (for now), can be changed easily in the application.properties for any other database.

Getting started

You need Java installed.

./gradlew bootRun
open http://localhost:8080

Try it out with Docker

You need Docker installed.

docker-compose up -d

Run test

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

./gradlew test

Help

Please fork and PR to improve the code.