Go & ViteJS Boilerplate
This will repo is a template for a larger application based on ideas from https://slides.com/aziis98/go-and-vite-js, this uses the following technologies
The frontend is made using ViteJS and for now is just a SPA that uses https://github.com/preactjs/preact-router (I have a working prototype of a multi-page version with full integration between the dev-client and the server but its still a bit rough)
The backend is made using Go and https://github.com/gofiber/fiber. Fiber is very similar to ExpressJS and uses the fasthttp Go stack that should be a bit better that the Go default HTTP library.
The following command will start the backend (by default on
:4000) and the ViteJS development server (by default on
$ go run -v ./cmd/develop
$ npm run build
$ go run -v ./cmd/server
# or just run...
As sad before, polish the ViteJS plugin for the dev-server for server side rendering.
Define routes once in Go by just referencing files from
frontend/pagesfolder (internally this works by serving a special route in the backend while developing that lists all routes to mount for the ViteJS server)
Remove Preact by-default
Add SQLite by default and more boilerplate for the DB
Go now supports embedded files in the binary so this could actually be shipped to a single binary with all frontend assets bundled in