Skip to content

AkashRajpurohit/go-react-typescript-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

45 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’ͺ Go + React

Starter template for a fullstack web application using Go and React with TypeScript.

Go Report Card Visitors count All Contributors

Bug report Β· Feature request


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.

πŸ§‘β€πŸ’» How to use it

image

Click on "Use this template" button on the top right of the project.

✨ Features

  • πŸ—οΈ 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.

πŸƒπŸ½β€β™‚οΈ Getting started

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.mod to your module name.
  • Replace all the instances of go-react-typescript-template with your application name (including the Dockerfile file).
  • Install PNPM globally by running npm install -g pnpm and then run pnpm install to install the dependencies in the web directory.
  • Install air by running go install github.com/air-verse/air@latest to 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_name in the .goreleaser.yml file.

πŸ‘¨β€πŸ’» Development

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.

🚒 Deployment

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.

πŸ™πŸ» Support

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.

πŸ› Bugs or Requests

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.

πŸ«±πŸ»β€πŸ«²πŸΌ Contributors

Akash Rajpurohit
Akash Rajpurohit

πŸ’» πŸ€” πŸ‘€ πŸ“– πŸ’¬ πŸ“¦

πŸ‘€ Who am I?

Website Badge Linkedin Badge Twitter Badge Mastodon Follow

About

πŸ“¦ Starter template for a fullstack web application using Go and React with TypeScript.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •