2019-03-07 14:16:22 +01:00
# Quick Start Guide
2017-10-10 11:15:24 +02:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/nux0djdHmY8" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2019-02-06 19:16:54 +01:00
2019-03-07 14:16:22 +01:00
(A tutorial of this Quick Start guide can be found at [Quick Start Tutorial ](quick-start-tutorial.html ).)
2019-02-06 19:16:54 +01:00
2019-03-07 14:16:22 +01:00
___
2019-02-04 19:45:00 +01:00
2019-03-07 14:16:22 +01:00
## 1. Install Strapi globally
2017-10-10 11:15:24 +02:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/v-vCMD2YdRk" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2017-10-10 11:15:24 +02:00
2019-03-07 14:16:22 +01:00
(These steps continue after [Node.js and npm are properly installed ](install-requirements.html ).)
2017-10-10 11:15:24 +02:00
2017-10-12 16:33:09 +02:00
```bash
2019-03-07 14:16:22 +01:00
npm install strapi@alpha -g
2017-10-12 16:33:09 +02:00
```
2017-10-12 11:00:15 +02:00
2019-03-07 14:16:22 +01:00
Strapi is now installed globally on your computer.
2017-10-10 11:15:24 +02:00
2019-03-07 14:16:22 +01:00
Type `strapi -h` in your command line to access available Strapi commands.
2017-10-10 11:15:24 +02:00
2019-03-07 14:16:22 +01:00
## 2. Create a new project
2017-10-10 11:15:24 +02:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/ZlvI4RAsIJM" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
```bash
strapi new cms --quickstart
```
2019-02-11 14:27:07 +01:00
::: warning NOTE
2019-03-07 14:16:22 +01:00
Using the `--quickstart` flag will install Strapi using a [SQLite ](https://www.sqlite.org/index.html ) database. You may leave off the flag to follow the configuration steps for a different database.
2019-02-11 14:27:07 +01:00
:::
2019-03-07 14:16:22 +01:00
This will open your default browser to the Welcome page that creates an admin user.
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
## 3. Create an admin user
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/Nfn3osX-5C4" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
The first user you create is the root user for your project. This user has all privileges and access rights. You will need to fill in the form of the following fields:
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
- **Username**, create a username, eg. `paulbocuse`
- **Password**, create a unique password
- **Email address**, used for account recovery
- Check **Receive news** , this is optional, but recommended
- Click the **Ready to Start** button
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
## 4. Create a Content Type
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/p6klmrb1yPo" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
### The Restaurant Content Type
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
Navigate to **PLUGINS** --> **Content Type Builder** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
The Restaurant Content Type will have a **String** field and a **Text** field (with a **WYSIWYG editor** ).
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
1. Add a new **Content Type** :
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
- Click the ** "+ Add Content Type"** button.
- Enter the *singular* (never plural) "Name" for your **New Content Type** (eg. `restaurant` ), and below write a "description". (eg. `Recommended Restaurants` ).
- Click **Save** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
2. Add the **Name Content Type field** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
- Click ** "+ Add New Field"**
- Click the **String** field.
- Under the **BASE SETTINGS** tab, in the **Name** field, type `name` .
- Click the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field** .
- Click **Continue** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
3. Add the **Text Content Type Field** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
- Click ** "+ Add New Field"**
- Click the **Text** field.
- Under the **BASE SETTINGS** tab, in the **Name** field, type `description` .
- Click the **ADVANCED SETTINGS** tab, check **Display as a WYSIWYG** and **Unique field** .
- Click **Continue** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
4. Click the **Save** button and wait for Strapi to restart.
2019-02-11 14:27:07 +01:00
### The Category Content Type
2019-03-07 14:16:22 +01:00
Navigate to **PLUGINS** --> **Content Type Builder** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
The Category Content Type will have a **String** field and a **Relation field** with a **Many to Many** relationship.
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
1. Add a new **Content Type** :
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
- Click the ** "+ Add Content Type"** button.
- Enter the *singular* (never plural) "Name" for your **New Content Type** (eg. `category` ), and below write a "description". (eg. `Restaurant Categories` ).
- Click **Save** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
2. Add the **Name Content Type field** .
2019-02-07 21:36:01 +01:00
2019-03-07 14:16:22 +01:00
- Click ** "+ Add New Field"**
- Click the **String** field.
- Under the **BASE SETTINGS** tab, in the **Name** field, type `name` .
- Click the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field** .
- Click **Continue** .
2019-02-07 21:36:01 +01:00
2019-03-07 14:16:22 +01:00
3. Add the **Relation** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
- Click ** "+ Add New Field"**
- Click the **Relation** field.
- On the right, ensure **Restaurant** displays in the **Content Type Category** dropdown.
- Click the **Many to Many** icon (in the middle). It should now read, ** "Categories has and belongs to many Restaurants"**.
- Click **Continue** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
4. Click the **Save** button and wait for Strapi to restart.
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
## 5. Manage and add data to Content Type
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/0kQ_G91s5u8" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2019-02-11 14:27:07 +01:00
### Add data to Content Type
2019-03-07 14:16:22 +01:00
1. Create an entry of a restaurant called, ** "Strapi Restaurant"**:
2019-02-07 21:36:01 +01:00
2019-03-07 14:16:22 +01:00
- Click on **Restaurants** under the **CONTENT TYPES** menu.
- Click on ** + Add New Restaurant** button. Type `Strapi Restaurant` in the **Name** field. Type `Strapi restaurant is a cosy restaurant delivering one of the very fastest and nicest dining experiences in the world, combining nods to tradition with fierce modernity, warmth with daring.` into the **Description** field.
- Click **Save** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
You will see your restaurant listed in the entries.
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
2. Add the **Category items** to the **Categories Content Type** .
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
- Click **Categories** under the **CONTENT TYPES** menu on the left.
- Click ** + Add New Category** to add the category **Italian** .
- Type `Italian` into the **Name** field.
- Select **Strapi Restaurant** to assign this category. (See **Restaurants (0)** to the right.)
- Click **Save** .
- Click ** + Add New Category** to add the category **Contemporary** .
- Type `Contemporary` into the **Name** field.
- Select **Strapi Restaurant** to assign this category. (See **Restaurants (0)** to the right.)
- Click **Save** .
Both categories are listed on the **Category Content Type** page.
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
## 6. Set roles and permissions
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/wYWCqeQEP6M" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2019-02-11 14:27:07 +01:00
2019-03-07 14:16:22 +01:00
Give Public access to the Restaurant Content Type.
2019-02-07 21:36:01 +01:00
2019-03-07 14:16:22 +01:00
- Click the **Roles & Permission** menu item under **PLUGINS** on the left menu.
- Click the **pencil** edit icon to the right of the **Public** Role.
- Scroll down under **Permissions** , find **Restaurant** . Click the checkbox next to **find** . To the right, the URL route should say, `/restaurants` .
- Click **Save** .
2019-02-07 21:36:01 +01:00
2019-03-07 14:16:22 +01:00
## 7. Consume the Content Type API
2019-02-07 21:36:01 +01:00
2019-03-07 14:16:22 +01:00
< iframe width = "800" height = "450" src = "https://www.youtube.com/embed/9StcmcyBrd4" frameborder = "0" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen > < / iframe >
2019-02-07 21:36:01 +01:00
2019-03-07 14:16:22 +01:00
The **Restaurant Content Type** is accessible at `http://localhost:1337/restaurants` .
2019-02-11 14:27:07 +01:00
::: tip CONGRATULATIONS
2019-03-08 15:18:46 +01:00
👏 Congratulations, you have now completed the Strapi Quick Start. We invite you to [join the vibrant and active Strapi community ](/3.x.x/community.html ). Please continue reviewing our docs and tutorials to further learn how Strapi can solve your needs.
2019-02-11 14:27:07 +01:00
:::