Skip to content

App Definition

  • Directory.codegenie
    • app.ts
    • logo.png

Code Genie generates source code based on your application’s data model (or Entity Relationship Model).

It’s recommended to import type definitions from the @codegenie/cli package (npm i -D @codegenie/cli) for a better experience when defining your application’s data model.

import type { AppDefinition } from '@codegenie/cli'
const appDefinition: AppDefinition = {
name: 'My App',
export default appDefinition

The fastest way to get started is to ask Code Genie to generate an initial data model for you by providing a description of what you’re trying to build. See the Getting Started Guide.



Email address to receive notifications when an alarm is triggered.


Domain name to use for your API, e.g.


Domain name to use for your web app, e.g.


The automatically generated ID of your Code Genie application. All builds/generations will create a Build under this App. If appId isn’t specified, a new App will be created when you run generate and appId will be set for you.



A list of Identity Providers supported by your App.

identityProviders: [{ providerType: 'Google' }, { providerType: 'SAML' }]


The name of the Entity to be used as the default/root page when first logging in. For example, if you specify ‘Widget’, you’ll land on the Widget List page. This value must be set to a key defined in entities.


A short user-facing description of your application. Added as HTML meta tags for description, og:description, and twitter:description.


Your root domain name. Used for sending emails such as User Verification emails.


A key/value Map where the key is a pascal-cased name of your Entity.

entities: {
MyWidget: {}

See Entity for more details.


A list of paths to not generate. Useful when you want to re-generate your app but have heavily modified certain files that you don’t wish to overwrite.


Name of your application.


Email address to use when a user invites another user to their organization. e.g.


The permission model to use.

  • Global: All users have access to all data within the app. Used for single-tenanted applications such as internal apps.
  • User: Users can only access their own data.
  • Organization: Users can only access data within their Organization. An Organization Entity is included with your app, allowing you to invite other Users to your Organization.


The AWS region you want to deploy your app in. Must be set to a valid AWS region, e.g. us-west-2.



Your app’s primary brand color to use throughout your application. e.g. #579ddd


Email address to use for sending User verification emails when a user first registers. e.g.


Define your aplication’s Data Model (or Entity Relationship Model) by specifying entities. For each Entity defined, Code Genie generates:

  • React/UI Components: List Page, Details Page, Upsert (Create/Edit) Modal, Delete Modal, Table, Card List
  • API: Routes and Controllers for Create, Read (List + Get), Update, and Delete (CRUD)
  • Database Table
  • … and more


This is an optional setting for advanced usage only.


Specify GSIs when you need to query data based on a partition other than the Table’s partitionKey


A list of attributes to project on this partition, or “ALL” (default).


Name of the GSI


Partition Key for this GSI


Sort Key for this GSI


Specify LSIs when you need to sort the data in a way other than the Table’s sortKey


A list of attributes to project on this partition, or “ALL” (default).


Name of the LSI


Sort Key for this LSI


The name of the property to partition data on. If the Entity specifies a parentEntity, this defaults to the Parent Entity’s ID Property.


The name of the property to sort data by. If the Entity specifies a parentEntity, this defaults to this Entity’s ID Property, which by default is a time-sortable randomly generated ID.


If this Entity is a child of another Entity (i.e the other Entity has a one-to-many relationship with this Entity), specify the name/key of that Entity. Entities that have a parentEntity are affected in the following ways:

  • They don’t show up in the main navigation of the UI. Instead, they show up in the details page of their Parent Entity. Their URL routes are nested under their parent, e.g. /parentEntity/:parentEntityId/childEntity/:childEntityId.
  • Their API routes are nested under their parent, e.g. /parentEntity/:parentEntityId/childEntity/:childEntityId. Note that deeply nested entities (i.e Entities that have a Parent Entity that also has a Parent Entity) don’t result in deeply nested API routes.
  • Their DynamoDB Table has both a partitionKey and a sortKey. The partitionKey is set to the ID Property of the Parent Entity, and the sortKey is set to its own ID Property, enabling efficient querying of child records.


A map of Properties (or “attributes”) that this Entity has. Each entry should have a camelCased key of the property name.

properties: {
myProperty: {}

See Property for more details.



Whether a Details Page should be generated for this Entity. This is especially useful when an Entity has few properties and no Child Entities (i.e all of the information is easily visible on the List Page).


This icon shows up in navigation and breadcrumbs.


How the List Page should present the data. Valid options are ‘Table’ (default), ‘List’, and ‘CardList’.


Specify a Child Entity (i.e an Entity that defines this Entity as its parentEntity) to add a nested table to each row to list child records.


Remain on the current page instead of navigating to the newly created record’s page.


Show the created time of the record in the UI.


Show an Edit button on each Card in the List.


Show an Edit button on each Row in the Table.



Must be one of the following:

  • string: Uses a standard text input in edit views, and displayed as plain text in read views. DynamoDB type: string.
  • number: Uses a number input in edit views. Can use format to present as a compact or monetary value in read views. DynamoDB Type: number.
  • date: Uses a date/time picker (depending on format) in edit views. Shows as a relative time in read views with the complete date on hover (e.g. 5 days ago). DynamoDB type: date.
  • boolean: Uses a Switch in edit views. Shows ‘Yes’/‘No’ in read views. DynamoDB type: boolean.
  • enum: Uses a single select in edit views. DynamoDB type: string.
  • array: Uses a multi-select in edit views, and a list of Tags/Pills in read views. DynamoDB type: list.
  • map: Often called an “object” or “key:value ”. Uses a multiline textarea in edit views. DynamoDB type: map.
  • image: Uses a file uploader in edit views, and displays an image in read views. Images are stored as base64 encoded strings in DynamoDB. This will be replaced with storing images in S3 in a future update.


The property used to uniquely identify a Record of this Entity. If no property is marked with isIdProperty, one is created for you with the format {entityName}d (e.g., for an Entity called Widget, the property is called widgetId). When specifying your own ID property, it’s recommended to still follow this format.


The property used for a human to identify a Record of this Entity, e.g. a person’s name or a list’s title. This property is more prominent in the UI in places such as Tables (shown as the first column), Cards (shown in the title), and in search/select components.


You can mark a property of type image as the main image property, e.g. the standard User Entity has a profilePicture property. This property will be presented in multiple places next to the record’s name property, such as in List Views, Details Views, and when selecting a related record.


Prevent creating/editing a record without setting a value for this property.


Allow this property to be set during creation of the record, but cannot be udpated/edited later.


Cannot be set by the user. Use defaultValue to set a value during creation.


Default value of this property. The value should match the type of property (.e.g Boolean properties can specify a value of true or false). Special values include:

  • $now: Sets the value to Only valid for Date properties (type: 'date')
  • $currentUserId: Sets the value to the current User’s ID. Only valid for String properties (type: 'string')


When specified, a tooltip is shown for the field in the edit view with this description.


Some property types allow you to specify a format.

String Properties:

  • email: Uses an email input in edit views, and an email link in read views.
  • url: Uses a link in read views.
  • multiline: Uses a multi-line text area input in edit views, and is given extra space when shown in read views.
  • password: Uses a password input in edit views.
  • color: Uses a color picker input in edit views, and shows a color swatch in read views.

Number Properties:

  • compact: Uses a compact number (e.g. 2.7k) in read views.
  • money: Similar to compact but includes a ’$‘.

Date Properties:

  • date: Uses a datepicker input in edit views. Shows as a relative time in read views with the complete date on hover (e.g. 5 days ago). This is the default format for Date Properties.
  • date-time: Similar to date, but includes a time component in the datepicker.
  • time: Similar to date, but only shows a Time picker.
  • timestamp: Similar to date, but the DynamoDB attribute type is set to number instead of date


String length must be <= this amount. String Properties only.


String length must be >= this amount. String Properties only.


String must match this pattern. String Properties only.


Value must be at least this amount. Number Properties only.


Value cannot be more than this amount. Number Properties only.


Adds regex to Upsert Component to prevent decimals and sets stepper to 1.


Specify an Entity to create a parent-child relationship (i.e the Parent Entity has a one-to-many relationship with this Entity). This value must match the name/key of another Entity defined in entities. String Properties only.


showInCardList?: boolean
showInDetails?: boolean
showInReadView?: boolean
showInTable?: boolean