Ember + PHP with JSON API

This a post describing how to integrate PHP with Ember via JSON API

I have a limit for number of links in post. I’ll add them as separate comments. Sorry.

There are a few projects that make PHP and Ember integration relatively easy.

  • JSON API PHP This is a framework agnostic package that implements JSON API specification version v1.0
  • For practical usage Limoncello Collins and Limoncello Shot could be used as quick start server apps (Laravel and Lumen based)
  • Limoncello Ember works with those JSON API server apps.

The server and client support

  • CRUD operations for a few sample data models and Users.
  • Cross-origin requests (CORS) to API server.
  • Server login (Basic Auth) and API authentication (JWT Bearer).

I would like to especially thank Christopher @lindyhopchris for his invaluable help and advice.

The cornerstone that makes it all possible is JSON API PHP implementation which was the most difficult part. If you like the project I would appreciate if you star it on github. Thank you for your support.

3 Likes

I hope to play with this soon. I did take a look at the source, I’m a bit unfamiliar with Laravel and Lumen, but things seemed easy enough to follow.

One thing I did notice though correct me if I’m wrong, but the passwords are being stored as plain text? If so that would be a nice improvement area for the example. Very cool projects though, so thank you.

@robbiespeed The passwords are hashed and salted on server side and client access the server with JWT. In order to get JWT the client sends login and password via Basic Authentication which are not protected. There are 2 points for real life usage

  • Basic Authentication must be protected with SSL
  • Basic Authentication can be replaced with other scheme (btw more than one auth scheme can be used in 1 app)