13
Introduction to Srb4j Kent Chen , 14/July/2016

Introduction to Srb4j

Embed Size (px)

Citation preview

Page 1: Introduction to Srb4j

Introduction to Srb4jKent Chen , 14/July/2016

Page 2: Introduction to Srb4j

Contents• What is it ?• Features• Technologies• Links

Page 3: Introduction to Srb4j

What is it ?• Srb4j = Simple RESTFul Backend for Java

• Code generation with Maven archetype• Your own maven artifact Id• Your own package name

• Batteries include. • Authentication• Persistence• More…

Page 4: Introduction to Srb4j

Features• Proven data structure for RESTFul API• Registration + login • Social account login • Password resetting + random code login• API document • Back office web portal

Page 5: Introduction to Srb4j

Feature – API Data Structure• “Response” structure for RESTFul API• Limited usage of Http Status Codes • Error code• Error description for User• Error description facilitating developer’s troubleshooting• Data

Page 6: Introduction to Srb4j

Features - Authentication• Registration/login - OAuth2 password flow • Access token• Refresh token

• Social account login• Google• Facebook• Allow for new social site• Support Html , Mobile and Desktop clients at the same time

• Password reset

• Random code login

Page 7: Introduction to Srb4j

Swagger Integration• API document generated as a Servlet• Example: https://srb4jdemo.chenjianjx.com/fo-rest-doc

• Client stub generation

Page 8: Introduction to Srb4j

Back Office Web Portal• Login/Logout

• Enforce code structure for back office

• Example: https://srb4jdemo.chenjianjx.com/bo/portal

Page 9: Introduction to Srb4j

Technologies• Popular J2EE Stack• JAX-RS • Spring • MyBatis • MySQL

• AOP: Bean Validation, user input trimming, timestamp update• Modularized structure design• Application Layer User Oriented• Biz Layer = Neutral Services• Maven artifact as component• Ready for distribution (Microservice)• Be Pragmatic: Not too many components

Page 10: Introduction to Srb4j

Webapp

Front-End Web Service Client Back-Office User’s Browser

Web Layer

Front-End Web Services Back-Office Controllers

Biz Layer

Application Layer

Front-End Managers Back-Office Managers

Neutral Services

Internet

Page 11: Introduction to Srb4j

Maven Components

Page 12: Introduction to Srb4j

Try it now !• Quick Start• https://github.com/chenjianjx/srb4j#quick-start-for-backend-developers

• Demos• A sample backend: https://srb4jdemo.chenjianjx.com/• Demo Html SPA Client: http://srb4jclient.chenjianjx.com:8000/• Demo Android Client: https://github.com/chenjianjx/Srb4jAndroidClient• Demo Desktop Client: https://github.com/chenjianjx/srb4j-desktop-

client

• Documents• All-in-one document: https://github.com/chenjianjx/srb4j• Philosophy of Srb4j’s modularization:

http://www.chenjianjx.com/myblog/entry/layering-in-java-webapps-final

Page 13: Introduction to Srb4j

The End