Skip to content

Commit 340999e

Browse files
committed
README updated
1 parent d6dda35 commit 340999e

1 file changed

Lines changed: 24 additions & 14 deletions

File tree

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,40 @@ gofred lets you write UI in pure Go and run it in the browser via WebAssembly, w
4444
go get github.com/gofred-io/gofred
4545
```
4646

47-
This repository is intended to be used as a library. The included `server/` and `main.go` demonstrate a minimal runnable example.
47+
This repository is intended to be used as a library. For development and running applications, use the [gofred-cli](https://github.com/gofred-io/gofred-cli) tool.
4848

4949
---
5050

51-
#### Quick start (example app in this repo)
51+
#### Quick start
5252

53-
1) Build the WebAssembly binary:
53+
Use the [gofred-cli](https://github.com/gofred-io/gofred-cli) tool to create and run applications:
54+
55+
1) Install gofred-cli:
5456

5557
```bash
56-
make build
58+
curl -fsSL https://raw.githubusercontent.com/gofred-io/gofred-cli/refs/heads/master/install.sh | bash
5759
```
5860

59-
This produces `server/main.wasm`.
61+
2) Create a new application:
62+
63+
```bash
64+
gofred app create my-app --package my-app
65+
```
6066

61-
2) Start the dev server:
67+
3) Run the application:
6268

6369
```bash
64-
make serve
70+
cd my-app
71+
gofred app run
6572
```
6673

67-
Then open the printed local URL (defaults to `http://localhost:8080`). The `server/index.html` bootstraps `wasm_exec.js` and loads `main.wasm`.
74+
This will start a development server with hot reload capabilities.
6875

6976
---
7077

7178
#### Minimal example
7279

73-
Create your own `main.go` and use gofred widgets to build UI. For example:
80+
When you create a new application with gofred-cli, it generates a `main.go` file like this:
7481

7582
```go
7683
package main
@@ -81,8 +88,8 @@ import (
8188
)
8289

8390
func main() {
84-
// See this repository's `main.go` for a complete runnable example
85-
application.Run(text.New("Hello, gofred!"))
91+
app := text.New("Hello, world")
92+
application.Run(app)
8693
}
8794
```
8895

@@ -96,14 +103,17 @@ Explore the `foundation/` packages for available widgets and options.
96103
- `foundation/` – Higher-level components (layout, text, buttons, router, etc.).
97104
- `hooks/` – React-like hooks for navigation, breakpoint, and state management.
98105
- `widget/` – Core widget abstractions and lifecycle.
99-
- `server/` – Minimal static server and HTML bootstrap for wasm.
106+
107+
For development tooling and server setup, see [gofred-cli](https://github.com/gofred-io/gofred-cli).
100108

101109
---
102110

103111
#### Development
104112

105-
- Build wasm: `make build`
106-
- Run dev server: `make serve`
113+
For development, use the [gofred-cli](https://github.com/gofred-io/gofred-cli) tool:
114+
115+
- Create app: `gofred app create my-app --package my-app`
116+
- Run dev server: `gofred app run` (with hot reload)
107117

108118
The CI workflow runs basic build and vet steps.
109119

0 commit comments

Comments
 (0)