Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appropriate back-end for a single-page web application?

Historically I've mainly written web apps in Django, but now I'm increasingly finding that I want to write single-page web apps using Backbone.js or a similar JavaScript framework, with a back-end that solely consists of a database and an API.

My questions is this. If my application structure looks like this:

 1. Database
 |
 v
 2. API methods
 |
 v
 3. Single-page front-end written with Backbone

and I'm most comfortable in Django - but also keen to learn new things too, such as NoSQL and Node, if they are appropriate - what would people recommend I use for (2)?

Typically I would use Django with Piston as the API app, but it seems rather heavyweight to have all of Django and only use it as an API provider. Perhaps I shouldn't be worrying, though.

like image 882
flossfan Avatar asked Jun 20 '12 13:06

flossfan


People also ask

Which of the following is the framework for single page applications?

AngularJS Developed by Google, AngularJS is one of the open-source, front-end, JavaScript-based frameworks widely used in creating single-page applications on the client-side.

What makes a single-page application?

An SPA (Single-page application) is a web app implementation that loads only a single web document, and then updates the body content of that single document via JavaScript APIs such as XMLHttpRequest and Fetch when different content is to be shown.

What are some examples of single page applications?

You'll easily recognize some popular examples of single page applications like Gmail, Google Maps, Airbnb, Netflix, Pinterest, Paypal, and many more. Companies all over the internet are using SPAs to build a fluid, scalable experience.


1 Answers

If you use Django, which is an MVC framework, and use Backbone, you might be comfortable setting up your app in pure Node.js or Express.js, with additional modules for connecting to your choice of database.

With Express, if you plan to serve only JSON via RESTful interface, you don't even need to use Views, which is handy. You would only need to set up models and routes (that also serve as controllers).

like image 105
mvbl fst Avatar answered Oct 18 '22 20:10

mvbl fst