What are the call flows between traccar BE and FE?

Thomas Mami4 years ago

Hi All,

I want to know what are the communication flows between Backend and FrontEnd?
Because I need to segregate such flows in order to connect traccar BE to my old GPS Front End design.
So far I know that the BE insert Devices location information into the Database, and in the other way the GPS commands from the FE to the devices.
Is there any specific or detailed document related to this call flows. At this time, I am only interfested on the Devices communications flows from and to BE to FE.
At later stage will complete my question if needed with: WEB USER Management, Device Groups Managment and Geofence configuration. (but not needed at this stage I might adapt my own FE to fetch such data or configure my FE accordingly.

Thanks for your support.
Thomas

Tony Shelver4 years ago

Probably read the docs before asking questions, especially the API docs

jaimzj4 years ago
Thomas Mami4 years ago

Thanks Tony and Jaimzy, I will read these documents you are right.
The idea is that I already have a good Front End design but the DataBase structure is different from TRACCAR.
my idea was to work with traccar or the BE, and just develop the last link between TRACCAR BE to My FE Database for (location and commands data).

Or redevelop all the FE from scratch using the Traccar API, for this I do not have any framework to use so it can ease my work, if you can advise any I will be mor ethan happy to use it.

Thanks

Cheers

Tony Shelver4 years ago

I stand open to be corrected, but the Traccar web client is scheduled to be rewritten as and when the developers can find the time. Or you can jump in and help. There is a project set up on Github for that, but movement is very slow.

We are going a slightly different route. We have an existing tracking system that we want to replace with something more flexible, so have spent time getting the data from there into our own DB.
At the moment we have a complete Telegram interface built on that DB to pull statuses, reports, get notifications and more. We have a specific customer base that we cater to.
The next step is to add Traccar as a data source to that DB, to extend the number and type of devices we can target.

You could use the API to load your own DB, or else directly call the DB from the front end.
One issue for us is that Traccar is developed so that the recommended way of accessing the data is via the API and not the DB directly (caching issues).

We use Postgraphile (GraphQL service on top of Postgres) for web access, and direct DB access for our Telegram interface.

So slightly different to the way you do things.

Thomas Mami4 years ago

Hi Tony, I think your idea is better to use traccar as data source, since I already have the web interface (FE) and my gps tracking its own DB SCHEMA built on MySQL.

The question is how I can adapt the data from traccar to my current GPS DB. Do I need plugin? Or where in the code to cater these insertion to my target DB SCHEMA?

Cheers

Tony Shelver4 years ago

To interface to our old tracking system, I wrote an interface using a series of Python modules. This interface calls directly to the old Oracle database and loads to our custom DB (which is implemented in Postgresql) via database functions which do much of the heavy lifting as our DB design is very different to Traccar and the existing Oracle DB.
We looked at other solutions such as RabbitMQ for a queue-based system, but the direct Python route seems to be simpler, and has fewer moving parts. It is also very fast, loading millions of records in less than an hour even using very basic hardware.

For Traccar, we substitute direct DB access with calls to the API, as recommended by the Traccar team and others here. Note this is still in testing as our Traccar usage is currently restricted to a few vertical markets.