> For the complete documentation index, see [llms.txt](https://learn.coremodels.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.coremodels.io/getting-started/building-your-first-schema-part-1.md).

# Building your first Schema (Part 1)

### Your First Schema: Building a 'Blog Post' Type

Welcome to your first hands-on guide with CoreModels. In this tutorial, we'll walk you through building a simple `Blog Post` schema from scratch. You'll use the core concepts you've learned to create your first Type and its Elements.

If you'd rather follow a different script, you can jump to Module 2 of the [Crash Course](/getting-started/crash-course.md) to build a different example.

***

#### Step 1: Log In / Create an account

Before we begin, you need to log in to your account.

1. Navigate to the [go.coremodels.io](https://go.coremodels.io/) login page.
2. Click "Login to CoreModels" and use your preferred google or microsoft account.

***

#### Step 2: Create a New Project

In CoreModels, a "model" is the same as a Project. It's the highest-level container for all your schema assets.

1. From the left pane, click on "New Model".
2. Give your Project a clear name, like "My First Blog Project", and click "Create".

You now have a clean project to work in.

***

#### Step 3: Create a New Space (optional)

Now you need a Space to house your new schema.

1. Inside your new Project, from the top left dropdown (next to the CoreModels logo) click on the "All Spaces" drop down and click on "Add".
2. Give your Space a clear name, like "My First Blog Schema", and click "Create".

You now a space to categorize your nodes in.

***

#### Step 4: Define Your First Type with its Elements

Next, you'll create a Type to serve as the blueprint for all your blog posts.

1. In the Types grid UI, click on the green plus icon, it will open the 'Create New Type' modal.
2. Name your Type <mark style="color:$success;">Blog Post</mark>.
3. (optional) if you created a space, then you can select it.
4. Click on the drop down next to 'Create', and click on the first option 'Create and Add Elements'.
5. Name the first element as <mark style="color:blue;">Title</mark>
6. Click 'Add and Close'&#x20;

You have now created a type and its first element.

Note that the relation <mark style="color:$success;">Blog Post</mark> → <mark style="color:blue;">Title</mark> is called 'Domain Includes' Checkout the FAQ section for more information, [FAQ](/faq.md#whats-the-default-relation-when-creating-types-and-elements).

***

#### Step 5: Add the rest of the Elements

Now, let's add the rest of the fields that a blog post needs. These are the Elements that will hold your content.

1. Within the <mark style="color:$success;">Blog Post</mark> Type you just created, expand the "Elements" column.
2. Click on the caret icon next to the plus button, and click on 'Create Element'
3. Create the following Elements:
   * Name: <mark style="color:blue;">Summary</mark>
   * Name: <mark style="color:blue;">Body</mark>

Your <mark style="color:$success;">Blog Post</mark> Type now has a <mark style="color:blue;">Title</mark>, a <mark style="color:blue;">Summary</mark>, and a <mark style="color:blue;">Body</mark> field.

***

#### Step 6: Add a Mixin for a Rule

Let's make sure every blog post has a title by adding a rule. First we need to create the mixin

1. Click on the hamburger menu (☰) under the CoreModels logo, to open up the features tray.
2. Click on 'Mixins' (scroll down the features tray if it doesn't show up) and click on the plus button.
3. Set the mixin name as 'Validation Rules Mixin'
4. Click 'Create and Add Elements'
5. Set the mixin element name as 'Required' and choose the data type as 'Boolean', click Add & Close

Now let's use the mixin for our <mark style="color:blue;">Title</mark> field

1. In the 'Types Grid' on the far right, you'll find the sidebar tab, click on 'configuration', which will expand the configuration menu.
2. In the 'Elements Mixins' select the 'Validation Rules Mixin', and close the configuration by re-clicking on the sidebar.
3. The column 'Required' should show up in the Elements grid.
4. Click on the checkbox, for the <mark style="color:blue;">Title</mark> field to mark the <mark style="color:blue;">Title</mark> as required

You've just added a rule to your schema that will prevent any blog post from being saved without a title.

***

#### What's Next?

Congratulations! You've successfully created your first schema. In just a few minutes, you've used Spaces, Types, Elements, and Mixins to build a functional blueprint.

From here, you can continue to expand your schema by:

* Adding a Taxonomy for <mark style="color:purple;">Categories</mark> to organize your posts.
* Creating a Component to display your blog posts on a web page.
* Saving a sample record as an Exemplar for documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.coremodels.io/getting-started/building-your-first-schema-part-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
