associazione-rousseau / camelot-flutter

Cross platform Flutter application to subscribe and vote on Rousseau.
GNU General Public License v3.0
15 stars 11 forks source link

API and data format documentation in application usable format #195

Open fpietrosanti opened 4 years ago

fpietrosanti commented 4 years ago

At OpenRousseau we did an analysis of the current camelot-flutter API as follow: https://github.com/decidiamo/openrousseau-decidim/wiki/API-Documentation

It does seems that something is using web-UI, something wordpress API, something custom graphql API.

As we've undergoing backend re-implementation to interface with camelot-flutter based on decidim, it would be a good way to define API and data format in a way that are backend-neutral, as a way to make it easy to swap the rousseau backend platforms.

emanuelconunaemme commented 4 years ago

Not sure I understand your requests. You are asking us to:

  1. Write a backend proxy as a single endpoint, that takes all the requests from the app and multiplex them to the different services/websites/domains. Those requests would have a consistent format (E.g.: graphql) and would then be translated into the single services API/protocol.
  2. Document those API.

Correct?

fpietrosanti commented 3 years ago

Not sure I understand your requests. You are asking us to:

  1. Write a backend proxy as a single endpoint, that takes all the requests from the app and multiplex them to the different services/websites/domains. Those requests would have a consistent format (E.g.: graphql) and would then be translated into the single services API/protocol.
  2. Document those API.

Correct?

Yes and no, meaning that in order to be able to hook a different backend to camelot-flutter in portable way we could intervene either on the backend (by making a sort of proxy API service frontend), either on the mobile client (by making internal data object well split from the API and having a configurable lower-level API configurable).

For instance, as most of the features of collaboration (not the political candidature related ones) of rousseau are available in Decidim, it would be very nice to be able to have for each data object a configurable API in the mobile client.

For a practical example, let' look at the Events API: https://github.com/decidiamo/openrousseau-decidim/wiki/API-Documentation#events-feed

It's now bound to a Wordpress Json API, but it could be directly hooked to the "decidim-meetings" module and corresponding API, if the uses of this would be made configurable.

This is the plan for the mapping of OpenRousseau backend swapping to camelot-flutter: https://docs.google.com/spreadsheets/d/1JN2B3s2Px_TzfxlyMZfeZhqjGFn72nA6Wcan6BkH26Y/edit#gid=0

As you can see it would be very nice if we could just swap (making it configurable at build-time or run-time for instance) the camelot-flutter backend API, using the Decidim ones, extending directly the Decidim ones on the modules that need it.

What do you think?

fpietrosanti commented 3 years ago

Update: Following great political demand, today the decidim backend development integration has started with dedicated resources, we will see API by API which is the best way to hook camelot-flutter, whether by replicating 1-to-1 the current API used or by making and object-data-mapping with an IFDEF to use another simpler, normalized API. Any feedback in looking forward this direction would be much appreciated.