Frontend templating

Lots of edits here.
why do we do `readFileSync` here?