What backend for simple CRUD?

A little context - I’ve had an idea for an app so I’m teaching myself.

I’m expecting my backend is (at least for the time being) only going to be a pretty simple REST API, just some simple CRUD.

Following some advice, I’m now pretty familiar with php and MySQL. Following a string of problems getting laravel set up, I’m now thinking of just going with a Node backend. No experience of Rails, so its either php or js.

Can anyone recommend a good framework? Ideally I’d rather use MySQL. I’ll worry about any performance issues once I’ve got some sort of prototype up together. Or if anyone’s keen on php/laravel feel free to point out some if there are any real advantages! Thanks

The dirt-easiest way to get started with your background is probably Slim PHP. Follow the sample code snippets in the tutorial, use your routes to CRUD the data you want, wrap responses with json_encode and call it a day. If you’ve got some more patience and willingness to learn something new, I would check out Express. Almost identical syntax to Slim, but it’s more scalable and gets a lot more attention from developers right now. That said, I’ve done it with PHP, it works fine, it’s relatively fast to build and simple to maintain for smaller apps, and it’s really easy to get your head around.

I would note that if you’re using Ember Data, it’s generally expecting things the opposite of how you would structure them in an RDBMS (ie, wants references to children returned with the parent, not the other way around). This means your query logic can get a little more involved than “SELECT * FROM Student,” and it’s often useful to wrap that stuff around a prepared statement. Maybe Laravel provides a good ORM for this- I can’t say. When you’re troubleshooting, just keep checking against the JSON examples on the Ember site and you’ll get there quickly enough.

Only PHP? If you have some time I suggest you to take a look to pyhon. It has a low learning curve and it’s a general purpose language. If you decide to learn python you could use Django/DRF that is like Rails for python.

Yeah I’d definitely like to take some time for Python in the future, but for the moment I’m keen to get some sort of prototype up together asap. Thanks.

Thanks Kyle. Yeah Slim looks like its getting a little old now. Express looks like the way forward. So my first question was straight Express or Sails?

But now I’ve thought if I’m using JS SPA front and Node JS back, why not just use meteor? The integrated front/back does seem a very sensible idea! I guess I’ll learn a little more about no-sql and mongo specifically first and see how I feel.

I’ve also started a separate SO question about advantages of having the separate front and back. Won’t let me paste a link here as I’m a new user, but the title is “Advantages of a separate REST backend API”

I am a big SailsJS fan, since it still is pretty simple and lightweight but comes with a more similar mindset to emberjs. I really like this structured, do only the work you really need to do approach, but I also really like how easy meteor makes the frontend/backend integration.

Because of that I have written http://sanestack.com/ - which is a JS Fullstack using Sails and Ember. There are still things to be improved, but check it out. Using GitHub - DockYard/ember-admin: Admin backend for ember-cli projects (the master branch version) you should be able to get the most simple fullstack crud ui setup in just a few minutes.

Having said all that, Meteor certainly is a possibility as well and do evaluate the solutions yourself.

2 Likes

Try having a look at Sinatra. Sure it’s in Ruby, but it’s very straightforward and quite powerful that you might still want to reconsider it (and discover more about the wonderful world of Ruby).

After spending a little while looking a Meteor, I’ve decided I am probably more comfortable with MySQL than Mongo, and that I’d rather have an independent front-end. Sane looks like a good idea. Not sure how to private message on here, but I’m getting some syntax errors from Sane-CLI…

You should have a private message :wink:

Hi,

As another self-taught dev, I chased a lot of frameworks in testing my app idea. I “framework hopped” to solutions like Rails then iOS and Cocoa, then Cappuccino then backbone… It was a great learning experience ( especially learning a language like [objective-c] ).

Here is the stack I have been using and have finally have some traction with:

  1. Ember with Ember-Cli. Just amazing.
  2. Parse.com as a Back End as Service. You can learn how to manage a db and write a lot of server side code, but I liked abstracting it with Parse’s JS SDK. They also have Cloud Code, which runs on node. You can write server side hooks or run an express server. The documentation is very good.

I really miss using a traditional relational database, but using the Parse SDK has me focused on my app development.

Just my 2 cents.

Strongloop Loopback is a fast way to setup a REST API. Although its nodejs…

I developed EveryREST for myself to experiment with Ember Data.

It is written in Go, for Google App Engine. While it doesn’t have anywhere near the functionality of a proper framework it should be very easy to set up, and deploy online.

The server is designed to work with the Rest Adapter out the box.

Take a look a FortuneJS. It’s really simple prototyping framework for APIs.

http://sanestack.com makes it by far the easiest and best I think.

Thanks all for some great suggestions. I’m using Sanestack, so far so good, and a great team behind it!