created final code to store data

created new main.js file to validate and store data to local storage