This path teaches GOWDK through native .gwdk declarations plus normal Go
packages. It avoids migration positioning and keeps the current 0.x limits
visible.
Use installed gowdk commands inside an initialized app. Use
go run ./cmd/gowdk ... from this repository when trying repository examples.
- Follow Getting Started.
- Verify with
gowdk versionandgowdk doctor. - Build from source with
go build ./cmd/gowdkwhen contributing to this repo.
- Run
gowdk init --tests --template site /tmp/gowdk-learn. - Run
cd /tmp/gowdk-learn && gowdk build. - Start the generated binary with
./bin/siteand openhttp://127.0.0.1:8080/.
- Read data blocks.
- Try the repo example:
go run ./cmd/gowdk build --out /tmp/gowdk-go-interop examples/go-interop/imported-build.page.gwdk. - The
.gwdkfile declares the data need; the Go package owns the returned values.
- Read components.
- Build the base component example:
go run ./cmd/gowdk build --out /tmp/gowdk-base-components examples/components/base/*.gwdk. - Keep component behavior local to UI enhancement; server behavior stays in Go handlers.
- Read CSS and assets.
- Build configured page CSS:
go run ./cmd/gowdk build --config examples/css/gowdk.config.go --out /tmp/gowdk-css-build examples/css/styled.page.gwdk. - Build component assets:
go run ./cmd/gowdk build --out /tmp/gowdk-component-assets examples/components/assets/*.gwdk.
- Read actions.
- Build the action example into a generated app:
go run ./cmd/gowdk build --out /tmp/gowdk-action-build --app /tmp/gowdk-action-app --bin /tmp/gowdk-action-site examples/actions/signup.page.gwdk. - Use actions for POST behavior; keep business logic in normal Go handlers.
- Generated validation covers literal form constraints such as
required,minlength,maxlength, andpattern. - Try the endpoint cookbook:
cd examples/endpoints && make check && make build. - Domain validation remains in
examples/endpoints/src/endpoints/handlers.go.
- Generated action adapters wire CSRF by default; see actions.
- Run generated endpoint examples with a dev secret after building from
examples/endpoints:GOWDK_CSRF_SECRET=development-endpoints-csrf-secret-32b GOWDK_ADDR=127.0.0.1:8093 bin/endpoints. - Keep
Build.CSRF.Disabledoff for generated app deployments unless a test explicitly needs it.
- Read APIs.
- Inspect API route metadata:
go run ./cmd/gowdk routes examples/api/status.page.gwdk. - For a broader app, use
examples/endpoints/src/endpoints/api.page.gwdkandexamples/endpoints/src/endpoints/handlers.go.
- Read partials and fragments.
- Inspect the standalone fragment example:
go run ./cmd/gowdk manifest examples/partials/patients-fragment.page.gwdk. - For action-driven and standalone fragments together, run
cd examples/endpoints && make build.
- Read SSR.
- Build a request-time page:
go run ./cmd/gowdk build --ssr --out /tmp/gowdk-ssr-build --app /tmp/gowdk-ssr-app --bin /tmp/gowdk-ssr-site examples/ssr/simple-ssr.page.gwdk. server {}selects the request-time page lane and requires the SSR addon.
- Read guards and hooks.
- Inspect the protected flagship route in
examples/flagship/src/app/dashboard.page.gwdk. - Custom guards need generated-app hooks; the flagship
Makefilecopiesapphooks/flagship_hooks.go.txtbefore building the binary.
- GOWDK does not own schemas, queries, models, migrations, or domain logic.
- Use normal Go packages with
database/sql, sqlc, or a driver such as pgx. - The optional
addons/dbpackage is thin plumbing arounddatabase/sql; see DB addon for migrations, transactions, readiness, and a sqlc walkthrough. - From this repository, run
go test ./addons/dbandcd addons/db/sqlitetest && go test ./...to exercise the helper package and isolated real-driver module. - Broader real-world Go interop examples are tracked in #329.
- Read deployment.
- Build the embedded app example:
go run ./cmd/gowdk build --out /tmp/gowdk-embed-build --app /tmp/gowdk-embed-app --bin /tmp/gowdk-embed-site examples/embed/site.page.gwdk. - Run
/tmp/gowdk-embed-siteand openhttp://127.0.0.1:8080/.
- Read reverse proxies.
- Generated binaries speak plain HTTP; Caddy owns TLS and public host routing.
- Minimal Caddyfile:
example.com {
reverse_proxy 127.0.0.1:8080
}- Build any generated app with
--app <dir>. - Inspect
.gowdk/app/or the app directory passed to--app. - Use
go run ./cmd/gowdk inspect ir examples/pages/home.page.gwdkfor compiler IR andgowdk-build-report.jsonfor build events.
- Run
gowdk doctorfor setup and project-health checks. - Run
gowdk explain <diagnostic-code>for registry-backed explanations. - Read diagnostic codes and diagnostics.
- Scaffold smoke tests with
gowdk init --tests. - Read testing.
- Use
runtime/testkitfor generated handler HTTP scenarios and contract event assertions. - See
examples/contracts/patients/contracts_test.gofor command event capture.
- Tailwind is optional and user-installed; GOWDK does not download it.
- Read the Tailwind addon docs.
- Try the example after installing the standalone Tailwind CLI:
go run ./cmd/gowdk build --config examples/tailwind/gowdk.config.go --out /tmp/gowdk-tailwind-build examples/tailwind/site.page.gwdk.
- WASM islands are explicit and not the default component runtime.
- Read component WASM and the ABI
fixture in
testfixture/islands/islands.go. - The flagship example includes a call-site placeholder at
examples/flagship/src/app/home.page.gwdkand browser-side Go package shape inexamples/flagship/src/ui/counter.go. - Polished WASM island ABI examples remain tracked in #31.
Run the flagship example when you want one app that crosses most lessons:
cd examples/flagship
make check
make routes
make build
GOWDK_CSRF_SECRET=development-flagship-csrf-secret-32b GOWDK_ADDR=127.0.0.1:8092 bin/flagshipThe flagship app covers static output, build-time Go data, actions,
validation, CSRF, API, fragments, SSR server {}, guards, one binary,
contracts, CSS/assets, and an explicit WASM island placeholder.