Hand Drawing Shape OpenCV/Canvas

Hello guys!

I am a student and all the help I can have are really appreciated! <3
My first target is to create a canvas, wherein I can draw shape manually. (Pentagon, hexagon, square, arrow, etc) I don’t want to draw the shape as solid one but I want to do it manually. Easy right? I can just use the canvas with that. But my problem lies here, After or during (I am not sure yet if which is better) drawing, (for example I am going to draw pentagon, ang my drawing is a bit squimsy, or to pointy something like that), I want to make the drawing smooth making it like I’ve drawn a solid shape. (meaning correcting the hand drawn shape/detecting what shape is that and recreating a good shape unlike the squimsy drawing) How can I do that?
What I’ve conclude is this: (but this is after drawing all the shape, but i’m not sure how to detect if the drawing is finished yet)

get the shape (know what kind of shape is that, i know OpenCV can do that)
get the height/radius/width (all requirements to be considered in the shape)
then redraw the shape (getting the max height as the basis of the size if the shape)

Is this good? But I am not sure on how to use OpenCV on web. As well as I want to re-shape the drawing during the drawing. Not after. And when I do this the web needs to be refreshed everytime right?
Do you have any points/idea/suggestion on how could I do this?

Thank you and I hope you could help me with this. Lovelots!