backend/

directory
v0.0.164 Latest Latest
Warning

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

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

README

PROJECT_NAME

Generated by kool create go-react.

Usage

go run ./

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

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

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

Development

Dev Mode

Dev mode starts Vite automatically for frontend hot-reload and proxies requests through the Go backend:

go run ./ --dev

Dev mode also supports route prefixes:

go run ./ --dev --route-prefix my-app

The Go server starts and proxies to a Vite dev server on a free port, so you get instant hot-reload for React changes.

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';

The demo route at /external shows this pattern: keep @external_src mapped to the local external_src/ directory, then import through the same relative path you would use inside that directory. For example, a checkout at external_src/agent-traces can expose a React component at:

import { AgentTracesPage } from '@external_src/agent-traces/frontend/src/agent-trace/AgentTracesPage';

You can put as many external React source checkouts, packages, or worktrees as you need under external_src/, such as external_src/admin and external_src/agent-traces, then import them with paths like @external_src/admin/frontend/src/... or @external_src/agent-traces/frontend/src/....

Release Mode (Production Build)
  1. Build the frontend:
go run ./script/build-frontend
  1. Run the server (embeds the built frontend):
go run ./
Build Binary
go run ./script/build-frontend && go build -o /tmp/__PROJECT_NAME__ ./

Directories

Path Synopsis
script
build command
usage: go run ./script/build (go build -o bin/__PROJECT_NAME__)
usage: go run ./script/build (go build -o bin/__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 build via go run ./script/build; then go install
usage: go run ./script/install build via go run ./script/build; then go install

Jump to

Keyboard shortcuts

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