Skip to content

Instantly share code, notes, and snippets.



Last active Aug 21, 2019
What would you like to do?
Vecty/GopherJS Web App Framework

Web App Framework with Vecty & GopherJS

This document describes a web app framework targeted for Vecty & GopherJS.


  • Go is the primary language for all frontend and backend tasks. An app developer should be able to write full-feaured web applications using only Go and without any HTML/Javascript/CSS knowledge or expertise
  • The framework handles and compiles Go code targeting the frontend and backend
    • Framework can build frontend code into HTMl/JS/CSS or Web Assembly (WASM). In both cases, the resulting app is a SPA
    • Framework design might enable classic web apps with multiple routes, but that's not a design goal
    • Framework provides development-time tooling like:
      • Development server that live-reloads and recompiles code
      • Generating code for common tasks

Frontend Tooling

Frontend web developers generally have to master 3 technologies to write modern web applications:

  • HTML: declarative language for structuring a web page
  • CSS: Declarative language for applying styles to a static page
  • Javascript: imperative language for initializing and reacting to page events and defining behavior in response to those events

There is a huge ecosystem of technologies and tooling that developers have to choose from to accomplish their goals. They generally fall into one of a few categories:

  • Development and build tooling like WebPack and Rollup.js
  • CSS superset languages/compilers like SCSS
  • Javascript superset languages like Typescript and Clojurescript
  • Javascript Frameworks like React and Vue.js

The Framework aims to replace all these technologies with Go:

  • Development and build tooling: framework itself provides a development server and build tool, all based on the standard Go toolchain
  • CSS superset languages/compilers: CSS is written in Go
  • Javascript superset languages: If the framework is outputting a standard web app, Javascript is generated by the framework using GopherJS & Vecty. If it is outputting WASM, behavior is built int
  • Javascript frameworks: the framework itself is based on Vecty and GopherJS and incorporates common features like a router and a state management system like Redux

Backend Tooling

Framework assumes that Buffalo is used for server routing, and it's used in API-only mode. None of the buffalo frontend pipeline features are used, since the framework handles all of the frontend build & development tasks.

Framework also has helpers to make RPC from frontend to backend easier. For example, it can generate code on the frontend and backend to add a new RPC method.

Framework can do server side rendering if the developer opts in to letting framework handle RPC and routing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment