I made the changes. Changed images, etc.

This commit is contained in:
davidkartuzinski 2019-03-07 14:16:22 +01:00
parent d86a627d95
commit fdce979c31
97 changed files with 557 additions and 738 deletions

View File

@ -2,7 +2,7 @@ const container = require('markdown-it-container');
const ogprefix = 'og: http://ogp.me/ns#';
const title = 'Strapi Documentation';
const description = 'API creation made simple, secure and fast.';
const description = 'The headless CMS developers love.';
const color = '#2F80ED';
const author = 'Strapi';
const url = 'https://strapi.io/documentation/';
@ -69,16 +69,12 @@ module.exports = {
collapsable: false,
title: '🚀 Getting started',
children: [
'/3.x.x/getting-started/introduction',
'/3.x.x/getting-started/install-requirements',
'/3.x.x/getting-started/quick-start',
'/3.x.x/getting-started/community',
'/3.x.x/getting-started/quick-start-tutorial',
],
},
{
collapsable: true,
title: 'Installation Options',
children: ['/3.x.x/installation-options/quick-start-detailed.md'],
},
{
collapsable: true,
title: '💡 Guides',
@ -148,6 +144,7 @@ module.exports = {
],
'/3.x.x/migration-guide/',
'/3.x.x/tutorials/',
'/3.x.x/community',
],
},
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 KiB

View File

