Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use a separate REST backend project and a javascript heavy frontend?

I'm a bit new to this. I want to develop a web application and my question is should I build a seperate REST backend using the play framework and a frontend that calls the backend trough AJAX.

Or maybe I should build a REST application that serves the frontend views when asked for HTML but when asked for the JSON type serves the JSON data (if an auth token is present).

I'm wondering what the best practices are ?

EDIT:

The reason I want a REST backend is to support possible future standalone mobile apps and maybe even third-party apps.

like image 899
Jim Avatar asked Dec 15 '25 16:12

Jim


1 Answers

No best answer here, it really depends on your project. Play allows you to do both anyway.

Cases where you'd better go with plain HTML:

  • If you have to support IE 6/7(/8)
  • If your content needs to be found in search engines
  • If you are very content oriented (texts, images)
  • If you want your users to load the page fast

Cases where it's better to choose "one page app":

  • A lot of user interactions, keeping a state
  • Collaborative and realtime
  • Non hierachical navigation (graphs)
  • A lot of data-visulisations
like image 63
Maxime Dantec Avatar answered Dec 18 '25 12:12

Maxime Dantec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!