Rewrite front-end in TypeScript