Giter VIP home page Giter VIP logo

realworld-springboot-java's Introduction

RealWorld example apps cover Build Lines of Code Coverage Reliability Rating License: MIT

ReadWorld.io backend project using spring boot java using spring-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 is here
  • 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, pure gradle test covers almost every line of code.

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

Overview

Design Principal

  • Always final 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 with email or issue in this project

License

MIT License

Referenced

realworld-springboot-java's People

Contributors

raeperd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.