Skip to content
← All articles

Technical guide · 1,751 words

How to Build an Admin Dashboard Without Building One

Learn how schema-driven admin infrastructure can replace repetitive CRUD screens while keeping validation, permissions, and REST APIs aligned.

An admin dashboard looks like a UI project, but the difficult part is the repeated record work behind the screens: defining fields, validating values, checking permissions, importing and exporting data, exposing an API, and recording changes. Building each resource as a separate React screen makes every shared requirement another place to maintain.

The alternative is to treat administration as a generated data surface. Define a data source once, derive the table and forms from its field metadata, and use the same metadata to validate writes and serve REST requests. This does not remove application-specific work; it keeps ordinary CRUD from becoming a collection of bespoke implementations.

Start with the data contract

Before choosing table components, list what an operator can do to a resource. In the current implementation, a data source can expose listing, search, exact filters, sorting, pagination, record creation, updates, deletion, bulk deletion, imports, and exports. Those operations share the same source and field definitions rather than each carrying its own schema.

The field definition is the useful unit of reuse. Dashier supports field types including text, textarea, number, decimal, boolean, email, phone, URL, date, datetime, JSON, image, file, enum, reference, array, and rich text. Definitions also carry required and unique flags, nullability, defaults, options, and position. Reference fields can point at another data source and declare one-to-one, one-to-many, or many-to-one cardinality.

That metadata drives the generated forms and columns, but it also drives server-side validation and the API contract. A write is coerced according to the field type, defaults are applied, and the record is validated before insertion or update. The write path also checks references and unique values. Unknown input keys are stripped by the shared Zod schema, while server-generated ID fields are not accepted from client input.

A concrete model: Members, Events, and Registrations

Imagine an application that needs three operational resources. A Members source might have an email field marked unique, a name text field, and a role enum. An Events source could contain title, starts_at, and capacity. Registrations could contain an attendee reference to Members, an event reference to Events, and a status enum. The reference options identify the target source and cardinality; a display column can make a picker show a member's email or name instead of an opaque record ID.

Dashier supplies the record tables, field-driven forms, list behavior, validation, source-scoped REST routes, and permission checks. It can confirm that a registration points to existing records and that a unique email is not repeated. It does not decide whether an event is full, whether a member is allowed to register, whether two events may overlap, or whether changing a registration should send a business email. Those are application rules and belong in a domain service or endpoint that calls the validated write path. A reference establishes record integrity; it does not reserve a seat or perform a transaction across several sources.

Treat field keys as an API decision

Field names are not merely labels in the form. The implementation derives a machine key from a name, stores user values under that key in JSONB, uses it in import mapping and filter parameters, and exposes it in API payloads. A label such as “Start time” therefore becomes a stable key such as start-time (or whatever key the source definition already contains). Renaming the display label should not casually change the key: existing records, saved imports, integrations, and URLs depend on it.

Keep credentials and permissions on the server

For an integration that syncs registrations, create an API key with the narrowest scope it needs and send it from a server-side job. The implementation stores a SHA-256 hash, shows the raw key once, supports x-api-key and bearer authentication, and rejects revoked keys. A browser bundle should not contain that secret.

Endpoint policy is a second decision. A route can be public, authenticated, or role-protected; it can also be disabled or excluded from the API channel. An authenticated key needs read or write scope for the method, while a role-protected API request needs the admin scope. Session callers are checked against their organization membership, project allowlist, source allowlist, and role. For the internal dashboard, system roles retain their rank behavior and custom roles use explicit keys such as registrations.read, registrations.create, registrations.update, and registrations.delete.

Design imports and tests as data paths

An import is not a shortcut around the schema. CSV headers or JSON keys are auto-mapped to field keys, an explicit mapping can override that choice, and reserved metadata columns such as id, createdat, and updatedat are not ordinary fields. Validation mode parses and previews without writing. It reports row-level issues, checks duplicate unique values within the file and against existing records, and accepts at most 2,000 rows per request. Commit then inserts through the same record writer, which rechecks references and uniqueness; a later failure can stop the import after earlier rows have been inserted.

The test plan should follow these boundaries rather than only asserting that a modal opens. For a Members source, test that an unknown payload key is removed, a duplicate email fails, a missing referenced Event fails, a client-supplied ID cannot replace the generated ID, and dashboard and API writes produce the same validation result. Test imports in both preview and commit modes, including duplicate rows, unmapped columns, a 2,001-row request, and a reference that disappears before commit. Finally, test each endpoint mode with missing, revoked, under-scoped, and admin-scoped credentials, plus a member whose project or source allowlist excludes the resource.

