Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
/ BootGenSDK Public archive

Customizable code generator library for rapid application prototyping.

License

Notifications You must be signed in to change notification settings

BootGen/BootGenSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BootGen Build Status Coverage Status NuGet

Customizable code generator library for rapid application prototyping.

See a live demo at bootgen.com!

Supported Languages

C#, TypeScript, Swagger (OAS3)

How Does it Work?

From a set of sample data given JSON format BootGen will determine a data model. Using this data model and a set of Scriban templates it will generate a server and a client application.

An example set of Scriban templates can be found here.

An Example JSON Input

{
  "users": [
    {
      "userName": "Test User",
      "email": "[email protected]",
      "tasks": [
        //timestamps
        {
          "title": "Task Title",
          "description": "Task description",
          "isOpen": true,
          "dueDate": "2021-12-30T12:00:05",
          "estimatedHours": 1.5,
          "priority": 1,
          "tags": [
            //manyToMany
            {
              "name": "important",
              "color": "red"
            }
          ]
        }
      ]
    }
  ]
}

Conventions

  • Property and class names should be camelCase. Casing will be set in the generated code according to the type of file generated. In C# PascalCase will be used, in TypeScript property names will remain camelCase.
  • Array names should be plural nouns, everything else should be in singular form. In the generated code the fitting plural or singular form of names will be used.

Annotations

Although comments are non-standard feature in JSON, many JSON processing libraries support it. We use them as annotations. Annotations can be placed at the beginning of arrays. Possible annotations:

  • timestamps: Adds a Created and an Updated timestamp property to the class.
  • manyToMany: Declears that the given relation is a Many-To-Many relation, as opposed to the default One-To-Many relation.
  • class:[name]: Substitute [name] with the intended name of the class. Example:
{
  "users": [
    {
      "userName": "Test User",
      "email": "[email protected]",
      "friends": [
        //class:user
        //manyToMany
        {
          "userName": "Test User 2",
          "email": "[email protected]"
        }
      ]
    }
  ]
}