Try understanding WebRTC first. (Not the coding part of it, just the architecture)
It would be of great help in understanding livekit Docs. Then dive into any of the sample projects and understand the code.
Then try to reference it to make yours.
(PS: I did it and seems like it worked for me. Even I was a bit overwhelmed by WebRTC's architecture but eventually it clicks.)
Also, for the server part, If you're using livekit cloud, you can generate the token directly from the livekit cloud GUI and there will be no need for a server👍