goflux

command module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 4 Imported by: 0

README ΒΆ

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

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

  1. Project Creation: flux new creates a complete project structure
  2. Auto Setup: flux dev automatically installs dependencies on first run
  3. Development: Manages both Go and frontend servers with one command
  4. 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

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal
dev
pkg
dev

Jump to

Keyboard shortcuts

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