mardi 26 mars 2019

Standard way to write interactive website with Rest calls

I'm planning to do a platform that should be able to be used from a website, or from a mobile app. Moreover, the website should be pretty interactive. So in order to keep the process as "factorized" as possible, I was thinking to write a REST API for the platform, and then just send requests to this REST API from the website or the mobile app.

I would also like to be able to write "concice" client code, that take care as much as possible of doing the calls to the REST API for me, putting it in the right place of the page...

For example, lot's of web pages just display some fields of a given object (say the title and the content of a blog post), so I'd expect to write basically zero javascript code to just display an object. Similarly, it's quite common to have a part of the page that updates when you click on it (like voting for example, or event commenting), or when you scroll (add more objects) or change page, so I would like to express easily this kind of constraint, with, if possible, zero line of javascript.

So to sum up, I'd like on client side:

  • an easy way to query and display the result of REST API calls, even for more complex codes (arrays of objects, vote/comment events, scrolling/page...)

On server side:

  • a way to produce REST outputs
  • that can take care of connection/permissions of users
  • that also take care of the connection to the database for me, with ideally a model representing the data like in django
  • a secure way to handle forms (csrf token automatically added...) and process/save the data

Is there any framework/set of frameworks that could let me do this kind of plateform? If the client/server use different frameworks, is django suitable for the server part, or is there any conventional server that works well for REST apis?

Thanks!




Aucun commentaire:

Enregistrer un commentaire