Custom Front-End GUI in React

Hello, I just joined the group and I think I am asking this at the appropriate location.

I would like to know if it is possible to use Trytond (the backend server) with a custom front-end in something like react. This front end would be very simple and built from scratch (not using SAO at all).
There was a question of a similar note here but the user seems to already know how to connect to the server.

What I need to know is where can I find the API that tryntond uses to communicate to the front end and use my custom front end to talk to those points. I am hoping that the backend and frontend are independent of each other so that I can just swap mine with the included one.
I have no experience with front end but I have a working understanding of APIs in servers.

Where do I start with something like this?

Thanks for taking the time to read my question.

The server supports two equivalent protocols JSON-RPC and XML-RPC. The methods are constructed like (model|wizard|report).<__name__>.<method> but they must be defined in the __rpc__ attribute of the class. It will great if someone wrote the missing parts of the documentation.
Otherwise you can create your own API using user application.

1 Like

Thank you. In this case, the class where the rpc attribute is defined corresponds to the class for each module? I am sorry if this sounds dumb. I am barely just started looking at the documentation.

Yes it is the classes that are registered in the Pool.

Hello andresberejnoi,
with the help of the forum I was able to create a web interface (which I use only for certain features). I developed the solution with the Laravel framework that uses the php language.
I used a script passed to me from @albert which I then modified and adapted to the specifics of my project.

Refer to this link:

1 Like

Thanks a lot. I will take a look and see if I can adapt it to my use case.

I am still figuring out the routes. Just to check that I am on the right path, I will mention what I am doing. My thinking is that I start the server trytond with a configuration file. Then I just should be able to send requests to that server running in localhost:8000 or 0.0.0.0:8000, right?
I will be testing with Postman to send some. Do you know if there are any more in-depth examples of the user application? It seems like something that I could potentially use because the syntax looks similar to flask, which is familiar.

Thanks for your time

Yes.

chronos is using it.
But you can also start without the @user_application, in this case the route is available to any one without any authentication.

Another example traky is using it.

2 Likes

Hello ced,
So where should I create the user application file in the project, and how should I link it to tryton project.

You do not create a user application in Tryton project. It is a side project.

You define routes with the user_application decorator.

1 Like