Create a Project on a Data Plane
Introduction
This guide will walk you through the steps for creating a project on a Data Plane in Private Hasura DDN. Before proceeding, you'll first need to be invited to a Data Plane.
Prerequisites
Install the DDN CLI
- macOS and Linux
- Windows
Simply run the installer script in your terminal:
curl -L https://graphql-engine-cdn.hasura.io/ddn/cli/v4/get.sh | bash
- Download the latest DDN CLI installer for Windows.
- Run the
DDN_CLI_Setup.exe
installer file and follow the instructions. This will only take a minute. - By default, the DDN CLI is installed under
C:\Users\{Username}\AppData\Local\Programs\DDN_CLI
- The DDN CLI is added to your
%PATH%
environment variable so that you can use theddn
command from your terminal.
Install Docker
The Docker based workflow helps you iterate and develop locally without deploying any changes to Hasura DDN, making the
development experience faster and your feedback loops shorter. You'll need Docker Compose v2.27.1
or later.
Validate the installation
You can verify that the DDN CLI is installed correctly by running:
ddn doctor
Step 1. Authenticate your CLI
ddn auth login
A browser window will open and prompt you for your login credentials. After successfully logging in, you'll be able to return to the CLI.
The DDN CLI will scaffold out all the necessary files and directories for your project.
Step 2. Scaffold out a new local project
ddn supergraph init my-project && cd my-project
Once you move into this directory, you'll see your project scaffolded out for you. You can view the structure by either running ls in your terminal, or by opening the directory in your preferred editor.
Step 3. Add a data source
The command below will launch a wizard via the DDN CLI which will assist you in adding a data connector. You can learn more about adding sources via data connectors here.
ddn connector init <connector_name> -i
This will provision the necessary files — using your configuration — for connecting a data source to your supergraph API.
You can also organize your API into subgraphs. Subgraphs are generally organized around team functions or business outcomes and allow for independent ownership and governance of data sources. Learn more here.
Step 4. Generate your metadata
ddn connector introspect <connector_name>
ddn model add <connector_name> '*'
ddn command add <connector_name> '*'
ddn relationship add <connector_name> '*'
You'll see metadata files generated for each entity in your data source. You can learn more here.
Step 5. Create a new local build
ddn supergraph build local
ddn run docker-start
ddn console --local
The development console will open wherein you can run your first query.
Step 6. Create a project on your Data Plane
You'll create a new project using the DDN CLI and by passing two flags: the data-plane-id
and the plan
.
You can find all the Data Planes you have access to on this page: https://console.hasura.io/data-plane
- ddn_free
- ddn_base
- ddn_advanced
Read more about plans here
ddn project init --data-plane-id <data-plane-id> --plan <plan-name>
The CLI will return information about your newly created project.
Step 7. Build and deploy your supergraph
ddn supergraph build create
When this process is complete, the CLI will return a link to the hosted API where you can run the same query as before.
Next steps
With your first project created, learn more about how Hasura handles data modeling before diving into advanced features.