Overview & Philosophy

Gofs (Go Full Stack) is a lightweight architectural template and CLI for building evergreen web applications. The server is written in Go using only the standard library. Pages are rendered on the server with Go’s html/template. Interactivity is delivered through standards-based Web Components (Custom Elements and Declarative Shadow DOM). Developers can author components using pure native browser APIs or lightweight micro-libraries rooted in web components, without proprietary framework lock-in. Data lives in PostgreSQL and is queried with plain SQL through sqlc.

Gofs is designed around a single guiding premise: minimize runtime dependencies and build on stable, backward-compatible standards. It leverages Go’s backward compatibility promise on the server and the web platform’s permanence in the browser to deliver applications that remain maintainable for the forseeable future without relentless upgrade churn.


The Development of Gofs

The Original Vision: Escaping Heavy JS Frameworks

Gofs originally set out to solve a pervasive problem in modern software engineering: the complexity of heavy single-page application (SPA) JavaScript frameworks (React, Angular, Vue, Next.js). The original stack combined Go, templ, htmx, and Tailwind.

The goal was: run a Go backend, generate HTML via templ, add dynamic behavior using htmx, and style with utility CSS, freeing developers from managing massive client-side state stores, client routers, and heavy npm build pipelines.

Modern web standards

While that initial stack proved that server-driven web apps could replace most SPAs, technology continued to develop around standards and more browser-native capabilities, enabling even leaner, more maintainable architectures. Supply chain attacks caused the tech world to focus on what is run in production and the importance of minimizing runtime dependencies.

  1. sqlc Bundles Zero Runtime Dependencies: Traditional ORMs (and custom struct-based CRUD generators) introduce heavy runtime abstractions, reflection overhead, and proprietary query DSLs that inevitably change over time. sqlc works by compiling raw, standard SQL into type-safe Go code that depends solely on the Go standard library’s database/sql. It is a development tool, not a runtime dependency.

  2. Web Components & Declarative Shadow DOM (DSD): Browser standards evolved significantly. Custom Elements are universally supported in every browser engine without polyfills. Crucially, Declarative Shadow DOM (<template shadowrootmode="open">) is now Baseline Widely Available across all major browsers. DSD allows the Go server to output encapsulated shadow roots directly in server-rendered HTML. Components gain true style and DOM encapsulation with zero client-side JavaScript execution required for initial render and zero layout shift.

  3. Web Standards Over Frameworks: Rather than attempting to force “Go everywhere” or stretching HTML attributes into an ad-hoc client application, modern web standards provide native Custom Elements. Because Custom Elements are a native W3C browser standard, they provide universal interoperability. You are never locked into an ephemeral framework ecosystem. Developers can write pure vanilla custom elements using native browser APIs.

  4. AI has gotten very good at HTML: Golang templates have been around since the first days of Go, over a decade ago. However lack of tooling and cumbersome developer experiences have been a barrier when smooth experiences with JSX were the norm. Today even smaller LLMs can capably write the HTML with near 100% accuracy. As this is largely logic free code, the risk is minimal and it saves a developer a lot of time. HTML is also easier to review than heavy logic code, making it more maintainable in the long run.


Why Managing Dependencies Increases the Maintenance Burden

In modern software engineering, adding a dependency is often treated as “free functionality.” In reality, every external runtime dependency is an ongoing liability.

