is it possble to create a kotlin project where i can write server-side code as well as client-side code (kotlinJs) and use a kind of shared library for both? i already created a tomcat server running with kotlin, and created a kotlinJs client modul and can run this project without problems, but i have the problem that i can not reuse the dto objects for both and have to copy the dto class for the server and for the client, what is not a elegant solution and creates duplicate code.
what i need, is to be able to send a ajax request to the server, which creates a dto, transforms it to json and sends it back to the client. in the client i want to tansform this json back to the same dto (and not a copied one). as mentioned, this works perfectly with the copied dto class, but should work with only cone class definition.
is this possible with kotlin and intelliJ?
and if yes, how can i do it?