Quickstart
This guide will get you up and running with Xams and covers the following:
- Creating a Xams Api project
- Creating a Xams React project
- Creating tables
- Displaying and creating records from a datatable
- Writing service logic
- Creating forms
Prerequisites
Install EF Core Tools
Ensure you have version 8+ of the Entity Framework Core tools installed.
Terminal
Create Api Project
- In your c# IDE of choice create a new ASP.NET web based project using .NET 8
- Install the required nuget packages.
Terminal
- Create a new DbContext that inherits from XamsDbContext.
Project
- Add the Xams services and provide the DbContext.
Program.cs
- Add the Xams Api's and enable the dashboard.
Program.cs
- Create and run the migration.
Terminal
- Run the project and navigate to the below path adding the port from the asp.net project.
http://localhost/xams/admin?userid=f8a43b04-4752-4fda-a89f-62bebcd8240c
A new Xams project isn't configured with Authentication or Authorization but still has users. Whenever the api starts, it creates system records. One of those system records is the "SYSTEM" user. The Id of this user is always f8a43b04-4752-4fda-a89f-62bebcd8240c.
- Enable CORS to allow the client application to connect
Program.cs
Program.cs
Create React project
Terminal
- Configure the root component with the MantineProvider and Xams providers.
NextJs - _app.tsx
Create an Entity
- In the "Common" project create a new class file in the Entities folder and name it "Widget.cs"
Project.Common / Entities / Widget.cs
- Add the Widget class to the DataContext class.
Project.Data / DataContext.cs
- In the Project.Data directory execute the code below to create a migration and update the database.
Terminal
- Start the project
Create a Datatable
- Paste the following code in index.tsx
src / pages / index.tsx
This will create the following table.

If you click the "Add" button on the table, a form will open where a new record can be created.

Add Service Logic
We can have the service layer automatically set a price for the Widget based on the number of Widgets in the database.
- Create a new class file in the Project.Services/ServiceLogic folder. Name it "WidgetService.cs"
- Replace the class in the file with the code below.
Project.Services / ServiceLogic / WidgetService.cs
Create a Record
- Replace the code in index.tsx with the following.
src / pages / index.tsx
When the button is clicked, a Widget record will be created with the provided data.
Create a Form
- Replace the code in index.tsx with the following.
src / pages / index.tsx
This will create the below form:
