MCPcopy Index your code
hub / github.com/GuyARoss/orbit

github.com/GuyARoss/orbit @v0.21.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.21.0 ↗ · + Follow
774 symbols 2,047 edges 122 files 128 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Orbit · prerelease codecov CodeFactor GitHub license

Orbit is a golang server side processing framework for building server side web applications.

  • Micro-frontend: Out of the box support for React and vanilla JavaScript micro frontends.
  • Static bundling: Automatically creates static HTML files for components that don't make use of server side processing.
  • Bundling support: Orbit currently has support for the following tools:
Name Extent of support
Vanilla Javascript Full support
Client side React Full support
Server side React Experimental
Vue Planned

Installation

  • Go Install: To install with go install, you can use the command go install github.com/GuyARoss/orbit@latest
  • Manual Installation: To install manually, clone this repo and compile it with go build.

Examples

There are several examples that exist in the ./examples. Here is a basic one to get you up and running.

  1. Initialize the workspace directory with orbit init, then follow the prompts
  2. Create a react component
// /pages/hello-world.jsx
const HelloWorldComponent = ({ from }) => {
    return (
        <>


 Hello, from {from} 


        </>
    )
}

export default HelloWorldComponent
  1. Run the build process with orbit build
  2. Create golang application
// main.go
package main

import (
    // ... 
)

func main() {
    // orbitgen comes from an autogenerated lib output from orbit
    orb, err := orbitgen.New()
    if err != nil {
        panic(err)
    }

    orb.HandleFunc("/", func (r *orbitgen.Request) {
        props := make(map[string]interface{})
        // sets the prop 'from' to the string 'orbit'
        props["from"] = "orbit"

        // renders a single page & passes props into the component
        c.RenderPage(orbitgen.HelloWorldComponent, props)

        // can also use c.RenderPages(...) to build a micro-frontend
    })

    http.ListenAndServe(":3030", orb.Serve())
}

  1. Run golang application with go run main.go

Contributing

Contributing Guide

Please first read our contributing guide before contributing to this project.

Good First Issues

To gain exposure to the project you can find a list of good first issues.

License

Orbit it licensed under GNU GPLv3

Extension points exported contracts — how you extend this code

DefaultPage (Interface)
DefaultPage defines the standard behavior for a orbit page handler [6 implementers]
internal/assets/embed/orbit.go
DefaultPage (Interface)
DefaultPage defines the standard behavior for a orbit page handler [6 implementers]
examples/micro-frontend/orbitgen/orb_http.go
DefaultPage (Interface)
DefaultPage defines the standard behavior for a orbit page handler [6 implementers]
examples/basic-react/orbitgen/orb_http.go
LiboutFile (Interface)
(no doc) [10 implementers]
internal/libout/libout.go
JSWebWrapper (Interface)
(no doc) [4 implementers]
pkg/webwrap/wrap.go
JSDocument (Interface)
JSDocument is an interface that describes the behavior of a JSDocument [2 implementers]
pkg/jsparse/document.go
Packer (Interface)
(no doc) [3 implementers]
internal/srcpack/packer.go
DependencyTree (Interface)
(no doc) [2 implementers]
pkg/depend_tree/depend_tree.go

Core symbols most depended-on inside this repo

Error
called by 80
pkg/log/log.go
Contains
called by 60
pkg/allocated_stack/allocated_stack.go
Name
called by 23
pkg/jsparse/document.go
AddImport
called by 20
pkg/jsparse/document.go
NewEmptyDocument
called by 19
pkg/jsparse/document.go
Name
called by 19
internal/srcpack/component.go
Write
called by 18
internal/libout/libout.go
Close
called by 16
pkg/hotreload/hotreload.go

Shape

Method 342
Function 270
Struct 106
TypeAlias 28
Interface 26
Class 1
FuncType 1

Languages

Go93%
Python4%
TypeScript3%

Modules by API surface

pkg/jsparse/document.go50 symbols
internal/srcpack/component.go27 symbols
pkg/webwrap/wrap.go26 symbols
internal/assets/embed/orbit.go26 symbols
examples/basic-react/orbitgen/orb_http.go26 symbols
cmd/dependgraph/graphdoc.go25 symbols
pkg/hotreload/hotreload.go24 symbols
internal/assets/embed/orbit_test.go24 symbols
examples/basic-react/orbitgen/orb_test.go24 symbols
internal/libout/libout.go23 symbols
examples/micro-frontend/orbitgen/orb_test.go23 symbols
examples/micro-frontend/orbitgen/orb_http.go23 symbols

For agents

$ claude mcp add orbit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact