GithubHelp home page GithubHelp logo

ivan-tamayo / the-spring-rest-stack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshlong-attic/the-spring-rest-stack

0.0 1.0 0.0 2.84 MB

the deck to my talk on building more powerful REST APIs

the-spring-rest-stack's Introduction

The Spring REST Stack

This code accompanies a talk that I deliver on RESTful service development with Spring.

The goals of this project are to demonstrate the development of a simple REST service with Spring. The REST service concerns itself with the domain of a simple CRM: a user manages a customer collection.

Breakdown of the Various Tiers

The Data and Service Tier

The data tier module services uses Spring Data JPA repositories, a standard SQL database, and Spring's standard transaction management infrastructure to build a service. This tier is configured by importing the class com.jl.crm.services.ServiceConfiguration. Currently there are two Spring profiles. One called production, which attempts to the SQL database configured in /code/services/src/main/resources/config.properties, and test, which manages an embedded H2 database which can be accessed at the embedded H2 database console web application with the configuration shown below.

H2 database console

The REST Tier

There are four web-tier modules, rest, hateoas, hateoas-data, and oauth, which demonstrate the evolution of a REST service implemented using Spring MVC to manage users and customers. The initial cut, rest, is fairly RESTful, but not HATEOAS and hypermedia compliant. The next cut, hateoas uses Spring HATEOAS to introduce hypermedia. This improvement, while welcome, is not without an associated cost in code. The next cut, hateoas-data, introduces Spring Data REST which reduces boilerplate code associated with managing data from the REST endpoint to the database. In the final cut, oauth, we introduce Spring Security and Spring Security OAuth to secure the API's from both prying eyes and unauthorized application clients.

The Client Tier

The social module is a Spring Social API binding for the OAuth 2.0-secured CRM REST API. The ClientExample demonstrates how to configure and use the Spring Social binding outside of a web container and demonstrates some of its uses.

The android module is a Spring Android-powered Android client that embeds the social client and uses it to support an Android mobile application.

Notes on Implementation

For a detailed walkthrough of all the code, please check out the tutorial.

the-spring-rest-stack's People

Contributors

joshlong avatar rwinch avatar royclarkson avatar philwebb avatar

Watchers

Ivan TAMAYO 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.