https://github.com/guyaross/orbit
Javascript to Go transpiler and micro frontend toolchain
https://github.com/guyaross/orbit
go golang javascript microfrontend react server-sider-rendering ssr
Last synced: 5 months ago
JSON representation
Javascript to Go transpiler and micro frontend toolchain
- Host: GitHub
- URL: https://github.com/guyaross/orbit
- Owner: GuyARoss
- License: gpl-3.0
- Created: 2021-07-09T02:37:49.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T15:39:12.000Z (over 1 year ago)
- Last Synced: 2026-01-14T15:53:46.828Z (5 months ago)
- Topics: go, golang, javascript, microfrontend, react, server-sider-rendering, ssr
- Language: Go
- Homepage: https://guyaross.github.io/orbit/
- Size: 80.1 MB
- Stars: 44
- Watchers: 2
- Forks: 2
- Open Issues: 27
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Orbit ·  [](https://app.codecov.io/gh/GuyARoss/orbit/) [](https://www.codefactor.io/repository/github/guyaross/orbit) [](./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](/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
```jsx
// /pages/hello-world.jsx
const HelloWorldComponent = ({ from }) => {
return (
<>
Hello, from {from}
>
)
}
export default HelloWorldComponent
```
3. Run the build process with `orbit build`
4. Create golang application
```go
// 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())
}
```
5. Run golang application with `go run main.go`
## Contributing
### [Contributing Guide](./CONTRIBUTING.md)
Please first read our [contributing guide](./CONTRIBUTING.md) before contributing to this project.
### [Good First Issues](https://github.com/GuyARoss/orbit/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
To gain exposure to the project you can find a list of [good first issues](https://github.com/GuyARoss/orbit/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
### License
Orbit it licensed under [GNU GPLv3](./LICENSE)