GoFlux CLI
π The fastest way to build full-stack applications with Go + TypeScript
GoFlux is a CLI and a micro-framework that creates and manages full-stack projects with Go backend and modern TypeScript frontend frameworks.
β¨ Features
- π₯ Zero Config: Get started with one command
- π― Type Safe: End-to-end type safety from Go β TypeScript
- β‘ Fast Development: Hot reload for both backend and frontend
- π¨ Modern Frontend: Choose from TanStack Router, Next.js, or Vite+React
- π¦ Single Binary: No runtime dependencies in production
- π οΈ CLI Managed: Everything managed by the flux CLI with optional micro-framework
π Quick Start
Installation
Option 1: One-line Install Script (Recommended)
macOS/Linux:
curl -fsSL https://raw.githubusercontent.com/barisgit/goflux/main/scripts/install.sh | bash
Windows (PowerShell):
iwr -useb https://raw.githubusercontent.com/barisgit/goflux/main/scripts/install.ps1 | iex
Option 2: Package Managers
Homebrew (macOS/Linux):
brew install barisgit/goflux/goflux
Chocolatey (Windows):
choco install goflux
Scoop (Windows):
scoop bucket add goflux https://github.com/barisgit/scoop-goflux
scoop install goflux
Option 3: Go Install
go install github.com/barisgit/goflux@latest
Option 4: Docker
docker run --rm -v $(pwd):/workspace barisgit/goflux:latest new my-app
Option 5: Manual Download
Download the latest binary from GitHub Releases
Create a New Project
# Create new full-stack project
flux new my-app
# Navigate to project
cd my-app
# Start development servers
flux dev
That's it! Your app is running at:
Note: The proxy is used to serve the frontend and backend in the same way they will be served in production. In development, a node process is used to server the frontend, while in production, the frontend is served by the backend.
ποΈ Project Structure
my-app/
βββ flux.yaml # Project configuration
βββ go.mod # Go dependencies
βββ cmd/
β βββ server/ # Go backend server
βββ internal/
β βββ api/ # API routes
β βββ types/ # Go types
βββ frontend/ # React/TypeScript frontend
βββ src/
β βββ types/ # Generated TypeScript types
β βββ lib/ # API client
βββ package.json
ποΈ Configuration (flux.yaml)
name: my-app
frontend:
framework: tanstack-router
install_cmd: pnpm create @tanstack/router@latest frontend --typescript
dev_cmd: cd frontend && pnpm dev
build_cmd: cd frontend && pnpm build
types_dir: src/types
lib_dir: src/lib
backend:
port: "3001"
development:
type_gen_cmd: go run cmd/generate-types/main.go
π Available Commands
flux new <project-name> # Create new project
flux dev # Start development servers
flux --help # Show all commands
π¨ Frontend Options
TanStack Router (Recommended)
- File-based routing
- Type-safe navigation
- Best performance
Next.js
- App router
- Built-in optimizations
- Large ecosystem
...and more.
The CLI will provide list of all available frontend options.
π οΈ How It Works
- Project Creation:
flux new creates a complete project structure
- Auto Setup:
flux dev automatically installs dependencies on first run
- Development: Manages both Go and frontend servers with one command
- Type Generation: Automatically generates TypeScript types from Go structs
π― Why GoFlux?
| Traditional Stack |
GoFlux |
| Multiple CLIs |
Single CLI |
| Complex setup |
One command |
| Runtime deps |
Zero deps |
| ~50MB memory |
~7MB memory |
| Multiple configs |
One config file |
π€ Contributing
This is the GoFlux CLI repository. The CLI creates and manages GoFlux projects but is completely separate from them.
π License
MIT License