@ -4,7 +4,7 @@ We have a vibrant and active community. You can get help, contribute and stay in
## The Official Strapi Blog
You can disover our articles and news on the [Strapi Blog](https://blog.strapi.io/).
You can discover our articles and news on the [Official Strapi Blog](https://blog.strapi.io/).
## GitHub
@ -14,7 +14,7 @@ Our contribution guidelines and code of conduct can be located at [Strapi GitHub
## Slack
The best way to participate in the community apart from GitHub is through Slack. Join out [official Strapi Slack Group](https://slack.strapi.io/).
The best way to participate in the community, apart from GitHub, is through Slack. Join out [official Strapi Slack Group](https://slack.strapi.io/).
## Twitter
@ -22,4 +22,4 @@ A popular way for you to discover news, releases and information about Strapi is
## Medium
Very often we publish content from our [Strapi Official Blog](https://blog.strapi.io/) also on Medium. This is convenient for our users with Medium accounts. Follow us on the [Official Strapi Medium page](https://medium.com/@strapi).
Very often we publish content from our [blog](https://blog.strapi.io/) to our [Official Strapi Medium page](https://medium.com/@strapi). This is convenient for our users with Medium accounts.

View File

@ -1,197 +1,124 @@
# Installation Requirements
### 👋 Welcome onboard!
Welcome to the open source [headless CMS](https://strapi.io) developers love. Our users love Strapi because it is open source, MIT licensed, fully customizable and based on nodejs. Strapi lets you manage your content and distribute it anywhere.
This page covers installing the [basic installation requirements for Strapi](#basic-installation-requirements).
(After you install these requirements, the [Quick Start](/3.x.x/getting-started/quick-start.html) guide will walk you through how to: [create a project](quick-start.html#_1-create-a-project), [create an admin user](quick-start.html#_2-create-an-admin-user), [create a content type](quick-start.html#_3-create-a-content-type), [manage and add data to content type](quick-start.html#_4-manage-and-add-data-to-content-type), [set roles and permissions](quick-start.html#_5-set-roles-and-permissions) and [consume the content type API](quick-start.html#_6-consume-the-content-type-api).)
This page covers installing the basic installation requirements for Strapi.
## Basic Installation Requirements
Strapi requires just two basic installation steps:
Strapi requires just installing [Node.js](https://nodejs.org). We recommend using version 10.x or later.
1. Install [Node.js](https://nodejs.org). We recommend using version 10.x or later.
2. Install [Strapi](https://strapi.io). Install the latest version of Strapi.
This is all that is needed before Strapi can get up and running on your development environment.
These two requirements are all that is needed to get Strapi up and running on your development environment.
## Install Node.js (and npm)
## Install Node (and NPM)
Strapi needs Nodejs and NPM installed. NPM installs at the same time as Nodejs. You can following the below instructions to install Nodejs on Windows 10, Ubuntu 18.04 and Mac O/S Mojave.
Strapi needs Node.js and npm installed. npm installs at the same time as Node.js. You can following the below instructions to install Node.js on Windows 10, Ubuntu 18.04 and Mac O/S Mojave.
#### Installation Instructions for each Operating System:
::: windows
**WINDOWS 10**
### Install Node.js (and NPM) on Windows 10
### Install Node.js (and npm) on Windows 10
There are several methods to install Nodejs on _Windows 10_.
There are several methods to install Node.js on _Windows 10_.
We will follow the most common download and installation procedure. These _instructions are for Windows 10_. (If you are installing on a different version of Windows or if you have trouble following these instructions, please review the [official Nodejs documentation](https://nodejs.org/en/docs/).)
We will follow the most common download and installation procedure. These _instructions are for Windows 10_. (If you are installing on a different version of Windows or if you have trouble following these instructions, please review the [official Node.js documentation](https://nodejs.org/en/docs/).)
1. Download the Windows Installer from the [downloads page](https://nodejs.org/en/download/). You will need to choose the 32-bit or 64-bit version. We recommend the LTS (long-term support) version of Nodejs.
2. Double-click the node-v10.x.x-x86.msi file icon. Click "Next" for the default options and to install Nodejs under the recommended and most common settings. After clicking "Next" several times, click "Install" to install nodejs. When it is done installing, click "Finish".
3. Verify both Nodejs and NPM have installed correctly. Open your Command Prompt:
2. Double-click the node-v10.x.x-x86.msi file icon. Click "Next" for the default options and to install Nodejs under the recommended and most common settings. After clicking "Next" several times, click "Install" to install node.js. When it is done installing, click "Finish".
3. Verify both Node.js and npm have installed correctly. Open your Command Prompt:
- Click your Start Button
- In Search type, "cmd"
- Then click on "Command Prompt".
- Type the following commands in your Command Prompt
Verify Nodejs has correctly installed:
Verify Node.js has correctly installed:
```shell
$ node -v
node -v
## You should see "v10.x.x
```
Next, verify NPM has correctly installed:
Next, verify npm has correctly installed:
```shell
$ npm -v
npm -v
## You should see "6.x.x"
```
All done. Next you need to [install Strapi globally](#install-strapi-globally).
:::
::: mac
**MAC O/S 10.14 MOJAVE**
### Install Node.js (and NPM) on Mac O/S X (Mojave)
### Install Node.js (and npm) on Mac O/S X (Mojave)
There are multiple methods to install Nodejs on _Mac O/S X (Mojave)_.
There are multiple methods to install Node.js on _Mac O/S X (Mojave)_.
We will follow the most common download and installation procedure. _These instructions are for Mac O/S X (Mojave)_. (If you are installing on a different version of Mac O/S or if you have trouble following these instructions, please review the [official Nodejs documentation](https://nodejs.org/en/docs/).)
1. Download the Mac O/S Installer from the [downloads page](https://nodejs.org/en/download/). We recommend the LTS (long-term support) version of Nodejs.
2. Launch the node-v10.x.x.pkg file icon. Click "Continue" for the default options and to install Nodejs under the recommended and most common settings. After clicking "Continue" several times, click "Install" to install nodejs. When it is done installing, click "Close".
3. Verify both Nodejs and NPM have installed correctly. Open your terminal prompt:
2. Launch the node-v10.x.x.pkg file icon. Click "Continue" for the default options and to install Nodejs under the recommended and most common settings. After clicking "Continue" several times, click "Install" to install node.js. When it is done installing, click "Close".
3. Verify both Node.js and npm have installed correctly. Open your terminal prompt:
- Open you Applications folder
- FInd and open the Utilities folder
- Find and open the Utilities folder
- Find "Terminal" and click on it to open it.
- Type the following commands in your Terminal
Verify Nodejs has correctly installed:
Verify Node.js has correctly installed:
```terminal
$ node -v
node -v
## You should see "v10.x.x"
```
Next, verify NPM has correctly installed:
Next, verify npm has correctly installed:
```terminal
$ npm -v
npm -v
## You should see "6.x.x"
```
All done. Next you need to [install Strapi globally](#install-strapi-globally).
:::
::: ubuntu
**UBUNTU 18.04**
### Install Node.js (and NPM) on Ubuntu 18.04
### Install Node.js (and npm) on Ubuntu 18.04
There are multiple methods to install Nodejs on _Ubuntu 18.04_.
There are multiple methods to install Node.js on _Ubuntu 18.04_.
We will follow the most common download and installation procedure. _These instructions are for Ubuntu 18.04_. (If you are installing on a different version of Ubuntu or a different Linux Distro or if you have trouble following these instructions, please review the [official Nodejs documentation](https://nodejs.org/en/docs/).)
1. Install cURL and use cURL to download the nodejs (and NPM) source code
1. Install cURL and use cURL to download the nodejs (and npm) source code
```bash
$ sudo apt-get install curl
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
```
2. Install nodejs (and NPM)
2. Install node.js (and npm)
```bash
$ sudo apt-get install -y nodejs
sudo apt-get install -y nodejs
```
Verify Nodejs has correctly installed:
Verify Node.js has correctly installed:
```bash
$ node -v
node -v
## You should see "v10.x.x"
```
Next, verify NPM has correctly installed:
Next, verify npm has correctly installed:
```bash
$ npm -v
npm -v
## You should see "6.x.x"
```
All done. Next you need to [install Strapi globally](#install-strapi-globally).
:::
## Install Strapi globally
Time to install Strapi!
We will now install Strapi. Strapi installs with one command. The command is the same for Windows, Mac or Ubuntu.
::: danger WARNING
Strapi must be installed globally, using the "-g" flag.
:::
```bash
$ npm install strapi@alpha -g
```
::: warning NOTE
If you encounter npm permissions issues, [change the permissions to npm default directory](https://docs.npmjs.com/getting-started/fixing-npm-permissions#option-1-change-the-permission-to-npms-default-directory).
:::
(Installation takes about 20 seconds with a good Internet connection. Take a coffee ☕️ break if your internet is slow.)
### Check installation
Once completed, verify Strapi is correctly installed, type:
```bash
$ strapi -v
## You should see "3.0.0-alpha.x"
```
Strapi is now installed globally on your computer. Type `strapi -h` in your command line to access available Strapi commands.
```bash
$ strapi -h
## You will get the following available commands
Usage: strapi [options] [command]
Options:
-v, --version output the version number
-h, --help output usage information
Commands:
version output your version of Strapi
console open the Strapi framework console
new [options] create a new application
start [appPath] start your Strapi application
generate:api [options] <id> [attributes...] generate a basic API
generate:controller [options] <id> generate a controller for an API
generate:model [options] <id> [attributes...] generate a model for an API
generate:policy [options] <id> generate a policy for an API
generate:service [options] <id> generate a service for an API
generate:plugin [options] <id> generate a basic plugin
install [options] <plugin> install a Strapi plugin
uninstall <plugin> uninstall a Strapi plugin
help output the help
*
```
Are you having trouble during the [basic installation requirements](/3.x.x/getting-started/install-requirements.html#basic-installation-requirements) steps? Please check to see if someone has already had the [same issue](https://github.com/strapi/strapi/issues). If not, please [submit an issue](https://github.com/strapi/strapi/issues/new).
---
::: tip NEXT STEPS
👏 Congrats, you are all set! Now that Strapi is installed you can proceed to the [Quick start](/3.x.x/getting-started/quick-start.html) and [create a project](quick-start.md#_1-create-a-project).
👏 Congrats, you are all set! Now that Node.js is installed you can proceed to the [Quick start](/3.x.x/getting-started/quick-start.html).
:::

View File

@ -0,0 +1,20 @@
# Introduction
Welcome to the open source [headless CMS](https://strapi.io) developers love.
## Strapi Documentation
### 👋 Welcome onboard!
Users love Strapi because it is open source, MIT licensed, fully customizable and based on Node.js. Strapi lets you manage your content and distribute it anywhere. Strapi allows you to securely and privately serve your database of choice from your hosting and server of choice.
### Get Started
You are invited to get started using Strapi. You may explore Strapi by:
1. A [Quick Start Guide](../getting-started/quick-start.html) for more intermediate to advanced developers.
2. A [Tutorial](../getting-started/quick-start-tutorial.html) for those who prefer a step-by-step introduction.
When you're done getting started, we invite you to join our [community](../community.html).

View File

@ -0,0 +1,397 @@
# Tutorial
This Tutorial is written for developers who prefer a more detailed step-by-step introduction. (A less detailed introduction can be found at [Quick Start Guide](/3.x.x/getting-started/quick-start.html).)
<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>
By following this tutorial, we will get Strapi installed globally onto your system, and then create your first Strapi project.
::: warning NOTE
You need to have ***Node.js and npm*** installed on your system prior to following these steps. If you do not have Node.js and npm installed or are not sure, please visit our [Installation Requirements](http://localhost:8080/documentation/3.x.x/getting-started/install-requirements.html).
:::
**Table of contents:**
1. [Install Strapi globally](#_1-install-strapi-globally)
2. [Create a new project](#_2-create-a-new-project)
3. [Create an admin user](#_3-create-an-admin-user)
4. [Create a Content Type](#_4-create-a-content-type)
5. [Manage and add data to Content Type](#_5-manage-and-add-data-to-content-type)
6. [Set roles and permissions](#_6-set-roles-and-permissions)
7. [Consume the Content Type API](#_7-consume-the-content-type-api)
## 1. Install Strapi globally
```bash
npm install strapi@alpha -g
```
Strapi is now installed globally on your computer. Type `strapi -h` in your command line to access available Strapi commands.
```bash
strapi -h
## You will get the following available commands
Usage: strapi [options] [command]
Options:
-v, --version output the version number
-h, --help output usage information
Commands:
version output your version of Strapi
console open the Strapi framework console
new [options] create a new application
start [appPath] start your Strapi application
generate:api [options] <id> [attributes...] generate a basic API
generate:controller [options] <id> generate a controller for an API
generate:model [options] <id> [attributes...] generate a model for an API
generate:policy [options] <id> generate a policy for an API
generate:service [options] <id> generate a service for an API
generate:plugin [options] <id> generate a basic plugin
install [options] <plugin> install a Strapi plugin
uninstall <plugin> uninstall a Strapi plugin
help output the help
*
```
## 2. Create a new project
Navigate to your parent `Projects/` directory in your command line. Enter the following command to create a Strapi Quick Start project.
Path: `~/Desktop/Projects/ $`
```bash
strapi new cms --quickstart
```
The command will automatically create a Strapi project `cms` folder within your parent `Projects/` directory.
::: warning NOTE
When you create a new Quick Start project in Strapi, you will download all the node modules, the Strapi files necessary and the Strapi plugin files. THIS STEP CAN TAKE SEVERAL MINUTES DEPENDING ON YOUR INTERNET CONNECTION SPEED. Please wait for the process to complete before cancelling or trying to continue.
:::
::: warning NOTE
You can replace the `/cms` project name with any name you want.
:::
You will see something like this:
```bash
🚀 Start creating your Strapi application. It might take a minute, please take a coffee ☕️
⏳ Testing database connection...
The app has been connected to the database successfully!
🏗 Application generation:
✔ Copy dashboard
✔ Install plugin settings-manager.
✔ Install plugin content-type-builder.
✔ Install plugin content-manager.
✔ Install plugin users-permissions.
✔ Install plugin email.
✔ Install plugin upload.
✔ Link strapi dependency to the project.
👌 Your new application cms is ready at /home/str/Desktop/Strapi/Projects/cms
⚡️ Change directory:
$ cd cms
⚡️ Start application:
$ strapi start
```
This will open your default browser to the Welcome page for creating an admin user.
![Strapi Welcome Page for creating admin user](../assets/quick-start-detailed/strapi-welcome-screen.png 'Strapi Welcome Page for creating admin user')
::: warning NOTE
Using the `--quickstart` flag will install Strapi using a [SQLite](https://www.sqlite.org/index.html) database. You may leave off the flag, but will need to follow the configuration steps for a different database.
:::
## 3. Create an admin user
The first user you create is the root user for your project. This user has all privileges and access rights. You will need to complete the following fields:
1. **Username**, create a username for login access to your project, eg. `paulbocuse`
2. **Password**, create a unique password for your project
3. **Email address**, this will be used for recovery
4. Check **Receive news**, this is optional but recommended
5. Click the **Ready to Start** button
![Example completed Welcome Screen with Admin User information](../assets/quick-start-detailed/welcome-screen-entered-information.png 'Example completed Welcome Screen with Admin User information')
---
After your admin user is registered, you will see the Strapi admin panel:
![Strapi Admin Panel](../assets/quick-start-detailed/AfterRegistrationScreenAdminPanel.png 'Strapi Admin Panel')
---
Every user is found by clicking in the left menu: **CONTENT TYPES** --> **Users**.
From here you can add and edit users.
![Strapi Users Page](../assets/quick-start-detailed/AdminUserInUsers.png 'Strapi Users Page')
## 4. Create a Content Type
At this point, your project is empty. You need to create a **Content Type**.
We can define a **Content Type** as a collection of entered data represented by fields. For example, a **Content Type** called `restaurant` may be intended to display information regarding restaurants. A `restaurant` has a `name`, a main `image`, a `description`, maybe even a link to the `restaurant menu`.
Another example, is a **Content Type** called `menu` which is made up of `menu items`. These have a `name`, `description of the menu item`, an `image` and perhaps even a `list of ingredients`.
Any collection of entered data that can have fields can be a **Content Type**. They allow you to manage a class of information in an organized manner.
We will use the **Content Type Builder** plugin to make the process easy to create a **Content Type**.
Go to the **Content Type Builder** plugin, located in the left menu: **PLUGINS** --> **Content Type Builder**.
We will create two content types. We will create a content type called `Restaurant` and one called `Category`.
![Create Content Type Screen](../assets/quick-start-detailed/CreateContentTypeScreen.png 'Create Content Type Screen')
::: warning NOTE
Content Type `name` is always **singular**. For example, `restaurant` not `restaurants`. For example, `category` not `categories`.
:::
### The Restaurant Content Type
The Restaurant Content Type will have a **String** field for the restaurant name, and a **Text** field (with a **WYSIWYG editor**) for the restaurant description.
1. Let's now add a content type.
Click the **"+ Add Content Type"** button.
Now enter a "Name" for your **New Content Type** (we will call this one `restaurant`), and below write a "description". We will write `Recommended Restaurants` for the description.
Then click the **Save** button.
![Restaurant Name and Descriptions](../assets/quick-start-detailed/RestaurantNameAndDescription.png 'Restaurant Name and Descriptions')
2. Now you are ready to add the content type fields. We will add a **String** field for the Name and a **Text** field for a short Restaurant description. Click on the **+ Add New Field** button.
![Add Restaurant Fields](../assets/quick-start-detailed/restaurantAddFields.png 'Add Restaurant Fields')
Next we will click on the **String** field.
![String Field](../assets/quick-start-detailed/restaurantStringAndText.png 'String Fields')
You should be under the **BASE SETTINGS** tab, in the **Name** field, type `Name`. This will be the name of the restaurant.
![Input Restaurant Name Field](../assets/quick-start-detailed/saveRestaurantNameField.png 'Input Restaurant Name Field')
Now, click on the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field**. This field is required for each restaurant and is not optional. Also, we want each restaurant to have a unique name, so we check the **Unique field** box. And then click the **Continue** button.
![Advanced Settings String Field](../assets/quick-start-detailed/restaurantAdvancedSettingsStringField.png 'Advanced Settings String Field')
We are now ready to add the second field, **Text** for the restaurant description. Click the **+ Add New Field** button.
![Add new restaurant field](../assets/quick-start-detailed/restaurantAddNewField.png 'Add new restaurant field')
From here, click the **Text** field.
![Text Fields](../assets/quick-start-detailed/AddTextFieldRestaurant.png 'Text Fields')
You should be under the **BASE SETTINGS** tab, in the **Name** field, type `Description`. This will be the description of the restaurant.
![Input Restaurant Description Field](../assets/quick-start-detailed/restaurantTextFieldBaseSettings.png 'Input Restaurant Description Field')
Now, click on the **ADVANCED SETTINGS** tab, check **Display as a WYSIWYG**. This field will provide a rich text editor. And then click the **Continue** button.
![Advanced Settings Text Field](../assets/quick-start-detailed/restaurantTextFieldAdvancedSettings.png 'Advanced Settings Text Field')
Lastly, we will save this **Content Type**. Click the **Save** button.
![Save Restaurant Content Type](../assets/quick-start-detailed/saveRestaurantContentType.png 'Save Restaurant Content Type')
Wait for Strapi to restart, and then we will be able to create the `Category` **Content Type**.
![Wait for Strapi Restart](../assets/quick-start-detailed/waitForRestart.png 'Wait for Strapi Restart')
### The Category Content Type
The Category Content Type will have a **String** field named `category` for categories assigned to restaurants, and a **Relation field** with a **Many to Many** relationship.
Let's now add this second content type. Click the **+ Add Content Type** menu item.
![Add Content Type Menu Item](../assets/quick-start-detailed/AddContentTypeMenuItem.png 'Add Content Type Menu Item')
Now enter a name for this new **Content Type** (we will call this one `category`), and write a Description. We will write `Restaurant Categories` for the description. Then click the **Save** button.
![Category Content Type Name and Description](../assets/quick-start-detailed/categoryNameAndDescription.png 'Category Content Type Name and Description')
Now you are ready to add the content type fields. We will add a **String** field for the Name and a **Relation Field** for creating a **Many to Many** relation between the Category Content Type and Restaurant Content Type. Click on the **+ Add New Field** button.
![Category Add New Field Button](../assets/quick-start-detailed/categoryAddNewField.png 'Category Add New Field Button')
Next we will click on the **String** field.
![Category add String Field](../assets/quick-start-detailed/categoryAddStringField.png 'Category add String Field')
You should be under the **BASE SETTINGS** tab, in the **Name** field, type `Name`. This will be the name of the category.
![Category String Field Name](../assets/quick-start-detailed/categoryStringNameField.png 'Category String Field Name')
Now, click on the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field**. This field is required for each category and is not optional. Also, we want each category to have a unique name, so we check the **Unique field** box. And then click the **Continue** button.
![Category String Field Advanced Settings](../assets/quick-start-detailed/categoryStringAdvancedSettings.png 'Category String Field Advanced Settings')
We are now ready to add the second field, the **Relation** field for the **Many to Many relation** setting between Categories and Restaurants. Click the **+ Add New Field** button.
![Category Add New Field for Relation Field](../assets/quick-start-detailed/categoryAddClickNewFieldRelation.png 'Category Add New Field for Relation Field')
From here, click the **Relation** field.
![Category Click Relation Field](../assets/quick-start-detailed/clickRelationFieldCategory.png 'Category Click Relation Field')
This will bring you to the **Add New Relation** screen. We will change two elements on this page for the **Relation** field.
![Add new Relation Field screen](../assets/quick-start-detailed/addNewRelationScreen.png 'Add new Relation Field screen')
The first element to change is **Permission (Users-Permissions)** to **Restaurant** (on the right).
![Change Permission to Restaurant](../assets/quick-start-detailed/categoryChangePermissionToRestaurant.png 'Change Permission to Restaurant')
The second element to change is to click the **Many to Many** icon (in the middle). It should now read, **"Categories has and belongs to many Restaurants"**. Then click the **Continue** button.
![Category Has Many To Many Relation](../assets/quick-start-detailed/categoryHasManyToMany.png 'Category Has Many To Many Relation')
Lastly, we will save this **Content Type**. Click the **Save** button.
![Now Save Category](../assets/quick-start-detailed/nowSaveCategory.png 'Now Save Category')
Wait for Strapi to restart.
![Now Wait for Strapi to Restart](../assets/quick-start-detailed/saveCategoryWaiting.png 'Now Wait for Strapi to Restart')
Verify in the left menu under **CONTENT TYPES**, that you see **Categories**, **Restaurants** and **Users**.
![Verify Content Types](../assets/quick-start-detailed/verifyContentTypes.png 'Verify Content Types')
### Files structure
A new directory has been created in the `Project/cms/` folder of your application which contains all the needed files related to your `restaurant` and `category` Content Types. Take a look at the [API structure documentation](../concepts/concepts.md#files-structure) for more information.
---
## 5. Manage and add data to Content Type
After creating the **Content Types**, we now need to manage and add data to the new Content Types.
We will create an entry of a restaurant called, `Strapi Restaurant` with a description saying, `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.`
We will then assign two Categories, `Italian` and `Contemporary` to this restaurant.
Click on **Restaurants** under the **CONTENT TYPES** menu in order to **Add New Restaurant**.
![Add Restaurant to Content Type](../assets/quick-start-detailed/AddStrapiRestaurant.png 'Add Restaurant to Content Type')
Next click on the **+ Add New Restaurant** button (in the top right corner). Go ahead and type `Strapi Restaurant` in the **Name** field, and type the content (above) into the **Description** field. Then press the **Save** button (in the top right corner).
![Add Restaurant Name and Description](../assets/quick-start-detailed/addTheRestaurantData.png 'Add Restaurant Name and Description')
When it is saved, you will see your restaurant listed in the entries. From here you can edit it or add a new resturant.
![Restaurant is now listed](../assets/quick-start-detailed/listedRestaurant.png 'Restaurant is now listed')
We have **NOT** added a **Category** to the **Restaurant** we created. We first have to add the actual Category items to the **Categories** content type.
We will next assign two Categories, `Italian` and `Contemporary` to this restaurant.
Click on **Categories** under the **CONTENT TYPES** menu on the left.
![Category Add Content Type Screen](../assets/quick-start-detailed/categoryContentTypeScreen.png 'Category Add Content Type Screen')
Now we will add each of the catgeories. Click the **+ Add New Category** button to add the first category **Italian**. Type `Italian` into the **Name** field. Next, you will see **Restaurants (0)** to the right. Select **Strapi Restaurant** to add this category to the restaurant.
After selecting, **Restaurants (0)** to the right, will change to **Restaurants (1)** (see below). And then press the **Save** button.
![Add Italian category to Restaurant](../assets/quick-start-detailed/addItalianCategoryToRestaurant.png 'Add Italian category to Restaurant')
You now see the Category listed. Click the **+ Add New Category** button to add the second category `Contemporary`.
![Listed Italian Category](../assets/quick-start-detailed/listedItalianCategory.png 'Listed Italian Category')
Now let's add **Contemporary**. Type `Contemporary` into the **Name** field. You will see **Restaurants (0)** to the right. You will see **Restaurants** to the right. Select **Strapi Restaurant** to add this category to the restaurant.
After selecting, **Restaurants (0)** to the right, will change to **Restaurants (1)** (see below). And then press the **Save** button.
![Add Contemporary category to Restaurant](../assets/quick-start-detailed/addContemporaryCategoryToRestaurant.png 'Add Contemporary category to Restaurant')
You return to the **Category** Content Type page. You see both categories listed. Both have been assigned to the **Restaurant** we created earlier.
![Both categories listed](../assets/quick-start-detailed/categoriesListed.png 'Both categories listed')
::: warning NOTE
If you want to add Categories directly from the **Restaurants** Content Type, you simply click on the Restaurant and add, edit or change **EXISTING** categories. Otherwise, you can create and add new **Categories** from the **Category Content Type** as we did above.
![Select Category from Restaurant](../assets/quick-start-detailed/selectCategoryFromRestaurant.png 'Select Category from Restaurant')
:::
---
## 6. Set roles and permissions
By default, Strapi publishes all **Content Types** with restricted permissions. Which means you have to explicitly give permissions to each **Content Type** you create. We are going to give **Public** (any web browser with the correct link) access to the **Restaurant** Content Type.
Locate and click on the **Roles & Permission** menu item under **PLUGINS** on the left menu. (The **Roles & Permission** plugin can accomplish many tasks related to permissions. For now we will focus on the **Public** role.)
Next, click on the **pencil** edit icon to the right of the **Public** Role.
![Roles and Permissions Panel](../assets/quick-start-detailed/rolesAndPermissions.png 'Roles and Permissions Panel')
From here, scroll down under **Permissions** and find **Restaurant**. Click the checkbox next to **find**. To the right, you will see the URL route. It should say, `/restaurants`. Scroll back to the top, and click the **Save** button.
![Check Find for Restaurant](../assets/quick-start-detailed/rolesFindAndRoute.png 'Check Find for Restaurant')
You are returned to the **Roles and Permission** panel.
![Roles and Permissions Panel](../assets/quick-start-detailed/rolesAndPermissions.png 'Roles and Permissions Panel')
---
## 7. Consume the Content Type API
The project is accessible by following the `http://localhost:1337/` link. You will see the **'Welcome'** screen.
![Strapi Welcome Page](../assets/quick-start-detailed/strapiWelcomePage.png 'Strapi Welcome Page')
What we want is the **Restaurant Content Type**. The route is `/restaurants`. In your browser, type `http://localhost:1337/restaurants`.
![Successful API call to Restaurant Content Type](../assets/quick-start-detailed/successApiCall.png 'Successful API call to Restaurant Content Type')
::: warning NOTE
If you have incorrectly or not set permissions to your content type, you will get a **"403"** permission error. See the below example.
Forbidden Access Looks like this:
![Forbidden Access to Restaurant Content Type](../assets/quick-start-detailed/forbiddenAccessToRestaurant.png 'Forbidden Access to Restaurant Content Type')
:::
::: tip CONGRATULATIONS
👏 Congratulations, you have now completed the Tutoral showing you how to get started with Strapi. We invite you to [join our community](/3.x.x/community.html). Please continue reviewing our docs and tutorials to further learn how Strapi can solve your needs.
:::

View File

@ -1,281 +1,159 @@
# Quick start
# Quick Start Guide
We have created an Quick Start installation which will set-up, configure and get Strapi up and running effortlessly.
<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>
::: warning NOTE
Quick start will install Strapi using a SQLite database. [SQLite](https://www.sqlite.org/index.html) is likely used more than all other database engines combined.
:::
(A tutorial of this Quick Start guide can be found at [Quick Start Tutorial](quick-start-tutorial.html).)
This quick start is written for developers who prefer an intermediate or more advanced introduction to Strapi. A more detailed version of this Quick Start page can be found at [Quick Start - Detailed](/3.x.x/installation-options/quick-start-detailed.html) in the **Installation Options** section.
___
(You should have already completed the steps to install Strapi and the requirements from [Installation Requirements](install-requirements.html). These steps continue after [ensuring nodejs, NPM and strapi are all properly installed](/3.x.x/getting-started/install-requirements.html#check-installation)).)
## 1. Install Strapi globally
This page explains how to create a new project in Strapi. ([Check out our video tutorial](https://www.youtube.com/watch?v=yMl5IcFHA74)).
<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>
## 1. Create a project
Navigate to your parent "projects" directory in your command line. Enter the following command to create a Strapi Quick Start project.
(These steps continue after [Node.js and npm are properly installed](install-requirements.html).)
```bash
str@pi:~/Desktop/Strapi/Projects$ strapi new my-project --quickstart
npm install strapi@alpha -g
```
This will open your default browser to the Welcome page for creating an admin user.
Strapi is now installed globally on your computer.
Type `strapi -h` in your command line to access available Strapi commands.
## 2. Create a new project
<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>
```bash
strapi new cms --quickstart
```
::: warning NOTE
You can replace the "my-project" project name with any name you want. Strapi will create a folder within your "projects" directory using that name.
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.
:::
::: warning NOTE
This will open your default browser to the Welcome page that creates an admin user.
Quick start will install Strapi using a SQLite database. ([SQLite](https://www.sqlite.org/index.html) is likely used more than all other database engines combined.)
## 3. Create an admin user
:::
<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>
## 2. Create an admin user
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:
The first user you create is the root user for your project. This user has all privileges and access rights. You will need to complete the following fields:
- **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
1. Username, create a username for login access to your project, eg. paulbocuse
2. Password, create a unique password for your project
3. Email Address, this will be used for recovery
4. Check receive news, this is optional but recommended
5. Click the "Ready to Start" button
## 4. Create a Content Type
---
After your admin user is registered, you will see the Strapi admin panel.
::: warning NOTE
Every user is found by clicking in the left menu: **Content Type --> Users**. From here you can add and edit users.
:::
Now let's see how to [create a Content Type](#_3-create-a-content-type). Next, click on the **Strapi** logo (top left corner) to return the main administration panel.
---
## 3. Create a Content Type
At this point, your project is empty. You need to create a **Content Type**. We will use the **Content Type Builder** plugin.
Create a new content type is done by clicking in the left menu: **PLUGINS** --> **Content Type Builder**. Go ahead a click on **Content Type Builder** to continue to the next steps.
We will create two content types. We will create a content type called **"Restaurant"** and one called **"Category"**.
<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>
### The Restaurant Content Type
The Restaurant Content Type will have a **String** field named **Name** for the restaurant name, and a **Text** field (with a WYSIWYG editor) named "Description" for the restaurant description.
Navigate to **PLUGINS** --> **Content Type Builder**.
1. Let's now add a content type:
The Restaurant Content Type will have a **String** field and a **Text** field (with a **WYSIWYG editor**).
Click the **"+ Add Content Type"** button.
1. Add a new **Content Type**:
Now enter a "Name" for your New Content Type (we will call this one **"restaurant"**), and below write a "description". We will write **"Recommended Restaurants"** for the description.
- 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**.
Then click the **Save** button.
2. Add the **Name Content Type field**.
::: warning NOTE
- 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**.
Content Type name is always **singular**. For example, **restaurant** not restaurants. For example, **category** not categories.
3. Add the **Text Content Type Field**.
:::
- 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**.
::: warning NOTE
This **"name"** should be clear so you can tell it apart from other content types you may add later. This will be what you see listed in the backend panel.
:::
2. Now you are ready to add the content type fields. We will add a **String** field for the Name and a **Text** field for a short Restaurant description.
The **Name** field
Click on the **"+ Add New Field"** button.
Next we will click on the **String** field.
You should be under the **BASE SETTINGS** tab, in the **Name** field, type **"Name"**. This will be the name of the restaurant.
Now, click on the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field**. This field is required for each restaurant and is not optional. Also, we want each restaurant to have a unique name, so we check the **Unique field** box.
And then click the **Continue** button.
3. We are now ready to add the second field, **Text** for the restaurant description.
The **Text** field
Click the **"+ Add New Field"** button.
From here, click the **Text** field.
You should be under the **BASE SETTINGS** tab, in the **Name** field, type **"Description"**. This will be the description of the restaurant.
Now, click on the **ADVANCED SETTINGS** tab, check **"Display as a WYSIWYG"**. This field will provide a rich text editor.
And then click the **Continue** button.
4. Lastly, we will save this Content Type. Click the **Save** button.
5. Wait for Strapi to restart, and then we will be able to create the next **Category** content type.
4. Click the **Save** button and wait for Strapi to restart.
### The Category Content Type
The Category Content Type will have a **String** field named **Category** for categories assigned to restaurants, and a **Relation field** with a **Many to Many** relationship.
Navigate to **PLUGINS** --> **Content Type Builder**.
1. Let's now add this second content type:
The Category Content Type will have a **String** field and a **Relation field** with a **Many to Many** relationship.
Click the **+ Add Content Type** menu item.
1. Add a new **Content Type**:
Now enter a name for this New Content Type (we will call this one **"category"**), and write a Description. We will write **"Restaurant Categories"** for the description.
- 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**.
Then click the **Save** button.
2. Add the **Name Content Type field**.
2. Now you are ready to add the content type fields. We will add a **String** field for the Name and a **Relation Field** for creating a **Many to Many** relation between the Category Content Type and Restaurant Content Type.
- 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**.
The **Name** Field
3. Add the **Relation**.
Click on the **"+ Add New Field"** button.
- 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**.
Next we will click on the **String** field.
4. Click the **Save** button and wait for Strapi to restart.
You should be under the **BASE SETTINGS** tab, in the **Name** field, type **"Name"**. This will be the name of the category.
## 5. Manage and add data to Content Type
Now, click on the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field**. This field is required for each category and is not optional. Also, we want each category to have a unique name, so we check the **Unique field** box.
And then click the **Continue** button.
3. We are now ready to add the second field, the **Relation** field for the **Many to Many relation** setting between Categories and Restaurants.
The **Relation** Field
Click the **"+ Add New Field"** button.
From here, click the **Relation** field.
This will bring you to the **Add New Relation** screen. We will change two elements on this page for the **Relation** field.
The first element to change is **Permission (Users-Permissions)** to **Restaurant** (on the right).
The second element to change is to click the **Many to Many** icon (in the middle). It should now read, **"Categories has and belongs to many Restaurants"**.
Then click the **Continue** button.
4. Lastly, we will save this Content Type. Click the **Save** button.
5. Wait for Strapi to restart.
Verify in the left menu under **CONTENT TYPES**, that you see **Categories**, **Restaurants** and **Users**.
We are now ready to [manage and add data to the Content Types](#_4-manage-and-add-data-to-content-type) we just created.
Next, click on the **Strapi** logo (top left corner) to return the main administration panel.
::: warning NOTE
See the [CLI documentation](../cli/CLI.md#strapi-generateapi) for more information on how to add Content Types the hacker way.
:::
### Files structure
A new directory has been created in the `./api` folder of your application which contains all the needed files related to your `restaurant` and `category` Content Types: routes, controllers, services and models. Take a look at the [API structure documentation](../concepts/concepts.md#files-structure) for more information.
---
## 4. Manage and add data to Content Type
After creating [the Content Types](#_3-create-a-content-type), we now need to manage and add data/content to the new Content Types.
<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>
### Add data to Content Type
1. We will create an entry of a restaurant called, **"Strapi Restaurant"** with a description saying, **"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."**.
1. Create an entry of a restaurant called, **"Strapi Restaurant"**:
Click on **Restaurants** under the **CONTENT TYPES** menu in order to **Add New Restaurant**.
- 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**.
Next click on the **+ Add New Restaurant** button (in the top right corner). Go ahead and type **"Strapi Restaurant"** in the **Name** field, and type the content (above) into the **Description** field.
You will see your restaurant listed in the entries.
Then press the **Save** button (in the top right corner).
2. Add the **Category items** to the **Categories Content Type**.
2. When it is properly saved, you will see your restaurant listed in the entries. From here you can edit it or add a new resturant.
- 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.
We have **NOT** added a **Category** to the **Restaurant** we created. We first have to add the actual Category items to the **Categories** content type.
## 6. Set roles and permissions
3. We will next assign two Categories, **"Italian"** and **"Contemporary"** to this restaurant.
<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>
Click on **Categories** under the **CONTENT TYPES** menu on the left.
Give Public access to the Restaurant Content Type.
Now we will add each of the catgeories. First, let's add **"Italian"**.
- 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**.
Click the **+ Add New Category** button to add the first category **Italian**.
## 7. Consume the Content Type API
Type **"Italian"** into the **Name** field.
<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>
Next, you will see **Restaurants (0)** to the right. Select **Strapi Restaurant** to add this category to the restaurant.
And then press the **Save** button.
You now see the **Italian** Category listed.
Now let's add **Contemporary**.
Click the **+ Add New Category** button to add the second category **Contemporary**.
Type **"Contemporary"** into the **Name** field.
You will see **Restaurants (0)** to the right. Select **Strapi Restaurant** to add this category to the restaurant.
And then press the **Save** button.
You return to the **Category** Content Type page. You see both categories listed. Both have been assigned to the **Restaurant** we created earlier.
::: warning NOTE
If you want to add Categories directly from the **Restaurants** Content Type, you simply click on the Restaurant and add, edit or change **EXISTING** categories. Otherwise, you can create and add new **Categories** from the **Category Content Type** as we did above.
:::
The next steps involve [setting roles and permissions](#_5-set-roles-and-permissions) for these content types. Let's do that.
Click on the Strapi Logo to return to the main administration panel.
---
## 5. Set roles and permissions
By default, Strapi publishes all Content Types with restricted permissions. Which means you have to explicitly give permissions to each Content Type you create.
1. We are going to give **Public** (any web browser with the correct link) access to the **Restaurant** Content Type.
Locate and click on the **Roles & Permission** menu item under **PLUGINS** on the left menu.
(The **Roles & Permission** plugin can accomplish many tasks related to permissions. For now we will focus on the **Public** role.)
Next, click on the **pencil** edit icon to the right of the **Public** Role.
From here, scroll down under **Permissions** and find **Restaurant**.
Click the checkbox next to **find**. To the right, you will see the URL route. It should say, `/restaurants"`.
Scroll back to the top, and click the **Save** button.
2. You are returned to the **Roles and Permission** Panel.
We are now ready to [Consume the Content Type API](#_6-consume-the-content-type-api).
Click on the Strapi Logo to return to the main administration panel.
---
## 6. Consume the Content Type API
The Project is accessible by following the `http://localhost:1337/` link. You will see the **'Welcome'** screen.
What we want is the **Restaurant Content Type**. The route is `/restaurants"`. In your browser, type `http://localhost:1337/restaurants`.
::: warning NOTE
If you have incorrectly or not set permissions to your content type, you will get a **"403"** permission error.
:::
The **Restaurant Content Type** is accessible at `http://localhost:1337/restaurants`.
::: tip CONGRATULATIONS
👏 Congratulations, you have now completed the Strapi Quick Start. We invite you to [join our community](/3.x.x/getting-started/community.html). Please continue reviewing our docs and tutorials to further learn how Strapi can solve your needs.
👏 Congratulations, you have now completed the Strapi Quick Start. We invite you to [join the vibrant and active Strapi community](/3.x.x/getting-started/community.html). Please continue reviewing our docs and tutorials to further learn how Strapi can solve your needs.
:::

View File

@ -1,400 +0,0 @@
# Quick start detailed
We have created an Quick Start installation which will set-up, configure and get Strapi up and running effortlessly.
This quick start (detailed version) is written for developers who prefer more detailed explanations when learning a new CMS. A more intermediate to advanced version is written and can be found at [Quick Start](/3.x.x/getting-started/quick-start.html) in the [Getting Started](/3.x.x/getting-started/quick-start.html) section.
(You should have already completed the steps to install Strapi and the requirements from [Installation Requirements](/3.x.x/getting-started/install-requirements.html). These steps continue after [ensuring nodejs, NPM and strapi are all properly installed](/3.x.x/getting-started/install-requirements.html#check-installation)).)
This page explains how to create a new project in Strapi. Each step from creating a new project to creating content types ready to be consumed is covered. ([Check out our video tutorial](https://www.youtube.com/watch?v=yMl5IcFHA74)).
**Table of contents:**
1. [Create a project](#_1-create-a-project)
2. [Create an admin user](#_2-create-an-admin-user)
3. [Create a Content Type](#_3-create-a-content-type)
- [Files structure](#files-structure)
4. [Manage and add data to Content Type](#_4-manage-and-add-data-to-content-type)
5. [Set roles and permissions](#_5-set-roles-and-permissions)
6. [Consume the Content Type API](#_6-consume-the-content-type-api)
- [List entries (GET)](#list-entries-get)
- [Get a specific entry (GET)](#get-a-specific-entry-get)
- [Create data (POST)](#create-data-post)
- [Update data (PUT)](#update-data-put)
- [Delete data (DELETE)](#delete-data-delete)
---
## 1. Create a project
Navigate to your parent "projects" directory in your command line.
```bash
str@pi:~/Desktop/Strapi/Projects$
```
Type the following in your command line and press enter to create a Strapi Quick Start project.
```bash
str@pi:~/Desktop/Strapi/Projects$ strapi new my-project --quickstart
```
::: warning NOTE
You can replace the "my-project" project name with any name you want.
:::
::: warning NOTE
When you create a new Quick Start project in Strapi, you will download all the node modules, the Strapi files necessary and the Strapi plugin files. THIS STEP CAN TAKE SEVERAL MINUTES DEPENDING ON YOUR INTERNET CONNECTION SPEED. Please wait for the process to complete before cancelling or trying to continue.
:::
::: warning NOTE
You can replace the "my-project" project name with any name you want.
Quick start will install Strapi using a SQLite database. ([SQLite](https://www.sqlite.org/index.html) is likely used more than all other database engines combined.)
:::
You will see something like this:
```bash
str@pi:~/Desktop/Strapi/Projects$ strapi new my-project --quickstart
🚀 Start creating your Strapi application. It might take a minute, please take a coffee ☕️
⏳ Testing database connection...
The app has been connected to the database successfully!
🏗 Application generation:
✔ Copy dashboard
✔ Install plugin settings-manager.
✔ Install plugin content-type-builder.
✔ Install plugin content-manager.
✔ Install plugin users-permissions.
✔ Install plugin email.
✔ Install plugin upload.
✔ Link strapi dependency to the project.
👌 Your new application my-project is ready at /home/str/Desktop/Strapi/Projects/my-project.
⚡️ Change directory:
$ cd my-project
⚡️ Start application:
$ strapi start
```
The command will automatically create a Strapi app folder within your parent "projects" directory.
```bash
str@pi:~/Desktop/Strapi/Projects$ ls
my-project
```
This will open your default browser to the Welcome page for creating an admin user.
![Strapi Welcome Page for creating admin user](../assets/quick-start-detailed/strapi-welcome-screen.jpg 'Strapi Welcome Page for creating admin user')
---
## 2. Create an admin user
The first user you create is the root user for your project. This user has all privileges and access rights. You will need to complete the following fields:
1. Username, create a username for login access to your project, eg. paulbocuse
2. Password, create a unique password for your project
3. Email Address, this will be used for recovery
4. Check receive news, this is optional but recommended
5. Click the "Ready to Start" button
![Example completed Welcome Screen with Admin User information](../assets/quick-start-detailed/welcome-screen-entered-information.jpg 'Example completed Welcome Screen with Admin User information')
---
After your admin user is registered, you will see the Strapi admin panel:
![Strapi Admin Panel](../assets/quick-start-detailed/AfterRegistrationScreenAdminPanel.jpg 'Strapi Admin Panel')
---
Every user is found by clicking in the left menu: **CONTENT TYPES** --> **Users**.
![Strapi Users Content Type Menu Item](../assets/quick-start-detailed/AfterRegistrationScreenAdminPanelChooseUsersMenu.jpg 'Strapi Users Content Type Menu Item')
From here you can add and edit users.
![Strapi Users Page](../assets/quick-start-detailed/AdminUserInUsers.jpg 'Strapi Users Page')
---
Now let's see how to [create a Content Type](#_3-create-a-content-type). Next, click on the **Strapi** logo (top left corner) to return the main administration panel.
---
## 3. Create a Content Type
At this point, your project is empty. You need to create a **Content Type**. We will use the **Content Type Builder** plugin.
Go to the **Content Type Builder** plugin, located in the left menu: **PLUGINS** --> **Content Type Builder**:
![Choose Content Type Item Location](../assets/quick-start-detailed/AfterRegistrationScreenAdminPanelChooseContentType.jpg 'Choose Content Type Item Location')
We will create two content types. We will create a content type called **"Restaurant"** and one called **"Category"**.
![Create Content Type Screen](../assets/quick-start-detailed/CreateContentTypeScreen.jpg 'Create Content Type Screen')
::: warning NOTE
Content Type _name_ is always **singular**. For example, **restaurant** not restaurants. For example, **category** not categories.
:::
### The Restaurant Content Type
The Restaurant Content Type will have a **String** field named **Name** for the restaurant name, and a **Text** field (with a WYSIWYG editor) named "Description" for the restaurant description.
Let's now add a content type. Click the **"+ Add Content Type"** button.
![Add Content Type Button](../assets/quick-start-detailed/AddContentTypeButton.jpg 'Add Content Type Button')
Now enter a "Name" for your New Content Type (we will call this one **"restaurant"**), and below write a "description". We will write **"Recommended Restaurants"** for the description.
::: warning NOTE
This **"name"** should be clear so you can tell it apart from other content types you may add later. This will be what you see listed in the backend panel.
:::
Then click the **Save** button.
![Restaurant Name and Descriptions](../assets/quick-start-detailed/RestaurantNameAndDescription.jpg 'Restaurant Name and Descriptions')
Now you are ready to add the content type fields. We will add a **String** field for the Name and a **Text** field for a short Restaurant description. Click on the **"+ Add New Field"** button.
![Add Restaurant Fields](../assets/quick-start-detailed/restaurantAddFields.jpg 'Add Restaurant Fields')
Next we will click on the **String** field.
![String Field](../assets/quick-start-detailed/restaurantStringAndText.jpg 'String Fields')
You should be under the **BASE SETTINGS** tab, in the **Name** field, type **"Name"**. This will be the name of the restaurant.
![Input Restaurant Name Field](../assets/quick-start-detailed/saveRestaurantNameField.jpg 'Input Restaurant Name Field')
Now, click on the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field**. This field is required for each restaurant and is not optional. Also, we want each restaurant to have a unique name, so we check the **Unique field** box. And then click the **Continue** button.
![Advanced Settings String Field](../assets/quick-start-detailed/restaurantAdvancedSettingsStringField.jpg 'Advanced Settings String Field')
We are now ready to add the second field, **Text** for the restaurant description. Click the **"+ Add New Field"** button.
![Add new restaurant field](../assets/quick-start-detailed/restaurantAddNewField.jpg 'Add new restaurant field')
From here, click the **Text** field.
![Text Fields](../assets/quick-start-detailed/AddTextFieldRestaurant.jpg 'Text Fields')
You should be under the **BASE SETTINGS** tab, in the **Name** field, type **"Description"**. This will be the description of the restaurant.
![Input Restaurant Description Field](../assets/quick-start-detailed/restaurantTextFieldBaseSettings.jpg 'Input Restaurant Description Field')
Now, click on the **ADVANCED SETTINGS** tab, check **"Display as a WYSIWYG"**. This field will provide a rich text editor. And then click the **Continue** button.
![Advanced Settings Text Field](../assets/quick-start-detailed/restaurantTextFieldAdvancedSettings.jpg 'Advanced Settings Text Field')
Lastly, we will save this Content Type. Click the **Save** button.
![Save Restaurant Content Type](../assets/quick-start-detailed/saveRestaurantContentType.jpg 'Save Restaurant Content Type')
Wait for Strapi to restart, and then we will be able to create the next **Category** content type.
![Wait for Strapi Restart](../assets/quick-start-detailed/waitForRestart.jpg 'Wait for Strapi Restart')
### The Category Content Type
The Category Content Type will have a **String** field named **"Category"** for categories assigned to restaurants, and a **Relation field** with a **Many to Many** relationship.
Let's now add this second content type. Click the **+ Add Content Type** menu item.
![Add Content Type Menu Item](../assets/quick-start-detailed/AddContentTypeMenuItem.jpg 'Add Content Type Menu Item')
Now enter a name for this New Content Type (we will call this one **"category"**), and write a Description. We will write **"Restaurant Categories"** for the description. Then click the **Save** button.
![Category Content Type Name and Description](../assets/quick-start-detailed/categoryNameAndDescription.jpg 'Category Content Type Name and Description')
Now you are ready to add the content type fields. We will add a **String** field for the Name and a **Relation Field** for creating a **Many to Many** relation between the Category Content Type and Restaurant Content Type. Click on the **"+ Add New Field"** button.
![Category Add New Field Button](../assets/quick-start-detailed/categoryAddNewField.jpg 'Category Add New Field Button')
Next we will click on the **String** field.
![Category add String Field](../assets/quick-start-detailed/categoryAddStringField.jpg 'Category add String Field')
You should be under the **BASE SETTINGS** tab, in the **Name** field, type **"Name"**. This will be the name of the category.
![Category String Field Name](../assets/quick-start-detailed/categoryStringNameField.jpg 'Category String Field Name')
Now, click on the **ADVANCED SETTINGS** tab, check **Required field** and **Unique field**. This field is required for each category and is not optional. Also, we want each category to have a unique name, so we check the **Unique field** box. And then click the **Continue** button.
![Category String Field Advanced Settings](../assets/quick-start-detailed/categoryStringAdvancedSettings.jpg 'Category String Field Advanced Settings')
We are now ready to add the second field, the **Relation** field for the **Many to Many relation** setting between Categories and Restaurants. Click the **"+ Add New Field"** button.
![Category Add New Field for Relation Field](../assets/quick-start-detailed/categoryAddClickNewFieldRelation.jpg 'Category Add New Field for Relation Field')
From here, click the **Relation** field.
![Category Click Relation Field](../assets/quick-start-detailed/clickRelationFieldCategory.jpg 'Category Click Relation Field')
This will bring you to the **Add New Relation** screen. We will change two elements on this page for the **Relation** field.
![Add new Relation Field screen](../assets/quick-start-detailed/addNewRelationScreen.jpg 'Add new Relation Field screen')
The first element to change is **Permission (Users-Permissions)** to **Restaurant** (on the right).
![Change Permission to Restaurant](../assets/quick-start-detailed/categoryChangePermissionToRestaurant.jpg 'Change Permission to Restaurant')
The second element to change is to click the **Many to Many** icon (in the middle). It should now read, **"Categories has and belongs to many Restaurants"**. Then click the **Continue** button.
![Category Has Many To Many Relation](../assets/quick-start-detailed/categoryHasManyToMany.jpg 'Category Has Many To Many Relation')
Lastly, we will save this Content Type. Click the **Save** button.
![Now Save Category](../assets/quick-start-detailed/nowSaveCategory.jpg 'Now Save Category')
Wait for Strapi to restart.
![Now Wait for Strapi to Restart](../assets/quick-start-detailed/saveCategoryWaiting.jpg 'Now Wait for Strapi to Restart')
Verify in the left menu under **CONTENT TYPES**, that you see **Categories**, **Restaurants** and **Users**.
![Verify Content Types](../assets/quick-start-detailed/verifyContentTypes.jpg 'Verify Content Types')
We are now ready to [manage and add data to the Content Types](quick-start-detailed.html#_4-manage-and-add-data-to-content-type) we just created.
Next, click on the **Strapi** logo (top left corner) to return the main administration panel.
::: warning NOTE
See the [CLI documentation](../cli/CLI.md#strapi-generateapi) for more information on how to add Content Types the hacker way.
:::
### Files structure
A new directory has been created in the `./api` folder of your application which contains all the needed files related to your `restaurant` and `category` Content Types: routes, controllers, services and models. Take a look at the [API structure documentation](../concepts/concepts.md#files-structure) for more information.
---
## 4. Manage and add data to Content Type
After creating [the Content Types](#_3-create-a-content-type), we now need to manage and add data/content to the new Content Types.
We will create an entry of a restaurant called, **"Strapi Restaurant"** with a description saying, **"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."**.
We will then assign two Categories, **"Italian"** and **"Contemporary"** to this restaurant.
Click on **Restaurants** under the **CONTENT TYPES** menu in order to **Add New Restaurant**.
![Add Restaurant to Content Type](../assets/quick-start-detailed/AddStrapiRestaurant.jpg 'Add Restaurant to Content Type')
Next click on the **+ Add New Restaurant** button (in the top right corner). Go ahead and type **"Strapi Restaurant"** in the **Name** field, and type the content (above) into the **Description** field. Then press the **Save** button (in the top right corner).
![Add Restaurant Name and Description](../assets/quick-start-detailed/addTheRestaurantData.jpg 'Add Restaurant Name and Description')
When it is properly saved, you will see your restaurant listed in the entries. From here you can edit it or add a new resturant.
![Restaurant is now listed](../assets/quick-start-detailed/ListedRestaurant.jpg 'Restaurant is now listed')
We have **NOT** added a **Category** to the **Restaurant** we created. We first have to add the actual Category items to the **Categories** content type.
We will next assign two Categories, **"Italian"** and **"Contemporary"** to this restaurant.
Click on **Categories** under the **CONTENT TYPES** menu on the left.
![Category Add Content Type Screen](../assets/quick-start-detailed/categoryContentTypeScreen.jpg 'Category Add Content Type Screen')
Now we will add each of the catgeories. Click the **+ Add New Category** button to add the first category **Italian**. Type **"Italian"** into the **Name** field. Next, you will see **Restaurants (0)** to the right. Select **Strapi Restaurant** to add this category to the restaurant.
After selecting, **Restaurants (0)** to the right, will change to **Restaurants (1)** (see below). And then press the **Save** button.
![Add Italian category to Restaurant](../assets/quick-start-detailed/addItalianCategoryToRestaurant.jpg 'Add Italian category to Restaurant')
You now see the Category listed. Click the **+ Add New Category** button to add the second category **"Contemporary"**.
![Listed Italian Category](../assets/quick-start-detailed/listedItalianCategory.jpg 'Listed Italian Category')
Now let's add **Contemporary**. Type **"Contemporary"** into the **Name** field. You will see **Restaurants (0)** to the right. You will see **Restaurants** to the right. Select **Strapi Restaurant** to add this category to the restaurant.
After selecting, **Restaurants (0)** to the right, will change to **Restaurants (1)** (see below). And then press the **Save** button.
![Add Contemporary category to Restaurant](../assets/quick-start-detailed/addContemporaryCategoryToRestaurant.jpg 'Add Contemporary category to Restaurant')
You return to the **Category** Content Type page. You see both categories listed. Both have been assigned to the **Restaurant** we created earlier.
![Both categories listed](../assets/quick-start-detailed/categoriesListed.jpg 'Both categories listed')
::: warning NOTE
If you want to add Categories directly from the **Restaurants** Content Type, you simply click on the Restaurant and add, edit or change **EXISTING** categories. Otherwise, you can create and add new **Categories** from the **Category Content Type** as we did above.
![Select Category from Restaurant](../assets/quick-start-detailed/selectCategoryFromRestaurant.jpg 'Select Category from Restaurant')
:::
The next steps involve [setting roles and permissions](quick-start-detailed.html#_5-set-roles-and-permissions) for these content types. Let's do that.
Click on the Strapi Logo to return to the main administration panel.
![Main Admin Panel](../assets/quick-start-detailed/mainAdminPanel.jpg 'Main Admin Panel')
---
## 5. Set roles and permissions
By default, Strapi publishes all Content Types with restricted permissions. Which means you have to explicitly give permissions to each Content Type you create. We are going to give **Public** (any web browser with the correct link) access to the **Restaurant** Content Type.
Locate and click on the **Roles & Permission** menu item under **PLUGINS** on the left menu. (The **Roles & Permission** plugin can accomplish many tasks related to permissions. For now we will focus on the **Public** role.)
Next, click on the **pencil** edit icon to the right of the **Public** Role.
![Roles and Permissions Panel](../assets/quick-start-detailed/RolesAndPermissionsPanel.jpg 'Roles and Permissions Panel')
From here, scroll down under **Permissions** and find **Restaurant**. Click the checkbox next to **find**. To the right, you will see the URL route. It should say, `/restaurants"`. Scroll back to the top, and click the **Save** button.
![Check Find for Restaurant](../assets/quick-start-detailed/rolesFindAndRoute.jpg 'Check Find for Restaurant')
You are returned to the **Roles and Permission** Panel.
![Roles and Permissions Panel](../assets/quick-start-detailed/RolesAndPermissionsPanel.jpg 'Roles and Permissions Panel')
We are now ready to [Consume the Content Type API](quick-start-detailed.html#_6-consume-the-content-type-api).
Click on the Strapi Logo to return to the main administration panel.
---
## 6. Consume the Content Type API
The Project is accessible by following the `http://localhost:1337/` link. You will see the **'Welcome'** screen.
![Strapi Welcome Page](../assets/quick-start-detailed/strapiWelcomePage.jpg 'Strapi Welcome Page')
What we want is the **Restaurant Content Type**. The route is `/restaurants"`. In your browser, type `http://localhost:1337/restaurants`.
![Successful API call to Restaurant Content Type](../assets/quick-start-detailed/successApiCall.jpg 'Successful API call to Restaurant Content Type')
::: warning NOTE
If you have incorrectly or not set permissions to your content type, you will get a **"403"** permission error. See the below example.
Forbidden Access Looks like this:
![Forbidden Access to Restaurant Content Type](../assets/quick-start-detailed/forbiddenAccessToRestaurant.jpg 'Forbidden Access to Restaurant Content Type')
:::
::: tip CONGRATULATIONS
👏 Congratulations, you have now completed the Strapi Quick Start. We invite you to [join our community](/3.x.x/getting-started/community.html). Please continue reviewing our docs and tutorials to further learn how Strapi can solve your needs.
:::