🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Starting with MDriven Turnkey
This page was created by Alexandra on 2017-01-15. Last edited by Wikiadmin on 2026-07-29.

MDriven Turnkey lets you turn a model created in MDriven Designer into a web application, and this page guides new Turnkey developers through creating, uploading, and testing their first application.

What you build with Turnkey

MDriven Turnkey is the web front end for an MDriven application. You define the application’s information model and user interface in MDriven Designer, upload the model to MDriven Server, and use Turnkey to run the resulting web application.

For example, you can model a Car type with a RegistrationNumber attribute, create a list screen for all cars, and add actions that create and edit cars. After you upload the model, those actions are available in the Turnkey site.

Turnkey uses web technologies including Bootstrap rendering for HTML5 user interfaces. It works with MDriven Designer and MDriven Server, and the product line also supports technologies and databases described in Documentation:MDriven Product Line.

Before you start

You need the following:

  • A Turnkey site or Turnkey token.
  • An account for the site-registration process when you use an MDriven-hosted site.
  • The current version of MDriven Designer.
  • Access details for the MDriven Server that will receive your model.

Use the latest MDriven Designer when working with Turnkey. The Designer’s cloud dialog lets you sign in, refresh the available applications, download a starting model, and upload model changes.

Choose where to run Turnkey

You can begin with a hosted Turnkey site or run Turnkey yourself.

Option When to choose it What you do next
MDriven-hosted site You have a Turnkey token and want to begin modeling and deploying. Register or sign in, claim the application associated with the token, configure the application name, then connect with MDriven Designer.
Self-hosted site You need to run MDriven Server and Turnkey in your own environment. Install and configure MDriven Server and Turnkey, connect Turnkey to the server, then upload your model from MDriven Designer.

For an overview of the available deployment approaches, see Documentation:Introducing MDriven Turnkey. For IIS installation, see Documentation:Deploying MDriven Server & Turnkey Core on IIS. For native macOS setup, see Documentation:MDriven Server & MDriven Turnkey On Native MacOs.

Start with a hosted Turnkey site

Follow these steps when you have received a Turnkey token.

  1. Open the site-registration location provided with your token.
  2. Register for an account, or sign in if you already have one.
  3. Paste the Turnkey token and search for the application associated with it.
  4. Claim the application.
  5. Open the application settings.
  6. Set the application name and send the settings to the application site.
  7. Open the application site to confirm that it is available.
  8. Start MDriven Designer and open its cloud dialog.
  9. Sign in and refresh the application list. Confirm that your application appears.
  10. Download the starting model for the application.

You now have a local model to change in MDriven Designer and a Turnkey site where you can test the uploaded result.

Build and publish a first feature

This example creates a small car register. It demonstrates the normal loop: change the model, check it, upload it, and test it in the browser.

Create the type

  1. In MDriven Designer, add a class named Car.
  2. Add a string attribute named RegistrationNumber.

A class defines a type of information in your application. In this example, each Car object stores one registration number.

Create a list ViewModel

A ViewModel defines what a user sees and can do in a particular view.

  1. Add a ViewModel named AllCars.
  2. Set its type to Car.
  3. Add a multi-link based on Car.AllInstances. This supplies all existing Car objects to the list.
  4. Add RegistrationNumber as a column in the list. Adjust its display size if needed.
  5. Add a global action that shows AllCars.

A global action is available without first selecting a specific object. In this example, it gives the user an entry point such as “show all cars.”

Add create and edit actions

  1. Add a class action for creating Car objects.
  2. Run the model check and correct any reported issues before uploading.
  3. Add a second ViewModel named EditOneCar with type Car.
  4. Add the RegistrationNumber attribute to EditOneCar.
  5. Add a class action that shows EditOneCar.

A class action applies to an object of its class. When a user selects a car in AllCars, the edit action can open EditOneCar for that selected car.

Upload and test

  1. Return to the cloud dialog in MDriven Designer.
  2. Select the application and upload the model.
  3. Check the upload status. Wait until the model check completes and the generated SQL script has been applied.
  4. Refresh the Turnkey application in your browser.
  5. Run the global action that opens AllCars.
  6. Create a car, enter a registration number, and save it.
  7. Select the new car and run the edit action. Change the registration number, save, and return to the list to verify the updated value.

While editing, Turnkey exposes save and cancel behavior. Canceling discards unsaved changes. The application also provides undo and redo controls when changes are available.

Required model elements

A Turnkey application needs an entry ViewModel named Index. If it is missing, the site reports that the page is missing and asks for a ViewModel with that name.

Create Index before testing a new model:

  1. Add a ViewModel named Index.
  2. Give it a suitable type for the information it should present.
  3. Add content to the ViewModel, such as a static string or links to the application’s primary actions.
  4. Upload the amended model and refresh the site.

Turnkey also needs identity support in the model. A missing SysUser type causes an error when navigating the application. The local-setup walkthrough demonstrates importing and applying the ASPNETIdentity snippet in MDriven Designer to add the classes needed for user identification and sign-in support.

Work in short model-to-site cycles

Use this cycle throughout development:

  1. Change the model, ViewModels, actions, or rules in MDriven Designer.
  2. Run model check.
  3. Upload the model to MDriven Server.
  4. Wait for the server to generate and apply the database changes.
  5. Refresh the Turnkey site and test the affected action or view.

For example, after adding EditOneCar, upload the changed model, refresh the browser, select a car, and verify that the new class action is available. This keeps each change small and makes errors easier to isolate.

When you run Turnkey locally

A self-hosted Turnkey installation has two running parts: MDriven Server and MDriven Turnkey. Turnkey must be configured to connect to the MDriven Server, and you must upload a model before the application can serve meaningful content.

On macOS, the supplied guidance notes that Turnkey attempts to connect to MDriven Server on port 5010. The App_Data/MDrivenServerOverride.xml file contains the server connection details. If either process is stopped, the corresponding server stops. See Documentation:MDriven Server & MDriven Turnkey On Native MacOs for the complete procedure.

On IIS, create separate application pools for MDriven Server and Turnkey, set each pool to No Managed Code, grant the application-pool identity read/write access to the application folder, configure bindings, and ensure that the URLs in the override files match the IIS bindings. Follow Documentation:Deploying MDriven Server & MDriven Turnkey Core on IIS for the full configuration, including CommandLineOverride.xml and MDrivenServerOverride.xml.

Next steps

After the first model is running, continue with the Turnkey tutorial sessions to learn about types, images, value stores, pick lists, action visibility, validation, logged-in users, access groups, social login, and OCL expressions. OCL is the expression language used to query and work with objects and collections in the model.

See also