flowchart TD A["New Dependency Added"] --> B["Transitive Tree Explodes
(Hundreds of Packages)"] B --> C["Continuous Security Advisories & CVEs"] C --> D["Upstream Breaking Changes & Deprecations"] D --> E["Costly Migration & Rewrite Cycles"] E --> F["80% Engineering Time Spent 'Standing Still'"] style A fill:#1e293b,stroke:#3b82f6,stroke-width:2px,color:#f8fafc style B fill:#1e293b,stroke:#eab308,stroke-width:1px,color:#f8fafc style C fill:#1e293b,stroke:#f97316,stroke-width:1px,color:#f8fafc style D fill:#1e293b,stroke:#ef4444,stroke-width:1px,color:#f8fafc style E fill:#1e293b,stroke:#dc2626,stroke-width:2px,color:#f8fafc style F fill:#450a0a,stroke:#ef4444,stroke-width:2px,color:#fca5a5

The cost of constant upgrade cycles

When an application relies on heavy third-party frameworks and deep dependency trees, engineering teams quickly find themselves trapped in a cycle of constant upgrades, that only grows with the number and scale of apps. Minor and major updates regularly introduce breaking changes, deprecate APIs, or shift underlying paradigms (e.g., Python 2 to 3, .NET Framework to Core, AngularJS to Angular 2+, React Class Components to Hooks to Server Components).

Organizations frequently spend 60% to 80% of their engineering capacity simply “standing still” resolving dependency conflicts, patching deprecations, updating bundlers, and fixing broken builds—leaving only a fraction of their budget for delivering actual business value. When budgets tighten and upgrades are deferred, technical debt compounds until systems become unmaintainable legacy anchors.

Breaking Changes & Ecosystem Volatility

Open-source libraries evolve, pivot, or get abandoned. A framework maintainer may redesign their routing system or state model, forcing every downstream project into a painful rewrite. A custom compiler toolchain (such as an external template language) may lag behind new language releases or alter its syntax, blocking compiler upgrades.

By contrast, code written against rock-solid standards does not suffer from ecosystem volatility. A Go standard library HTTP handler or a standard HTML <form> written ten years ago works just as reliably today, without modification.

Supply Chain Attacks

The modern software supply chain has become a primary attack vector. Incidents involving typosquatting, compromised maintainer credentials, malicious post-install scripts, protestware, and dependency confusion exploit ecosystems with deep, uncontrolled dependency graphs.

A typical single-page application using npm frequently pulls in thousands of transitive packages (node_modules) written by thousands of anonymous contributors. Every single package in that chain runs code with full developer or runtime permissions.

Gofs combats this at the architectural root:

  • Avoiding NPM where practical: A gofs project minimises or eliminates third-party modules shipped to production.
  • Zero Runtime Dependencies: The Go backend depends only on Go’s standard library. Even the database layer (sqlc) produces plain database/sql code with minimal or zero third-party runtime dependencies.
  • Vendored, Checksummed Client Assets: Any client-side scripts or web component helpers are vendored as standalone, pinned, and checksummed static files in the project repository and served directly from the embedded Go binary with immutable cache headers—bypassing npm entirely.

Eliminating third-party runtime dependencies shrinks the software attack surface to near zero.


Standards & Backward Compatibility

Go’s Backward Compatibility Promise

Go was engineered from its inception for long-term software engineering at scale. The Go 1 Compatibility Promise guarantees that any program written for Go 1 will compile and run correctly on any future Go 1.x release.

By building the entire server with Go’s standard library (net/http, html/template, database/sql, crypto/rand, embed), a gofs application inherits this guarantee. You can upgrade the Go compiler to capture security fixes, performance enhancements, and platform optimizations without fearing that your application’s routing, templating, or database code will break.

The Web Platform: “Don’t Break the Web”

The browser is the most backward-compatible runtime environment in human history. The fundamental principle of the W3C and WHATWG web standards bodies is “Don’t break the web.” An HTML page or custom script written in 1995 still renders and executes in Chrome, Firefox, Safari, and Edge today.

Gofs grounds its frontend architecture directly in web standards:

  • Custom Elements: The browser’s native component standard. Components are isolated, interoperable, and recognized directly by the DOM.
  • Declarative Shadow DOM (DSD): Native server-side rendering for encapsulated components (<template shadowrootmode="open">), combining server performance with client-side component encapsulation.
  • Native HTML Controls: We reach for <form>, <dialog>, <button>, and semantic HTML before reaching for JavaScript.
  • Modern CSS Baseline: Modern CSS provides nesting, cascade layers, CSS custom properties (variables), and container queries natively. There is no need for CSS preprocessors, PostCSS, or bundler configurations.
  • Baseline Policy: Gofs adheres to the Web Baseline standard. Widely available features are used freely, Newly available features include graceful fallbacks, and Limited availability features require explicit justification.
flowchart TD subgraph STACK["The Gofs Evergreen Architecture"] direction TB S["SERVER
Go Standard Library (Go 1 Compatibility Promise)"] D["DATABASE
sqlc (Plain SQL ➔ database/sql, Zero Runtime)"] T["TEMPLATES & SSR
html/template + Declarative Shadow DOM (DSD)"] F["FRONTEND & INTERACTIVITY
Web Components (W3C Custom Elements, Framework-Agnostic)"] C["STYLING
Modern Baseline CSS (Variables, Nesting, Scoped Styles)"] A["TOOLING & VELOCITY
AI Coding Assistants + Zero Build Step + Zero npm"] end S --> T D --> S T --> F F --> C A -. Accelerates .-> S A -. Accelerates .-> T A -. Accelerates .-> F style STACK fill:#0f172a,stroke:#334155,stroke-width:2px,color:#94a3b8 style S fill:#1e293b,stroke:#0ea5e9,stroke-width:2px,color:#f8fafc style D fill:#1e293b,stroke:#10b981,stroke-width:2px,color:#f8fafc style T fill:#1e293b,stroke:#8b5cf6,stroke-width:2px,color:#f8fafc style F fill:#1e293b,stroke:#f59e0b,stroke-width:2px,color:#f8fafc style C fill:#1e293b,stroke:#ec4899,stroke-width:2px,color:#f8fafc style A fill:#1e293b,stroke:#64748b,stroke-width:2px,color:#f8fafc

Development Tools vs. Runtime Dependencies

To maintain a lean codebase without sacrificing developer productivity, gofs strictly distinguishes between runtime dependencies and development tools:

CategoryDefinitionGofs Policy
Runtime DependencyCode that compiles into your binary or ships to user browsers.Kept as close to zero as possible. Must be small, stable, and built on backward-compatible standards.
Development ToolTools that run during development or CI to generate code (e.g. gofs, sqlc).Allowed under one golden rule: The output must be plain, readable code that continues working even if the tool disappeared tomorrow.

Under this rule:

  • sqlc is accepted: It parses SQL and writes plain Go standard library database/sql code. The generated code is committed to your repository. Your app builds and runs without sqlc installed.
  • templ was replaced: templ generated code that depended on an external templ runtime library in your binary. If the generator fell behind, the app broke.
  • JavaScript bundlers are rejected: An app that cannot run without a bundler depends on that bundler at every build forever, bringing along the entire npm ecosystem and its vulnerabilities.

The Role of AI in Evergreen Architecture

For decades, software development followed a recurring cycle: languages and standard libraries were deemed “too verbose,” so developers created frameworks and DSLs to abbreviate common tasks. But those frameworks inevitably aged, introduced breaking changes, and accumulated technical debt.

Today, generative AI and LLM coding assistants break this cycle permanently:

  1. Standard Code is AI’s Native Language: AI coding assistants are trained on decades of standard HTML, CSS, SQL, and standard Go code. They generate standard code with near-perfect accuracy and minimal hallucinations because the specifications are stable and universally documented. Conversely, niche template DSLs and rapidly churning framework APIs frequently confuse AI models.

  2. Zero-Abstraction Velocity: Writing server-rendered Go html/template layouts, repetitive form inputs, or Declarative Shadow DOM structures no longer requires typing hundreds of characters by hand. AI assistants generate and update boilerplate in seconds.

  3. Longevity Without Ergonomic Compromise: You get the best of both worlds: the ultra-fast development speed previously promised by high-level frameworks, combined with the rock-solid, evergreen stability of standard Go, standard SQL, and native web standards.


Summary

Gofs is not another framework; it is an architectural mindset. By rejecting the dependency treadmill, anchoring your server in Go’s standard library, querying with plain SQL via sqlc, leveraging Web Components and Declarative Shadow DOM, and utilizing AI to write clean, standard code, you build systems that:

  • Never break on toolchain upgrades
  • Have zero supply chain vulnerabilities from third-party package managers
  • Eliminate costly “standing still” maintenance cycles
  • Deliver maximum performance and simplicity for developers and end users alike

While we plan to build a gofs cli, it is meremly a template for a starter project that envisions these principles, not a mandatory build tool or part of the build pipeline.