This repository provides a complete example application using AGROWS for RPC over WebSockets with a Golang backend and a WebAssembly (WASM) client.
The example demonstrates how to use AGROWS to define RPC functions in Golang, generate client and server code, and build a full application with development features like auto-reloading.
- Go 1.22.5 or higher
- Node.js (for bun)
- Rust (for rustywind)
- Tailwind CSS
-
Clone the repository:
git clone https://github.com/codeupdateandmodificationsystem/agrows-usage-example.git cd agrows-usage-example
-
Install dependencies:
go mod download npm install -g bun cargo install rustywind
- Generate the client and server code using the
agrows
CLI:just generate
To start the application with auto-reloading:
just watch
The example includes two RPC functions:
SayHello(name string) string
: Sends a greeting.CrazyMath(inp CalcInput) string
: Performs some math operations.
The CalcInput
type is defined as:
type CalcInput struct {
A int
B int
}
The web interface is built using HTMX and TypeScript. It provides a simple UI for interacting with the RPC functions.
The repository includes a justfile
with helpful commands for development:
just watch
: Builds and runs the application with auto-reloading.just generate
: Generates client and server code using AGROWS.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the GPL license. See LICENSE
for details.