Developer documentation

Getting started with Genelet Go

This guide follows the current Go README. It is a source-reviewed setup path, not a tested complete application. Use an isolated development directory and record your checkout revision.

1. Check out and inspect the module

git clone --branch main https://github.com/guruperl/genelet.git genelet-go
cd genelet-go
git rev-parse HEAD
go version
cat go.mod

The reviewed go.mod declares go 1.22 and toolchain go1.26.6. Check your toolchain selection and network policy before allowing Go to fetch tooling or module dependencies. SQLite integration uses the repository's SQLite driver; verify its build requirements in your environment.

2. Run the repository tests

go test ./...

The README notes that some database tests are skipped without local MySQL test configuration. Record skips separately; a successful default test run is not a passing database-integration result.

3. Add the framework to an application

From an existing Go application module, the documented dependency command is:

go get github.com/guruperl/genelet

Import github.com/guruperl/genelet. For repeatable work, retain the resolved version in the application's go.mod/go.sum and review upgrades deliberately.

4. Build the configuration and component contract

  1. Create conf/config.json with the script path, template root, public role, chartags and roles. Add database or authentication configuration only as required.
  2. For each component, create component.json describing its actions, current table or tables, and current key.
  3. Supply Filter and Model structs, usually embedding the framework's corresponding types.
  4. Initialize a controller from the application's HTTP entrypoint and register component factories.
controller.ModelFactories["question"] = func() interface{} {
    return &question.Model{}
}
controller.FilterFactories["question"] = func() interface{} {
    return &question.Filter{}
}

This is a registration excerpt from the documented contract, not a standalone Go program. It assumes an initialized controller and an application package named question. Each factory returns a fresh request-local value.

5. Verify the first application route

The documented route shape is <Script>/<role>/<tag>/<component>, optionally followed by an identifier. Start with one declared component/action, then verify the expected JSON or template output. Check rejected input and unauthorized access as well as the successful request.

Actions declared with no_db do not require database work; no_method is for actions handled through filter/template behavior. These are component settings, not substitutes for defining the route and component correctly.

Important limits

No samples directory was present in the reviewed tree. Optional Identity functionality requires an initialized IdentityService and a deployment key as described in the README. Never copy sample secrets into production, commit credentials, or treat a documented feature as a completed security review.