Skip to content

RevoTale/no-js

Repository files navigation

no-js

no-js is an opinionated Go framework for server-rendered web applications. It is built around a strict web/* app tree, a generated App Bundle, and a convention-first runtime.

You write templ routes, resolver methods, view models, and app services. no-js generates the routing/runtime glue and lets httpserver.NewApp(...) assemble the default server.

What You Get

  • file-system routing with generated resolver contracts and an App Bundle
  • httpserver.NewApp(...) as the default runtime entrypoint
  • metadata and <head> composition
  • focused guides for optional app capabilities
  • build-time configuration through no-js.bundle.yaml

Shortest Path

Start with the standard app tree:

your-app/
  go.mod
  cmd/
    server/
      main.go
  web/
    routes/
      root.templ
      page.templ
      404.templ
    resolvers/
    view/

Run generation, implement the generated resolver methods, then pass the generated App Bundle to the runtime:

go tool no-js gen -root .
appContext := view.NewContext(...)

handler, err := httpserver.NewApp(httpserver.Config[*view.Context]{
	App: generated.Bundle(appContext),
})

That is the happy path. Reach for Custom Config only when the default runtime wiring is not enough.

For the exact files, use Getting Started. For the strict app contract, use App Conventions.

AI Agent Usage

If you are an AI agent building an application with no-js, start with AI Agents For App Development.

If you are modifying the no-js framework repository itself, use Framework AI Agents.

Client Assets

CSS, JavaScript, and TypeScript can live beside the route or component that uses them:

web/
  routes/
    page.templ
    page.css
    page.ts
  components/
    meter/
      meter.templ
      meter.css
      meter.ts

Generation creates Go helpers beside those files. CSS class names are hashed in the rendered HTML and bundled CSS. Matched routes automatically receive the CSS and module scripts for their page, layouts, 404 page, and imported components.

go tool no-js gen routes -root . writes the generated Go helpers. go tool no-js gen assets -root . writes the bundled, fingerprinted browser files. Most apps run both with:

go tool no-js gen -root .

See Static Assets And Client Assets for usage and Asset Pipeline Reference for the compile/bundle split.

Docs

For app developers:

For contributors:

About

No-JS is a front-end web framework built with Go, Templ and HTMX. Write a minimal code and gain the greatest performance. Directory-based router and strict data resolvers.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages