This project is a prototype of a Kotlin multiple page application that shares code between server and client for rendering and state.
The project uses Kotlinx.html for partial rendering on both client and server sides. Both sides use the code from a common module. On the server side, this code is integrated into the whole page rendering. On the client, this code generates a new DOM subtree to replace a portion of the page, depending on user interaction.
The application uses Kotlinx.serialization to share state between server and client. The page includes a JSON variable that represents the server state of the user's ToDos. The client-side deserializes it during page loading to build its state.
The project includes a Kotlin redux implementation with:
- a generic store/action mechanism,
- partial state subscribe/listening,
- middleware.
An API middleware implements client-server communication.
The implementation simulates server error during removing of todo (one time in two).
From the root directory, just launch:
./gradlew run
You can switch to axios branch to see the differences in term of code and distribution.