backend/

directory
v0.0.168 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2026 License: MIT, MIT

README

PROJECT_NAME

Generated by kool create go-react.

Usage

go run ./cmd/__PROJECT_NAME__

To mount the app under a sub-route, pass --route-prefix:

go run ./cmd/__PROJECT_NAME__ --route-prefix my-app

Then open http://localhost:<port>/my-app/.

Development

Starts Vite (HMR) and rebuilds the Go API with air on .go changes:

go run ./script/dev

Options:

go run ./script/dev --port 9000
go run ./script/dev --no-air          # single go run, still external Vite
go run ./script/dev --no-open

Plain in-process Vite (no air) is still available:

go run ./cmd/__PROJECT_NAME__ --dev
External React Source

The generated frontend includes an external_src/ directory next to src/. Code in that directory can be imported with the @external_src alias:

import { ExternalDemo } from '@external_src/demo-external/frontend/src/ExternalDemo';
Release Mode (Production Build)
  1. Build the frontend:
go run ./script/build-frontend
  1. Run the server (embeds the built frontend):
go run ./cmd/__PROJECT_NAME__
Build / Install
go run ./script/build-frontend && go run ./script/build
go run ./script/install

Directories

Path Synopsis
script
build command
usage: go run ./script/build (go build -o bin/__PROJECT_NAME__ ./cmd/__PROJECT_NAME__)
usage: go run ./script/build (go build -o bin/__PROJECT_NAME__ ./cmd/__PROJECT_NAME__)
bundle command
Command bundle compiles __PROJECT_NAME__ for the host OS/arch into a single binary.
Command bundle compiles __PROJECT_NAME__ for the host OS/arch into a single binary.
bundle/for-linux command
usage: go run ./script/bundle/for-linux
usage: go run ./script/bundle/for-linux
github/lib
usage: imported by go run ./script/github/release (shared release helpers)
usage: imported by go run ./script/github/release (shared release helpers)
github/release command
usage: go run ./script/github/release [--dry-run]
usage: go run ./script/github/release [--dry-run]
install command
usage: go run ./script/install
usage: go run ./script/install

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL