Start · 0.8.1

Your first project: from model to first record

Create a project in Desktop, configure an entity in Content and save the first record in the generated admin.

On this page

This guide creates an application for records: define fields in Generator UI, generate a Go backend and React admin, then save your first record. The project model is stored in .admingen/project.yaml, but you do not need to edit that file manually.

First install Admingen. Use Desktop to author the model: its start screen creates projects without assembling a CLI command. Go, Node.js/npm, Make and Docker with Compose are needed to build and run the generated application; see its files for versions.

ENTITY_NAME, RELATED_ENTITY_NAME and TABLE_NAME stand for your names, not special Admingen entities. Replace them with your own technical names; field names use supported lowerCamelCase or snake_case.

1. Open the project in Generator UI

  1. Start Desktop. Under Your projects, use Create a project.
  2. Enter Project name (my-app), Title and Go module path (example.com/team/my-app).
  3. Click Choose parent folder…, select its parent directory, then choose Media storage. Local files is sufficient for a first local project.
  4. Enable Include deployment configuration when deployment files are needed; configure environments later in Deployment. Click Create project.
  5. For an existing project, use Open project…. Check its name on Dashboard, then change its displayed title in Project settings if needed.

2. Define records in Content

Open Content → New module and create the content module. Then click New entity: create a persistent entity named ENTITY_NAME with the TABLE_NAME table. Persistent means its records are stored in the database. Use Add field to add:

  • id with the Identifier int64 preset: a primary key with generated values;
  • title with type String and Required enabled;
  • body with type Text and Markdown presentation.

Click Finish after configuring each field. Check the saved fields' types and properties in the table. To add sections and relationships immediately, continue with the CMS guide.

3. Review changes and Generate

Go to Generate and click Preview changes. Review the files that will change and the impact on access and API routes. Inspect the differences, resolve model errors and conflicts, then click Generate. The generator creates the backend, admin, migrations, API and remaining project files.

Distinguish three steps: saving the model, generating files and applying database changes. Generate performs the second step. Afterwards, you still need to start the application and apply migrations.

4. Create your first record in the admin

Run the startup command below. The terminal will offer to create the first superadmin: set a username and password; there is no shared default password. Open the admin address printed in the output, sign in and select ENTITY_NAME. Enter a title and body, save the record, then open it again.

You can now edit the record title and body in the admin. They are saved in PostgreSQL; Generate is unnecessary. To add a field, return to Generator UI, change the model, Generate and apply the migration.

Terminal preparation and startup

If Desktop has already created the project, open its root in a terminal and start only the generated application:

cd /PATH/TO/PROJECT
make dev

Wait for environment setup, PostgreSQL and migrations. When there are no accounts, the terminal wizard asks for the first superadmin login, password and password confirmation using hidden password input. Then open the admin address printed by the command. See first administrator.

Without Desktop, initialize interactively:

admingen-cli --path ./my-app init

Answer the project name, path, title and Go module prompts, review the summary and confirm creation. Start the browser editor separately:

admingen --path ./my-app start --addr 127.0.0.1:8080

Init creates the model and attempts local Git initialization without a remote or commit. The generator and generated application use different addresses. For automation flags, see CLI init.

Optional: the same cycle through CLI

You can also edit the model with CLI commands, for example in a script. View the plan and apply generation with:

admingen-cli --path ./my-app plan
admingen-cli --path ./my-app generate --dry-run
admingen-cli --path ./my-app generate

Dry-run displays proposed changes without writing anything. UI and CLI use the same model; choose whichever suits the task.

Troubleshooting

  • Command not found: check PATH or use the binary's absolute path.
  • Port occupied: choose another --addr for Generator UI; application ports are configured separately.
  • Docker unavailable: start Docker and retry local startup.
  • Incompatible version: the current contract is 0.8.1. Editing the version in an old lock does not upgrade the project.
  • Generate conflict: inspect the differences and preserve necessary manual changes before allowing overwrite.

Next: create a CMS through the UI, local development, safe model changes.

After your first project

For the remaining screens, open UI interface. Settings are covered separately: Content, field settings, access. For terminal work, use CLI interface.

Explore ready-made projects

Prefer to inspect generated applications first? Explore the five demo projects, with prepared records, relationships, API and application models.

Continue with the same project

You can build this example manually without signing in. Standard use supports up to 15 authored persistent and virtual entities per project; system entities do not count. See Account and limits before growing a larger model.

For another way to start, AI Model can propose new entities for review. Admin editor arranges generated forms without changing the data model. Both require the corresponding account access. Custom code and model authoring can develop in parallel; later Generate runs preserve custom zones.