Store flexible values without pretending every domain is generic

Dashier uses the hierarchy organization → project → data source → record. A data source owns its ordered field definitions. Records have fixed identity, ownership, and timestamp columns, with user-defined values stored in a JSONB values column rather than in a new physical table for every source.

This is a practical fit for operational data whose shape changes and whose primary work is consistent CRUD. It is not a substitute for a domain model with complex joins, strict invariants, specialized query plans, or analytical workloads. In those cases, purpose-built tables and screens may be the clearer design.

The same limitation applies to workflows. A generated layer can manage records around a process, but a multi-step approval flow, unusual transaction boundary, or rich visualization needs deliberate application code. CRUD generation is an abstraction boundary, not a claim that every application can be represented by fields and forms.

Expose the same contract through REST

The REST API is generated from the same source metadata as the admin surface. The collection routes are /api/v1/{source-slug} for GET and POST; /api/v1/{source-slug}/{record-id} handles GET, PUT, and DELETE.

For example:

curl https://example.invalid/api/v1/members \
  -H 'x-api-key: YOUR_KEY'

curl -X POST https://example.invalid/api/v1/members \
  -H 'x-api-key: YOUR_KEY' \
  -H 'content-type: application/json' \
  -d '{"email":"new@example.com","role":"Editor"}'

The list endpoint accepts search, filter<field>, sort, dir, page, and perpage. Search applies to searchable text-like fields; filters are exact matches. The current query implementation scans at most 1,000 records before sorting and paginating, so this is an MVP-scale implementation rather than a promise of unlimited analytical querying. Exports use the same list query and currently return up to that same scan limit in CSV or JSON.

Authentication can use an x-api-key header or Authorization: Bearer <key>. Keys are stored and looked up by hash, belong to a project, can be revoked, and carry scopes. Without a key, the v1 resolver requires org and project query parameters and can evaluate an authenticated session. A source slug is resolved inside its project, and the project inside its organization; the slug is not treated as globally unique.

Enforce authorization before the handler runs

Hiding a button is not authorization. The server resolves the organization, project, source, fields, and endpoint policy before a REST handler receives its context. Policies can mark a method Public, Authenticated, or Role-protected; disable it; keep it out of the API channel; and assign a per-minute rate limit.

For authenticated policies, an API key needs the relevant read or write scope. Role-protected API requests require the admin scope; session requests require the owner or an explicitly allowed role. The internal dashboard follows a related source-level permission model, including read, create, update, and delete verbs for custom role grants. Project and per-member source allowlists are checked as part of resolution, and out-of-scope resources are not exposed as successful lookups.

Record writes use the same validated path whether they come from the dashboard or the API. Create and update check field values, references, and uniqueness before persistence. Create, update, delete, and import operations write audit entries with the organization, actor, entity, and relevant old or new values. The database migrations also define organization scoping and row-level policies; server-side checks remain necessary because clients cannot be trusted to supply their own roles or organization context.

Use imports and exports as controlled data paths

CSV and JSON imports support a validation preview before commit. The importer maps headers or keys to field keys, coerces values using the field definitions, reports row-level validation errors, checks duplicate unique values within the import and against existing records, and shows a preview. It accepts up to 2,000 rows per request. A commit inserts validated rows through the normal record writer; if a later insert fails, the response reports that the import stopped and how many rows were inserted, so callers should not treat the operation as a transaction.

Exports require read access and use the same source, filters, search, and sorting as listing. File and image values are validated as URLs at the record boundary; upload routes can create managed storage URLs, but a generated admin surface does not replace application-specific file processing.

Decide where the abstraction stops

Generated administration is a good fit when the work is recognizable CRUD, the data is operational, and consistency matters across several resources. It can provide tables, forms, permissions, imports, exports, audit logs, and a REST boundary without repeating those mechanics for every source.

A bespoke admin application is the better choice when the interface is itself a core product capability, operator efficiency depends on specialized interactions, or the domain constraints cannot be represented safely by the generic engine. Keep custom screens on the same validated and authorized data path where possible.

“Without building an admin dashboard” should not mean avoiding engineering. It means building the metadata, validation, and authorization layer once, then reserving custom UI for behavior that is genuinely domain-specific.

Dashier is admin infrastructure for modern applications. Learn how the product works in the documentation or explore features.