An example rails app featuring a REST API including authentication and authorization with device