Skip to content

naturalprogrammer/spring-lemon

Repository files navigation

Spring Lemon

Note: for latest patterns and best practices, follow the successor https://github.com/naturalprogrammer/np-spring-mvc-demo

When developing real-world Spring REST APIs and microservices, you face many challenges like

  1. How to follow a stateless and efficient security model – using JWT authentication, session sliding etc.
  2. How to configure Spring Security to suit API development, e.g. returning 200 or 401 responses on login, configuring CORS, JSON vulnerability protection, etc.
  3. How to elegantly do validations and exceptions and send precise errors to the client.
  4. How to easily mix manual and bean validations in a single validation cycle.
  5. How exactly to support multiple social sign up/in, using OpenID Connect or OAuth2 providers such as Google and Facebook.
  6. How to code a robust user module (with features like sign up, sign in, verify email, social sign up/in, update profile, forgot password, change password, change email, token authentication etc.) and share it across all your applications.
  7. How to correctly and effeciently secure microservices, using long-lived and short-lived JWTs.
  8. What would be good ways to test your API.
  9. How to do Captcha validation.
  10. How to properly organize application properties.
  11. How to use PATCH and JsonPatch to handle partial updates correctly.
  12. How to do all the above reactively, using WebFlux and WebFlux security.

Coding all this rightly needs in-depth knowledge of Spring. It also takes a lot of development time and effort, and needs to be properly maintained as new versions of Spring comes out.

Spring Lemon relieves you of all this burden. It's a set of configurable and extensible libraries, providing all above features. Use these to develop quality reactive or non-reactive monolith or microservices applications quickly and easily.

Even if you don't plan to use Spring Lemon, it's a good example to learn from, because it showcases the essential best practices for developing elegant web services and microservices using Spring.

Most Spring Boot applications can use Spring Lemon straight away, with some simple configurations. But, if you don't find it suitable for your application, feel free to fork it, or just roll out your own library by learning its patterns and practices. Better yet, be a contributor!

Read this quick starter guide or watch this video tutorial for getting started.

Libraries hierarchy

For example usages, see

Documentation and Resources

Our Spring Framework Recipes For Real World Application Development — a live book discussing key real-world topics on developing Spring applications and APIs — is now available for FREE. Click here to get it.

  1. Feature demo: https://youtu.be/6mNg-Feq8CY
  2. Getting started guide
    1. Book
    2. Video Tutorial
  3. Official Documentation
  4. Example applications
  5. API documentation of the above applications.
  6. Example AngularJS front-end application — A sample AngularJS 1.x front-end. It'll work for the application developed in the above getting started guide as well all the above example applications. See the Getting Started Guide on how to use it.
  7. Spring Framework Recipes For Real World Application Development — a live book discussing key real-world topics on developing Spring applications, APIs and microservoces. Includes many Spring Lemon topics. Click here to get it now for FREE!
  8. Using Spring Lemon Effectively
  9. DZone Articles
  10. Video tutorials coming soon:
    1. Spring Framework 5 REST API Development — A Complete Blueprint For Real-World Developers
    2. Spring WebFlux Reactive REST API Development — A Complete Blueprint For Real-World Developers
    3. Microservices Using Spring Cloud — A Rapid Course For Real World Developers
    4. Join here to get notified and avail heavy discounts when the above courses get released

Help and Support

  1. Community help is available at stackoverflow.com, under the spring-lemon tag. Do not miss to tag the questions with spring-lemon!
  2. Submit an issue for any bug or enhancement. Please check first that the issue isn't already reported earlier.
  3. Mentoring, training and professional help is provided by naturalprogrammer.com.

Releases and Breaking Changes

  1. See here.