Can I install an external application from github running on discourse

No, customization in Discourse is a little more restricted than that to keep everything working. Also, Discourse already comes with built-in view counters on topics.

Check out Customization > Theme for an idea of what you can create with the powerful theme customization system.