Closed joncodo closed 1 year ago
I guess my main intention here is to redesign the interface of how users interact with Frigg. Imagine where the code requires and instructions are like this:
NPM install -G frigg create-frigg-app
create-frigg-app my app
echo Welcome to frigg!
Do you want to create a front end for this application? (Y/N)
From the list below, tell us which integrations you want to install (Note, you can add more anytime with `create-frigg-app generate integration Salesforce`)
echo We will now prompt your browser to log you into all the things you need and set up your config for you :)
npm start
Now the new user simply calls in their existing code:
frigg.salesforce.proxy(method, body, headers)
This will take more time to build but will get adopted much easier :)
@joncodo I put together a diagram once to highlight this difference of "with Frigg, without Frigg"
After reading your thoughts/points, I have three immediate thoughts:
For point #3 above, some patterns that we have scattered around different repos (that need to be given some love in the form of further massaging/abstraction):
There's much more that we'd add to the mix, but I think the last comment I would say is: Anyone is welcome to use any of these packages as they'd like. In the proxy case you're expanding on here, I would instead suggest that the developer grabs the API module, figures out on their own where to store api credentials, and then uses the Manager and API module to handle the requests in whatever they're doing for their compute. That said, there's no reason that they/we couldn't make a proxy layer microservice out of a Frigg application; that would be a valid use, once we've added more tooling around logging and handling etc.; It just seems to me that it would be underutilizing all that Frigg has to offer (once we've done the work to make the abstractions and functionality available to pull in).
Ok. That all sounds good to me. I can think of two take aways to be discussed.
@seanspeaks please validate these comments for the docs and modify to be more accurate 😄
please approve - :) I think every api module should include the proxy method by default in the case where we do not have all of an API mapped over with helper methods.
Totally- though currently, that's achievable via access to the internal methods, which should inherit auth method/headers by default (api._get('url', optionsObject)
, ditto _post
, _put
, _delete
, _patch
)
I will write new tickets for use cases and we can refine that and put it in the docs. I think it is important to know who this is for and why you want to use it and why you don't want to use it.
Yup agreed
Excellent work flow. I think this is a great new docs section!
Overview
From what I understand so far, the point of frig is to handle all of the requests sent to an API on the users behalf. This could include authenticating to the service, performing request to get data and refreshing authentication.
what we currently have
Right now it seems that we manage authentication and refreshing of authentication. But then if you look deeper many of these integrations are handling data from the API and processing that data in some way. This springs the companies business logic into the backend of create frigg app.
what I assume customers will do with a new frigg app
My guess is that you already have a software product where all of your back and logic is stored. In order to add logic into our application that stands alongside your application, you would end up adding logic in both places. This is probably not what people are going to do. My guess is that they will want all of their business logic in the classes that are already supporting their application.
treating frigg as a proxy
If we limit the responsibilities of frig to only handle authentication and request processing and authentication refreshing, then our job becomes a lot easier.
Possible Sample code
In this case, we don't need code like this
I just want to open the discussion here to start with the end user in mind in terms of how they will consume Frigg. Right now, it is too complex. We need to make the simple tasks much easier in my humble opinion