Skip to content

API communication

David Lazarescu edited this page Jun 25, 2025 · 5 revisions

Next, let's take a quick look at how Librum talks to it's back-end!

What is Librum's backend API?

Librum itself is divided into client-side and server-side. The client-side application deals with the presentation of data to its users, whereas the server-side application manages the storage of data, which includes authentication, storing books, you get it...

How and where does the API communication take place?

In Librum, all the API communication happens in the Infrastructure layer (Librum's layers). There is no other place where HTTP communication with any other service takes place.
Usually, API requests, such as creating a book, are initiated from the Application layer, which uses a Gateway (Adapters layer) to map the given data to the correct type. Librum's backend API mostly demands DTOs (Data transfer objects), which are simple C++ structs with no logic, which just hold data. The Gateway then passes this DTO to the corresponding function of an Infrastructure-layer class, which makes the actual call to the database.

The client-side and server-side application talk exclusively via JSON messages, which are then parsed and used correspondingly.


➑️ Next: πŸ“š The Library System

Clone this wiki locally