I spent a lot of time recently getting a Phoenix/Elm app to the point where there are type guarantees at every boundary between the frontend and backend. The outcome has been incredibly satisfying and helpful. I talk here about how I did it and the process of working it out.
https://www.neurodynamic.online/writing/frontend-to-backend-type-safety