Quick Start Guide

Get ready to get Strapi up and running in less than 3 minutes 🚀.

For a step-by-step guide, please take a look at the following steps. This quickstart is really close to the FoodAdvisor Quick Start Guide - 图1 (opens new window) application.

(Before continuing, please make sure Node.js and npm are properly installed on your machine. You can install the Yarn v1.2.0+ package here Quick Start Guide - 图2 (opens new window).)

WARNING

In the 3.1.5 the Roles & Permissions section has been migrated into the Settings section.

1. Install Strapi and Create a new project

  1. yarn create strapi-app my-project --quickstart
  1. npx create-strapi-app my-project --quickstart

2. Create an Administrator user

Navigate to http://localhost:1337/admin Quick Start Guide - 图3 (opens new window).

Complete the form to create the first Administrator user.

3. Create a Restaurant Content Type

Navigate to PLUGINS - Content Type Builder Quick Start Guide - 图4 (opens new window), in the left-hand menu.

  • Click the “+ Create new collection type” link
  • Type restaurant, and click Continue
  • Click the Text field
  • Type name in the Name field
  • Click over to the ADVANCED SETTINGS tab, and check the Required field and the Unique field
  • Click the “+ Add another Field” button
  • Click the Rich Text field
  • Type description under the BASE SETTINGS tab, in the Name field
  • Click Finish
  • Click the Save button and wait for Strapi to restart

4. Create a Category Content type

Navigate back to PLUGINS - Content Type Builder Quick Start Guide - 图5 (opens new window), in the left-hand menu.

  • Click the “+ Create new collection type” link
  • Type category, and click Continue
  • Click the Text field
  • Type name under the BASE SETTINGS tab, in the Name field
  • Click over to the ADVANCED SETTINGS tab, and check the Required field and the Unique field
  • Click the “+ Add another field” button
  • Click the Relation field
  • On the right side, click the Category dropdown and select, Restaurant
  • In the center, select the icon that represents many-to-many. The text should read, Categories has and belongs to many Restaurants
  • Click Finish
  • Click the Save button and wait for Strapi to restart

5. Add content to “Restaurant” Content Type

Navigate to COLLECTION TYPES - Restaurants Quick Start Guide - 图6 (opens new window), in the left-hand menu.

  • Click on + Add New Restaurants button. Type Biscotte Restaurant in the Name field. Type Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers. into the Description field.
  • Click Save.

If you navigate back COLLECTION TYPES - Restaurants Quick Start Guide - 图7 (opens new window), you will see your restaurant listed in the entries.

6. Add categories to the “Category” Content Type

Navigate to COLLECTION TYPES - Categories Quick Start Guide - 图8 (opens new window).

  • Click on + Add New Categories button. Type French Food in the Name field. Select Biscotte Restaurant, on the right in the Restaurant (0) dropdown.
  • Click Save.

Navigate back to COLLECTION TYPES - Categories Quick Start Guide - 图9 (opens new window). You will see the French Food category listed in the entries.

  • Click on + Add New Categories button. Type Brunch in the Category field. DO NOT ADD Biscotte Restaurant to the Restaurants dropdown on the right.
  • Click Save.

You will see the Brunch category listed in the entries.

Navigate back to COLLECTION TYPES - Restaurants Quick Start Guide - 图10 (opens new window).

  • Click on Biscotte Restaurant.
  • On the right, under Categories(1), select the Add an item..., and add Brunch as a category for this restaurant, and click the Save button.

You have now seen two different ways to use the relation field type to add and connect relations between Content Types.

7. Set Roles and Permissions

Navigate to GENERAL > Settings > USERS & PERMISSIONS PLUGIN > Roles Quick Start Guide - 图11 (opens new window).

  • Click the Public Role.
  • Scroll down under Permissions, open the Application tab and find Restaurant. Click the checkbox next to find and findone.
  • Repeat and find Category. Click the checkbox next to find and findone.
  • Click Save.

8. Publish the content

By default, any content you create is saved as a draft. To publish your content:

Navigate back to COLLECTION TYPES - Categories Quick Start Guide - 图12 (opens new window)

  • Click the Draft button on the Brunch category.
  • Click Publish button.
  • In the Please confirm dialog, click Yes, publish button.
  • Repeat for the French food category and Biscotte Restaurant.

9. Consume the Content Type’s API

Here we are! The list of restaurants is accessible at http://localhost:1337/restaurants Quick Start Guide - 图13 (opens new window).

CONGRATULATIONS

👏 Congratulations, you have now completed the Strapi Quick Start. Where to go next?

Consume your API using one of these technologies:

[Quick Start Guide - 图24

React

Consume your API with React

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/react.html)

[Quick Start Guide - 图25

Vue.js

Consume your API with Vue.js

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/vue-js.html)

[Quick Start Guide - 图26

Angular

Consume your API with Angular

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/angular.html)

[Quick Start Guide - 图27

Next.js

Consume your API with Next.js

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/next-js.html)

[Quick Start Guide - 图28

Nuxt.js

Consume your API with Nuxt.js

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js.html)

[Quick Start Guide - 图29

GraphQL

Get started with GraphQL

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/graphql.html)

[Quick Start Guide - 图30

Gatsby

Consume your API with Gatsby

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/gatsby.html)

[Quick Start Guide - 图31

Gridsome

Consume your API with Gridsome

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/gridsome.html)

[Quick Start Guide - 图32

Jekyll

Consume your API with Jekyll

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/jekyll.html)

[Quick Start Guide - 图33

11ty

Consume your API with 11ty

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/11ty.html)

[Quick Start Guide - 图34

Svelte

Consume your API with Svelte

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/svelte.html)

[Quick Start Guide - 图35

Sapper

Consume your API with Sapper

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/sapper.html)

[Quick Start Guide - 图36

Ruby

Consume your API with Ruby

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/ruby.html)

[Quick Start Guide - 图37

Python

Consume your API with Python

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/python.html)

[Quick Start Guide - 图38

Dart

Consume your API with Dart

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/dart.html)

[Quick Start Guide - 图39

Flutter

Consume your API with Flutter

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/flutter.html)

[Quick Start Guide - 图40

Go

Consume your API with Go

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/go.html)

[Quick Start Guide - 图41

PHP

Consume your API with PHP

](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/integrations/php.html)