Here is what I intend to build:
There is a service providing data with REST
ful JSON
-only API. The server setup is Python
+ Flask
.
There are several clients making use of this API, like a normal web app, mobile-compatible client and a Facebook App.
Now, my assumptions/decisions:
- I decided on the server providing only data through
JSON
, thus handing over the presentation completely to the client-side. - I desire to make the web app mobile compatible, thus eliminating need of a separate mobile client.
- Also, for Facebook app, I decided to use Facebook Canvas, which would render parts of the normal web app, thus reusing the code. Feel free to correct me if anything is wrong in above assumptions. Though the above is theoretically possible, I would like to know if the practical implementation is feasible or not.
Now, the web app, after having fetched the base page/template from server, will have to handle the rendering dynamically after fetching data through JSON
API. The data is quite simple: multiple-option questions, answering which user receives another question. At the end, user can share the result or invite other users.
With this setup, do I need a framework like angularjs
or jQuery
would suffice?
My main concern here is how do I handle internationalization? I initially intended to user Flask-Babel
to internationalize HTML templates. But having zeroed in on JSON-only API, I don't have a clue as to how/where I handle it now: on client-side or server-side? What are the tools I use for it?
One approach I could think of was to have data in different languages on server itself, and send the JSON response with data in appropriate language, depending on some attribute the client sends in request.
Another approach is to let client do all the translation for a common dataset that server sends. I am not sure of this approach though.