refactor and add password protection

organise js and css files
add password protection mechanism