Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Spring boot java implementation of realworld example.app

License

NotificationsYou must be signed in to change notification settings

raeperd/realworld-springboot-java

Repository files navigation

RealWorld example apps coverBuildLicense: MIT

ReadWorld.io backend project using spring boot java usingspring-security,spring-data-jpa

Insprired by

Getting started

Build from scratch

$ ./gradlew build bootRun

Using docker

$ docker run --rm -p 8080:8080 ghcr.io/raeperd/realworld-spring-boot-java:master
  • Dockerhub registry ishere
  • Container tags are simply branch name of this repository following git-flow strategy

How to test

After run application, you can try one of followings

using shell script

$ ./doc/run-api-tests.sh

using postman

Import./doc/Conduit.postman_collection.json in your postman application

And also, puregradle test covers almost every line of code.

More details can be found in./doc/README.md andoriginal source

Overview

Design Principal

  • Alwaysfinal whenever possible
  • Always package private class whenever possible
  • Always test every package, class, method, instruction in codes
  • Try to avoid including additional dependencies as much as possible
    • Implements JWT generation / validation logic without 3rd party library#3
  • Try to maintain codes in domain package remain POJO
    • Except for special spring annotations like@Service,@Repository,@Transactional
    • Prohibit use of lombok in domain package
  • Try to follow all modern best practices for spring-boot project

Diagrams

User

realworld-User

  • Separate password encoding logic out of User.
  • User must be created with password encoder.

Article

realworld-Article

  • Article contains other elements with@Embedded classes
  • Try to reduce number of repositories.
  • Prefer@JoinTable to@JoinColumn

JWT

realworld-Jwt

  • Try not to use 3rd party library
  • Serialization and Deserialization are seperated with interfaces
  • Domain package contains interface, infrastructure code provide implementation
  • Application package do stuff with spring-security logic

Performance

performance

What can be done more

  • User class doing so many things now. It can be improved someway.
  • Service classes can be divided into smaller services
  • Test cases order can be improved

Contact

You can contact me withemail or issue in this project

License

MIT License

Referenced

About

Spring boot java implementation of realworld example.app

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages


[8]ページ先頭

©2009-2025 Movatter.jp