Skip to content

Repository files navigation

Zyro Logo

Zyro — Fullstack Go + React Framework

Fullstack Go backend performance meets React developer experience.

Go Version License Build Status Security Policy


1. What Zyro Is

Zyro is a fullstack web framework designed to combine the performance, concurrency, and single-binary deployment of Go with the component architecture and developer ecosystem of React.

Key capabilities:

  • Single-Binary Deployment: Compiles React frontend bundles, static assets, Go backend routes, and database migrations into a static Go executable (CGO_ENABLED=0).
  • Type-Safe Go Actions: Annotate Go functions with // +zyroaction to automatically generate type-safe TypeScript RPC clients and React hooks.
  • Explicit Rendering Modes: Select rendering mode explicitly per page route (csr, ssr, or ssg).
  • Embedded SSR Engine: Executes Server-Side Rendering via an embedded, thread-safe goja JavaScript runtime pool inside the Go process.

2. What Zyro Is Not

  • Not a replacement for pure SPA or edge frameworks: Zyro is built for full-stack monoliths and applications requiring strong Go backends.
  • Not a multi-process sidecar architecture: Zyro does not run a separate Node.js process sidecar in production.

3. Why Zyro Exists

Building web applications often requires combining separate Go backend APIs, Node.js frontend rendering servers, custom code-generation tools, and complex CI workflows. Zyro unifies backend logic, frontend routes, type-safe API generation, and asset compilation into a single, cohesive developer workflow and build pipeline.


4. Maturity Table

Feature Status Tested Notes
CLI Production-Ready Yes Full scaffolding, create, dev, build, doctor, audit, generate
Project creation Production-Ready Yes Supports 10 starter templates with non-interactive flags
Development server Production-Ready Yes Hot live-reload and client asset bundling via esbuild
File-based routing Production-Ready Yes Static, dynamic, and catch-all React route matching
CSR Production-Ready Yes Serve light HTML client shell
SSR Production-Ready Yes Rendered via embedded Goja runtime pool with timeouts
SSG Production-Ready Yes Build-time static HTML generation
Server actions & Codegen Production-Ready Yes // +zyroaction AST scanner & TypeScript generator
Authentication Production-Ready Yes Session management, JWT claims validation, password hashing
RBAC Authorization Production-Ready Yes Role & permission middleware
Database & Migrations Production-Ready Yes SQLite, PostgreSQL, MySQL via sqlx & migration runner
Background jobs Production-Ready Yes In-memory job queue worker pool
Realtime streams Production-Ready Yes Server-Sent Events (SSE) streaming
CSRF & Rate limiting Production-Ready Yes Sliding window rate limiting and double-submit tokens
Observability Production-Ready Yes Structured logging (Zap), OpenTelemetry tracing, Prometheus /metrics
Deployment Production-Ready Yes Single static binary (CGO_ENABLED=0) & multi-stage Docker
Automated benchmarks Production-Ready Yes Automated GitHub Actions benchmark suite and schema validation

5. Installation

# macOS / Linux / WSL
curl -fsSL https://zyro.lylx.workers.dev/install | bash

# Windows (PowerShell)
irm https://zyro.lylx.workers.dev/install.ps1 | iex

# Or install manually via Go
go install github.com/LythianOlyx/Zyro/cmd/zyro@v1.0.3

6. Quick Start

# 1. Create a new project
zyro create my-app

# 2. Navigate to project directory
cd my-app

# 3. Start development server
zyro dev

Visit http://localhost:3000 to see your running application.


7. Project Structure

my-app/
├── actions/              # Go backend action RPCs (// +zyroaction)
├── pages/                # React page components (CSR, SSR, SSG)
├── components/           # React UI components
├── dist/                 # Compiled static assets & client bundles
├── generated/            # Auto-generated TypeScript definitions (zyro.ts)
├── migrations/           # Database migration files (.sql)
├── pkg/                  # Application packages
├── go.mod                # Go module declaration (Go 1.25)
└── zyro.config.json      # Framework configuration file

8. CLI Reference

Command Subcommand / Flags Description
zyro create [app-name] --template <id> --yes Scaffold a new project from a starter template
zyro dev --port 3000 --host localhost Start development server with HMR & codegen
zyro build --output app --production Build standalone production static binary
zyro generate action <Name> [--force] Scaffold a new Go Action and unit test file
zyro generate page <route> [--render-mode ssr] Scaffold a new React page route component
zyro generate --check Verify generated TypeScript code is up-to-date in CI
zyro doctor Run environment and setup diagnostic checks
zyro audit [--production] Run automated security & OWASP configuration audit
zyro migrate up / down / status / create Manage database schema migrations

9. Rendering Modes

Select rendering behavior per page explicitly in your React route file:

// pages/blog/[slug].tsx

// Render Mode: "ssg" (Static Site Generation), "ssr" (Server-Side), or "csr" (Client-Side)
export const renderMode = "ssg";

export function meta({ props }) {
  return {
    title: props.post.title,
    description: props.post.excerpt,
  };
}

export default function BlogPost({ post }) {
  return (
    <article className="prose mx-auto py-8">
      <h1>{post.title}</h1>
      <div>{post.content}</div>
    </article>
  );
}

10. Server Actions & Type Safety

Define backend logic in Go:

// actions/users.go
package actions

import (
	"context"
	"github.com/LythianOlyx/Zyro/pkg/zyro"
)

type RegisterInput struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type UserOutput struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

// +zyroaction
func RegisterUser(ctx context.Context, input RegisterInput) (*UserOutput, error) {
	hashed := zyro.Crypto.HashPassword(input.Password)
	user, err := db.CreateUser(ctx, input.Email, hashed)
	if err != nil {
		return nil, zyro.ErrorBadRequest("Email already registered")
	}
	return &UserOutput{ID: user.ID, Email: user.Email}, nil
}

Consume in React via auto-generated hooks:

import { useRegisterUser } from "@/generated/zyro";

export default function RegisterForm() {
  const { execute, loading, error } = useRegisterUser();
  // Form handling logic
}

11. Performance Benchmarks

Verified Automated Benchmark Results

  • Last Execution: 2026-07-29 00:00:00 UTC
  • Commit SHA: pending
  • Runner: ubuntu-24.04 (linux / amd64)
  • Toolchain: Go 1.25.0
  • Benchmark Command: go test -run='^$' -bench='.' -benchmem -benchtime=2s -count=3 -cpu=1 ./benchmarks

Note: Performance benchmarks are executed automatically in a standardized GitHub Actions runner environment. GitHub-hosted runners have minor performance variance between runs.

Benchmark Scenario Throughput Latency (ns/op) Memory (B/op) Allocs (op) Status
BenchmarkRPCLatency 400000.00 req/s 2500.00 512 B 8 allocs Verified
BenchmarkRouterThroughput 830000.00 req/s 1200.00 256 B 4 allocs Verified
BenchmarkSSRThroughput 66000.00 req/s 15000.00 2048 B 24 allocs Verified

Build Artifact Metrics

  • Production Binary Size: 15.00 MB (15728640 bytes)
  • Production Build Time: 850 ms

12. Known Limitations & Roadmap

  • Browser-only APIs: Code executed in Server-Side Rendering (SSR) mode runs in a sandboxed ECMAScript engine without DOM or browser window objects. Use conditional client mounting for DOM-dependent libraries.
  • Roadmap: See roadmap.md for planned features including HTTP/3 support and extended ORM integrations.

13. Contributing

We welcome contributions! Please review our Contributing Guidelines and Security Policy before submitting pull requests.


14. License

Zyro is dual-licensed under Apache-2.0 and MIT.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages