Files
directus/docs/getting-started/quickstart.md
Bevis Halsey-Perry 0c54f5a9ef Introduce SnippetToggler and New SDK Reference (#19110)
* items semi complete

* updated items page to use snippet toggler and migrated endpoint docs to use it

* updated files page to use snippet toggler and migrated REST and GraphQL endpoint docs to it

* updated activity page to use snippet toggler and migrated REST and GraphQL endpoint doc to it

* updated collections page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* updated dashboards page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated extensions page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated fields page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated flows page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated folders page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated notifications page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated operations page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated panels page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated permissions page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated presets page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated relations page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated revisions page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated roles page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Made headlines consistant with the rest of the doc pages

* Updated server page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated settings page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated shares page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated translations page to use snippet togglers and migrated REST endpoint docs to them

* Updated users page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated utilities page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated webhooks page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated authentication page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* Updated Global Parameters page to use snippet togglers where there are adjacent REST and GraphQL Examples

* Added SDK code snippets to items page and made generic variables consistant

* Added SDK code snippets to files  page and made generic variables consistant

* Few lang changes for files page

* Added SDK code snippets to activity page and made generic variables consistant

* Added SDK code snippets to collections page and made generic variables consistant

* Added SDK code snippets to dashboards page and made generic variables consistant

* removed query word from query parameter objects

* Added SDK code snippets to fields page and made generic variables consistant

* SnippetToggler border

* Used dynamic border color for snippettoggler heading

* Spacing top and bottom of snippet toggler in docs

* Removed extra HRs

* Remove manual TOC in query reference

* Small code styling change in items page

* Updated users page to use snippet togglers and migrated REST and GraphQL endpoint docs to them

* dashboards fixed up property names

* Small copy update on extensions page

* Updated keys in delete mult notifications REST

* Updated keys in operations

* Update keys in panel delete many

* Update keys in permissions

* Added quotes around generic example ID strings

* Added code formatting to final example in share public info

* Format files

* Refined sidebar

* Insert newline before ending template tags

* Fixed extra closing tags, causing an error, un users ref

* Text Formatting Users

* Put GQL related notes inside toggler

* Added SDK code snippets to flows page and made generic variables consistant

* Added SDK code snippets to folder page and made generic variables consistant

* fixing whitepsace for flows and folders page

* Consistent newlines in SnippetToggler usages

* Run prettier

* Fix 'alwaysDark' definition

* Home page snippet toggler style fixes

* Fix snippet toggler lang hover color in light mode

* Introduce different code theme for light mode

* Added SDK code snippets to notifications page and made generic variables consistant

* Switch to 'material-theme-lighter'

* Format file

* Fix tip

* Fix tip in sdk ref

* Consistent spacing for custom containers

* Added SDK code snippets to operations page and made generic variables consistant

* Lint & format code blocks

* Lint & format operations

* Added SDK code snippets to panels page and made generic variables consistant

* Added SDK code snippets to permissions page and made generic variables consistant

* Added SDK code snippets to presets page and made generic variables consistant

* Added SDK code snippets to relations page and made generic variables consistant

* Added SDK code snippets to revisions page and made generic variables consistant

* Added SDK code snippets to roles page and made generic variables consistant

* Added SDK code snippets to server page and made generic variables consistant

* Added SDK code snippets to settings page and made generic variables consistant

* app_url -> directus_project_url

* Omitted auth details in delete multiple files

* Added quotes to values in roles

* Upload a file snippets

* Pluralization for upload/import files

* More files functions typos

* Added SDK code snippets to shares page (still missing createShare(s) as endpoint not functioning currently) and made generic variables consistant

* Added SDK code snippets to translations page (missing delete endponts because not working) and made generic variables consistant

* Added SDK code snippets to users page and made generic variables consistant

* Added SDK code snippets to webhooks page and made generic variables consistant

* Added SDK code snippets to utilites page (except cleaning cache, will be tested and added in later commit) and made generic variables consistant

* Added SDK code snippets to auth page (not login, refresh, and logout though due to errors)

* Added SDK code snippets for utilsExport and clearCache

* added github username be7DOTis to contributors

* Omit auth commands in updateComment

* utilsImport

* rename app_url generic value

* changed instances of updated*operation* to update*Operation*

* missed some 'updated' changse

* Added SDK Snippets to Query Parameters page

* Add section on file security

* added create(s)Shares SDK snippet to shares page

* added console.log to create snippets

* Added delete(s)Webhook SDK snippet to webhooks page

* Added SDK snippets to extensions page

* Added create/updateSingleton section to items page

* Links in files security

* Added SDK Snippets to Schema page

* Added GQL Generic examples to snippet togglers and removed snippet toggler from Login Using SSO Providers

* Added create(s)Presets SDK Snippets to presets page

* replaced fields query in generics snippets for a more generic

* replaced fields query in generics snippets for a more generic

* Use storage value only if valid choice

* Sync snippet togglers across page

* Update docs/reference/system/activity.md

* Update docs/reference/system/activity.md

* Update docs/reference/system/extensions.md

* Update docs/reference/system/revisions.md

* Update docs/reference/system/settings.md

* Update docs/reference/system/revisions.md

* Update docs/reference/system/settings.md

* Update docs/reference/system/activity.md

* Update docs/reference/system/roles.md

* Update docs/reference/system/roles.md

* Update docs/reference/system/roles.md

* Update docs/reference/system/roles.md

* Update docs/reference/system/schema.md

* Update docs/reference/system/server.md

* Update docs/reference/system/shares.md

* Replace all directus_project_url placeholders

* Revert "Sync snippet togglers across page"

This reverts commit 8b36f0d778.

* Update docs/reference/system/shares.md

* Update docs/reference/system/webhooks.md

* Clarify singleton section

* Consistent newlines between SnippetToggler templates

* Format files

* Remove console.log(result) statements from snippet

* Add examples for shares & users

Co-authored-by: Brainslug <tim@brainslug.nl>

* Fix hash GraphQL example

* Clarify update singleton section

* Add auth examples

Co-authored-by: Brainslug <tim@brainslug.nl>

* Final run on consistent newlines between SnippetToggler

* Switch to github themes

* The "Last One"

Co-authored-by: Brainslug <tim@brainslug.nl>

* The "Big One"

* Fix dead links

---------

Co-authored-by: Bevis Halsey-Perry <hi@be7.is>
Co-authored-by: Kevin Lewis <kvn@lws.io>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
2023-07-25 17:30:37 -04:00

7.2 KiB

description, readTime
description readTime
Get up and running with Directus Cloud in minutes. Learn the basics of building your data model and managing permissions. 7 min read

Quickstart Guide

This quickstart guide is designed to get you up and running with a Directus Project in a snap. Along the way, you will better understand what Directus is, setup your Directus Cloud Account, get a hands-on introduction to the App and API, and find more resources to deep-dive into.

This guide primarily focuses on getting started with Directus Cloud. If you prefer self-hosting, we offer a guide to assist you in that process.

1. Create a Cloud Account and Login

First, you'll need to create an Account and log in on Directus Cloud.

Your Directus Cloud Account allows you to create and manage any number of Projects. We've made life easier by giving you the option to create and log in to your Cloud Account automatically with GitHub. If you don't have a GitHub account or prefer not to use this login method, email-and-password login is available as well.

The very first time you log in to your Cloud Account, you will be prompted to create a Team. Each Directus Cloud Project exists within the scope of one Team. They allow you to organize Team Members, Projects and Project Billing as desired.

Once your Team is created, it's time to create your Directus Cloud Project!

2. Create and Access Project

To create a Project, follow the steps below:

  1. Open the Team Menu in the Dashboard Header and select or create the desired Team.
  2. Navigate to "Projects" and click "Create Project".
  3. Set the Project Name and tier.
  4. Scroll to the bottom of the screen and choose the "Empty Project" Starting Template.
    Note: The "Demo Project" adds in dummy data for in-depth feature demonstrations.
  5. Click "Create Project".

It should take around 90 seconds for the Cloud Project to build out. During this time, a link will be sent to the email associated with your Cloud Account. The email will contain your Project URL as well as an email and password to login. If you used GitHub to create your account, this will be your GitHub email. Once the build is complete, it's time log in!

  1. You can access a Project from within the Cloud Dashboard or type the URL into your browser.
  2. Log in with your username and password from the email.

::: tip Check All Inbox Folders

Due to the algorithms used by some email providers, it is possible the email containing your Project login information will end up in another folder like "Social" or "Promotions".

:::

3. Create a Collection

Once logged in, you're greeted with the option to create your first Collection.

  1. Navigate into the Content Module.
  2. Click "Create Collection" and a side menu will appear.
  3. Fill in a Name.
    For the sake of this demo, we'll call ours articles, but feel free to make it your own!
  4. Leave the other options at default. Click arrow_forward and the "Optional System Fields" menu will open.
    Keep the values in this menu at the default, toggled off, for now. You can adjust them later.
  5. Click check in the menu header.

::: tip Learn More About Collections

:::

4. Create a Field

With your first Collection created, it's time to start adding some Fields.

  1. Navigate to Settings Module > Data Model > Collection-Name.
  2. Click the "Create Field" button and select the "Input" Field type.
  3. Fill in a Field name under Key. We'll be calling our Field title.
    Directus offers powerful Field customization options, but let's stick to the defaults for now.
  4. Select "Save".

::: tip Learn More About Fields

:::

5. Create an Item

Now that we have a Collection with a Field configured, it's time to add an Item.

  1. Navigate to the Content Module.
  2. Click add in the page header to open the Item Page.
  3. Fill in the Field Value(s) as desired.
  4. Click check in the top-right to save your Item.

::: tip Learn More About Items

:::

6. Set Roles & Permissions

Directus comes with two built-in roles: Public and Admin. The Public Role determines what data is returned to non-authenticated users. Public comes with all permissions turned off and can be reconfigured with fully granular control to expose exactly what you want unauthenticated Users to see. The Admin role has full permissions and this cannot be changed. Aside from these built-in Roles, any number of new Roles can be created, all with fully customized, granular permissions.

By Default, content entered into Directus will be considered private. So permissions always start off set to the default of block No Access, with full ability to reconfigure as desired. So, in order to have the API return our Items, let's add some read permissions. For simplicity's sake, we'll do this on the Public Role, instead of creating a new Role.

  1. Navigate to Settings Module > Roles & Permissions > Public.
  2. Click block under the visibility icon on the desired Collection.
    In our case, the Collection name is articles.
  3. Click "All Access" to give the Public Role full read permissions to the Items in this Collection.

::: tip Learn More About Roles & Permissions

:::

7. Connect to the API

Now that your Project has some content in it which is exposed to the Public, it's time to start using this content externally! Data can be accessed in a number of ways, including the REST and GraphQL API endpoints. In this case, we'll use the /items/ REST API endpoint to retrieve the Item we just created.

  1. Open http://your-project-url.directus.app/items/articles.
    You can use the browser or an API tool like Postman or Paw

And there it is! The Article Item you just created is being served in beautiful JSON, ready to be used anywhere and everywhere!

{
	"data": [
		{
			"id": 1,
			"title": "Hello World!"
		}
	]
}

In this example, we made a super-simple read request with the API, but there's more! The REST and GraphQL APIs provide exhaustive endpoints for the data model and every single action that you can do in the App can be done via the API. In fact, the App is just a GUI powered by the API.

::: tip Learn More About The API

:::