Please , in every languages there are a tons of libraries dealing with these stuffs, Starter projects with these functionalities ...
At this point you are supposed to be working on the core