This is a starter template for a fullstack web application using Go and React with TypeScript. The frontend is built with Vite, a modern build tool that is much faster than Create React App.
The backend is built with Go, a statically typed language that is great for building APIs.
Click on "Use this template" button on the top right of the project.
- ποΈ Go backend without any web framework (just the standard library, but you can add one if you want).
- βοΈ React frontend with TypeScript and Vite (API calls are proxied to the Go backend).
- β‘οΈ Hot module reloading for both the frontend and backend.
- π¦ Package and release binaries for multiple operating systems (MacOS, Windows and Linux).
- π³ Dockerfile for building and running the application in a container with multi-platform support (linux/amd64, linux/arm64)
- π π½ TailwindCSS for Styling.
- π TanStack Router for Routing.
- ππ½ββοΈ PNPM as package manager for the frontend application.
- βοΈ Makefile for common tasks.
Click on the "Use this template" button from the options to create a new repository using this template. This will create a new repository with the same structure as this repository.
Few things to keep in mind before you start:
- Change the module name in
go.modto your module name. - Replace all the instances of
go-react-typescript-templatewith your application name (including the Dockerfile file). - Install PNPM globally by running
npm install -g pnpmand then runpnpm installto install the dependencies in thewebdirectory. - Install air by running
go install github.com/air-verse/air@latestto install the hot reload tool for the backend. - Create a new GitHub Discussion named "Release" to allow the GitHub Actions workflow to create discussions for each release. If you want to opt-out of this feature, you can remove the
discussion_category_namein the .goreleaser.yml file.
The project leverages make for common tasks. Here are some of the common tasks:
make dev- Start the development server for both the frontend and backend.make build- Build the frontend and backend.make test- Run tests for the backend.
Read more about the available tasks in the Makefile.
You can deploy the application using Docker. You can build the Docker image by running make docker-build and then run the image using docker run -p 8080:8080 go-react-typescript-template.
The template also comes with a GitHub Actions workflow that builds and releases the binaries for Linux, macOS, and Windows. The binaries are attached to the release and can be downloaded from there.
To initiate a new release, create a new tag (in v*.*.* format) and push it to the repository. The GitHub Actions workflow will automatically build and release the binaries and attach them to the release as well as create a new docker image and push it to the GitHub Container Registry.
If you found the project helpful, consider giving it a star βοΈ. If you would like to support the project in other ways, you can buy me a coffee or sponsor me on GitHub.
If you encounter any problems feel free to open an issue. If you feel the project is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull requests are also welcome.
Akash Rajpurohit π» π€ π π π¬ π¦ |
