Architecture · 0.8.1

Project structure

The model, backend, admin and API contract.

On this page

The application model and settings live in .admingen/project.yaml. Generator UI edits this model; Generate updates the backend, admin, OpenAPI and schema migrations from it.

The tree shows a project with an Article entity. Backend and admin have separate dependencies and builds. A public website is a separate application that calls the API as a client.

The tree shows main paths using Article as an example, not a complete inventory. Files depend on the model and project capabilities.

Your project root

project/
├── .admingen/
│   └── project.yaml           # declarative model
├── backend/
│   ├── cmd/                   # Go entry points
│   │   ├── api/main.go
│   │   └── migrate/main.go
│   ├── internal/              # application packages
│   │   ├── domain/
│   │   │   └── article.go
│   │   ├── app/article/
│   │   │   ├── commands.go
│   │   │   ├── queries.go
│   │   │   └── service.go
│   │   ├── adapters/
│   │   │   ├── http/generated/article_handler.go
│   │   │   └── postgres/generated/article_repository.go
│   │   ├── infrastructure/
│   │   │   ├── database/database.go
│   │   │   └── migrations/migrations.go
│   │   ├── generated/
│   │   │   ├── bootstrap/app.go
│   │   │   └── customcontracts/composition.go
│   │   └── custom/
│   │       ├── app/composition.go
│   │       └── article/hooks.go
│   ├── migrations/            # schema history
│   │   ├── manifest.json
│   │   └── custom/
│   ├── openapi/               # HTTP contract
│   │   ├── openapi.yaml
│   │   └── entities/article.yaml
│   └── go.mod
└── admin/
    ├── src/                   # React + TypeScript
    │   ├── main.tsx
    │   ├── app/
    │   │   ├── router.tsx
    │   │   └── providers.tsx
    │   ├── features/article/
    │   │   ├── generated/
    │   │   │   ├── model.ts
    │   │   │   ├── form.tsx
    │   │   │   ├── list-page.tsx
    │   │   │   └── ui-extension.tsx
    │   │   └── custom/
    │   │       ├── extension.tsx
    │   │       └── ui-extension.tsx
    │   └── shared/
    │       ├── api/client.ts
    │       └── forms/field-controls.tsx
    ├── custom/vite.ts         # project build settings
    └── package.json

Keep your extensions in custom zones. Other files depend on enabled capabilities: media and Docker/deployment appear when configured for the project. Saving the model, generating files and applying migrations are separate operations.

Declarative model

.admingen/project.yaml describes entities, fields, relationships, access and generation settings. It defines what the application should contain. Generator UI is the main editing interface; CLI can make the same changes. Generate reads the model and produces code. Reconstructing the model from application source is not supported.

Go entry points

backend/cmd/ contains executable entry points. For example, cmd/api/main.go starts dependency composition and the HTTP server. Separate entry points let you run the API and maintenance commands independently.

Application packages

backend/internal/ holds entity types, application services, HTTP/SQL adapters and technical mechanisms, including custom extensions. Package purpose and file ownership are distinct: dependency directions and generation rules are explained in the following articles.

Schema history

backend/migrations/ contains SQL migrations and their registry. Generate adds new schema-change steps. Run the migrator separately to apply them to PostgreSQL. Released history is preserved: editing the model does not rewrite earlier migrations.

HTTP contract

backend/openapi/ describes API routes, parameters, request bodies and responses. Website and other client developers can use this contract without studying internal Go packages.

React and TypeScript

admin/src/ contains the admin application: routing, lists, forms and shared controls. Standard parts are updated from the model. Entity custom zones beside them contain your components and extensions.

Project build settings

Extend Vite configuration in admin/custom/vite.ts. The generator seeds this file only if it does not exist. After that you own the file and subsequent Generate operations preserve your settings. The overlay supports its documented options; it does not replace the entire build configuration.

Practical guides