Skip to main content

Admin Workspace

Gojang automatically discovers the models in your generated Ent client and lists them in the staff workspace at /admin. Once the database schema is ready, each resource shows its existing records. The screenshots below show a sample project tracker built with Ent.

Work in the grid​

Select a resource from the sidebar, then choose Grid view. Edit supported fields directly in a cell. HTMX refreshes the changed cells and rows in place.

The Projects grid with editable fields and the Search, Fields, Filter, and Sort controls

  • Search finds case-insensitive matches across the resource's configured text fields. Users search by email, and Posts search by subject and body. Search works alongside the selected filter.
  • Fields controls which columns are visible.
  • Filter narrows the result to matching records. In the sample grid, choose Status, select equals, and enter In progress.
  • Sort orders records by a supported field. For example, sort Due Date in ascending order to see upcoming deadlines first.
  • Rows per page controls how many records appear at a time. The grid shows the result count and page controls.

Gojang applies supported filters and sorts in the database before counting and paginating rows. An explicit grid sort takes precedence over the resource's default order.

Edit records and follow relationships​

Choose Add record to create a row, or Open to edit or delete an existing one in the side drawer. If validation fails, the editor stays open with field errors and retains the submitted non-sensitive values.

The Client onboarding record drawer with editable project fields and a link to related milestones

Supported Ent relationships link to a grid scoped to the selected record. For example, Open related Milestones shows the milestones linked to Client onboarding.

Open the workspace in your app​

  1. Start Gojang and seed the first admin if you need a staff account.
  2. Sign in as staff and open http://localhost:8080/admin.
  3. Try a built-in resource such as Posts, or add your own Ent model. Generate the Ent code and apply the schema so Gojang can discover the model at startup and load its records.

Customize a resource​

Use optional overrides in app/gojang/admin/models.go to set labels, icons, default columns, hidden or read-only fields, and save hooks. Add SearchFields: []string{"Name", "Notes"} to a ModelRegistration to offer search across those Go fields on a model with visible Ent text fields named Name and Notes. See the admin development guide for the field rules and examples.