Skip to content

Commit 87cb5d3

Browse files
Quick Start Guide and CLI installation guide updates for the Cloud CLI (#2119)
* Update the Quick Start Guide to reflect new Cloud CLI behavior * Update the CLI installation docs * Add cross-link to QSG to CLI install. guide * Update docusaurus/docs/dev-docs/quick-start.md * Update docusaurus/docs/dev-docs/quick-start.md * Update docusaurus/docs/dev-docs/quick-start.md * Update docusaurus/docs/dev-docs/quick-start.md * Update docusaurus/docs/dev-docs/installation/cli.md Co-authored-by: Ben Irvin <[email protected]> * Update docusaurus/docs/dev-docs/installation/cli.md Co-authored-by: Ben Irvin <[email protected]> * Update docusaurus/docs/dev-docs/quick-start.md Co-authored-by: Ben Irvin <[email protected]> * Update docusaurus/docs/dev-docs/quick-start.md Co-authored-by: Ben Irvin <[email protected]> * Update docusaurus/docs/dev-docs/installation/cli.md * Update docusaurus/docs/dev-docs/installation/cli.md * Update docusaurus/docs/dev-docs/installation/cli.md * Update docusaurus/docs/dev-docs/installation/cli.md * Update docusaurus/docs/dev-docs/installation/cli.md * Update docusaurus/docs/dev-docs/installation/cli.md * Update docusaurus/docs/dev-docs/installation/cli.md * Update docusaurus/docs/dev-docs/quick-start.md * Swap NPM & Yarn tabs order * Shorten text --------- Co-authored-by: Ben Irvin <[email protected]>
1 parent 89c1dd9 commit 87cb5d3

File tree

5 files changed

+98
-64
lines changed

5 files changed

+98
-64
lines changed

docusaurus/docs/dev-docs/installation/cli.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ The above installation guide only covers the basic installation option using the
7979
- `--typescript`/`--ts`: Create a project in [TypeScript](/dev-docs/typescript).
8080
- `--no-run`: Prevent Strapi from automatically starting the server (useful in combination with `--quickstart`).
8181
82+
- `--skip-cloud`: Automatically answers "Skip" to the Login/Signup question, which prevents the installation script from login into Strapi Cloud (useful in combination with `--quickstart`).
83+
8284
For more information on available flags, see our [CLI documentation](/dev-docs/cli).
8385
8486
Strapi also offers a starters CLI to create a project with a pre-made frontend application (see [our dedicated blog post](https://strapi.io/blog/announcing-the-strapi-starter-cli)).
@@ -89,6 +91,36 @@ Experimental Strapi versions are released every Tuesday through Saturday at midn
8991
Please use these experimental builds at your own risk. It is not recommended to use them in production.
9092
:::
9193
94+
### Skipping the Strapi Cloud login step
95+
96+
When the installation script runs, the terminal will first ask you if you want to login/signup. Choosing `Login/signup` will create a free, 14-day trial [Strapi Cloud](/cloud/intro#what-is-strapi-cloud) project as described in the [Quick Start Guide](/dev-docs/quick-start).
97+
98+
If you prefer skipping this Strapi Cloud login part, use the arrow keys to select `Skip`. The script will resume and create a local project. To deploy this project and host it online, you could later choose to:
99+
- host it yourself by pushing the project's code to a repository (e.g., on GitHub) before following a [3rd-party deployment guide](/dev-docs/deployment),
100+
- or use the [Cloud CLI](/cloud/cli/cloud-cli) commands to login to Strapi Cloud and deploy your project there.
101+
102+
If you want to host your project yourself and are not already familiar with GitHub, the following togglable content should get you started👇.
103+
104+
<details>
105+
<summary>Steps required to push your Strapi project code to GitHub:</summary>
106+
107+
1. In the terminal, ensure you are still in the folder that hosts the Strapi project you created.
108+
2. Run the `git init` command to initialize git for this folder.
109+
3. Run the `git add .` command to add all modified files to the git index.
110+
4. Run the `git commit -m "Initial commit"` command to create a commit with all the added changes.
111+
5. Log in to your GitHub account and [create a new repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories). Give the new repository a name, for instance `my-first-strapi-project`, and remember this name.
112+
6. Go back to the terminal and push your local repository to GitHub:
113+
114+
a. Run a command similar to the following: `git remote add origin [email protected]:yourname/my-first-strapi-project.git`, ensuring you replace `yourname` by your own GitHub profile name, and `my-first-strapi-project` by the actual name you used at step 4.
115+
116+
b. Run the `git push --set-upstream origin main` command to finally push the commit to your GitHub repository.
117+
118+
Additional information about using git with the command line interface can be found in the [official GitHub documentation](https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github#adding-a-local-repository-to-github-using-git).
119+
120+
</details>
121+
122+
123+
92124
## Running Strapi
93125

94126
To start the Strapi application, run the following command in the project folder:

docusaurus/docs/dev-docs/quick-start.md

Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ Strapi offers a lot of flexibility. Whether you want to go fast and quickly see
1818

1919
:::prerequisites
2020
<InstallPrerequisites components={props.components} />
21-
22-
You will also need to [install `git`](https://github.com/git-guides/install-git) and to have a [GitHub](https://github.com) account to deploy your project to Strapi Cloud.
2321
:::
2422

2523
## 🚀 Part A: Create a new project with Strapi
@@ -29,34 +27,53 @@ We will first create a new Strapi project on your machine by running a command i
2927
Follow the steps below by clicking on the togglable content to read more instructions.
3028

3129
<details style={detailsStyle}>
32-
<summary style={summaryStyle}>Step 1: Run the installation script</summary>
30+
<summary style={summaryStyle}>Step 1: Run the installation script and create a Strapi Cloud account</summary>
3331

34-
### Step 1: Run the installation script
32+
### Step 1: Run the installation script and create a Strapi Cloud account
3533

36-
Run the following command in a terminal:
34+
1. Run the following command in a terminal:
3735

38-
<Tabs groupId="yarn-npm">
36+
<Tabs groupId="yarn-npm">
3937

40-
<TabItem value="yarn" label="Yarn">
38+
<TabItem value="npm" label="NPM">
4139

42-
```bash
43-
yarn create strapi-app my-project --quickstart
44-
```
40+
```bash
41+
npx create-strapi-app@latest my-strapi-project --quickstart
42+
```
4543

46-
</TabItem>
44+
</TabItem>
4745

48-
<TabItem value="npm" label="NPM">
46+
<TabItem value="yarn" label="Yarn">
4947

50-
```bash
51-
npx create-strapi-app@latest my-project --quickstart
52-
```
48+
```bash
49+
yarn create strapi-app my-strapi-project --quickstart
50+
```
51+
52+
</TabItem>
53+
54+
</Tabs>
55+
56+
2. The terminal will invite you to create a Strapi Cloud account and start a free, 14-day trial. Ensure `Login/Sign up` is selected in the terminal, or use arrow keys to select it, and press Enter.
57+
58+
3. In the new browser tab that opens, ensure the confirmation code is the same as in the terminal and click **Confirm**.
59+
60+
4. Still in the browser tab, click **Continue with GitHub**. If you are not already logged in into GitHub with your current browser session, you might be redirected to a GitHub login page.
5361

54-
</TabItem>
62+
5. Once logged in, the browser will display a "Congratulations, you're all set!" message and you can safely close the browser tab and get back to the terminal.
5563

56-
</Tabs>
64+
<ThemedImage
65+
alt="Login GIF"
66+
sources={{
67+
light: '/img/assets/quick-start-guide/qsg-cloud-login.gif',
68+
dark: '/img/assets/quick-start-guide/qsg-cloud-login.gif',
69+
}}
70+
/>
71+
72+
As you will see in the terminal, your project is now building locally and also getting ready to be deployed on Strapi Cloud later.
5773

5874
:::info
59-
The `quick start` installation sets up Strapi with a SQLite database. Other databases and installation options are available (see [CLI installation guide](/dev-docs/installation/cli)).
75+
* The `quick start` installation sets up Strapi with a SQLite database. Other databases and installation options are available (see [CLI installation guide](/dev-docs/installation/cli)).
76+
* The folder of your project will include a `.strapi-cloud.json` file used to link the local Strapi project on your machine to the Strapi Cloud project.
6077
:::
6178

6279
</details>
@@ -95,7 +112,7 @@ The admin panel of a local Strapi project runs at [http://localhost:1337/admin](
95112
First we will build a data structure for your content. This can only be done while in development mode, which is the default mode for projects that are created locally.
96113

97114
:::tip TIP
98-
If the server is not already running, in your terminal, `cd` into the `my-project` folder and run `npm run develop` (or `yarn develop`) to launch it.
115+
If the server is not already running, in your terminal, `cd` into the `my-strapi-project` folder and run `npm run develop` (or `yarn develop`) to launch it.
99116
:::
100117

101118
The Content-Type Builder helps you create your data structure. When creating an empty project with Strapi, this is where to get the party started!
@@ -166,71 +183,55 @@ You have just created a basic data structure for your Strapi project! You can ke
166183
167184
## ☁️ Part C: Deploy to Strapi Cloud
168185
169-
Now that your beautiful first Strapi project is working locally, it's time for the world to see it live! The most straightforward way to host your project is to use Strapi Cloud. Before deploying to Strapi Cloud, you will need to host your Strapi project on an online repository — we will use GitHub.
186+
Now that your beautiful first Strapi project is working locally, it's time for the world to see it live! The most straightforward way to host your project is to use Strapi Cloud: Deploying your project on Strapi Cloud is done with a single command! 🚀
170187

171-
<details style={detailsStyle}>
172-
<summary style={summaryStyle}>Step 1: Host the code of your Strapi project on GitHub</summary>
188+
To deploy your project on Strapi Cloud, in your terminal:
173189

174-
### Step 1: Host the code of your Strapi project on GitHub
190+
1. If the server for your local Strapi project is running, which should be the case if you followed this tutorial so far, press `Ctrl-C` to stop the server.
191+
2. Ensure you are in the folder of your Strapi project (if needed, run for instance `cd my-strapi-project` to reach this folder), and run the following command:
175192

176-
Create a new GitHub repository and push the code of your Strapi project to this repository. If you're not already familiar with GitHub, the togglable content below should get you started 👇
193+
<Tabs groupId="yarn-npm">
177194

178-
<details>
179-
<summary>Steps required to push your Strapi project code to GitHub:</summary>
195+
<TabItem value="yarn" label="Yarn">
180196

181-
1. In the terminal, ensure you are still in the `my-project` folder that hosts the Strapi project we created. If you followed this tutorial closely so far, we should still be there.
182-
2. Run the `git init` command to initialize git for this folder.
183-
3. Run the `git add .` command to add all modified files to the git index.
184-
4. Run the `git commit -m "Initial commit"` command to create a commit with all the added changes.
185-
5. Log in into your GitHub account and [create a new repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories). Give the new repository a name, for instance `my-first-strapi-project`, and remember this name.
186-
6. Go back to the terminal and push your local repository to GitHub:
197+
```sh
198+
yarn strapi deploy
199+
```
187200

188-
a. Run a command similar to the following: `git remote add origin [email protected]:yourname/my-first-strapi-project.git`, ensuring you replace `yourname` by your actual GitHub profile name, and `my-first-strapi-project` by the actual name you used at step 4.
201+
</TabItem>
189202

190-
b. Run the `git push --set-upstream origin main` command to finally push the commit to your GitHub repository.
203+
<TabItem value="npm" label="NPM">
191204

192-
Additional information about using git with the command line interface can be found in the [official GitHub documentation](https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github#adding-a-local-repository-to-github-using-git).
205+
```sh
206+
npm run strapi deploy
207+
```
193208

194-
</details>
209+
</TabItem>
195210

196-
</details>
197-
198-
<details style={detailsStyle}>
199-
<summary style={summaryStyle}>Step 2: Create a Strapi Cloud account and a new Strapi Cloud project</summary>
200-
201-
### Step 2: Create a Strapi Cloud account and a new Strapi Cloud project
211+
</Tabs>
202212

203-
To create a new Strapi Cloud account:
213+
Within a few moments, your local project will be hosted on Strapi Cloud. 🚀
204214

205-
1. Navigate to the [Strapi Cloud](https://cloud.strapi.io) login page.
206-
2. Click the **Continue with GitHub** button and log in with the GitHub account where your Strapi project's repository is hosted.
215+
Once it's done, the terminal will provide you a clickable link that starts with `https://cloud.strapi.io/projects`. Click on the link, or copy and paste it in your browser address bar, to visit the page.
207216
208-
You should now see the Strapi Cloud dashboard. This is where you manage your Strapi projects hosted on Strapi Cloud.
209-
210-
We will create a new Strapi Cloud project by importing the local Strapi project you have just pushed to a GitHub repository:
217+
You will see the Strapi Cloud project we've just created, `my-strapi-project`, visible in the Strapi Cloud dashboard. Click the **Visit app** button in the top right corner to access your deployed Strapi project.
211218

212219
<ThemedImage
213-
alt="Strapi Cloud dashboard"
214-
sources={{
215-
light: '/img/assets/quick-start-guide/qsg-strapi-cloud-1.png',
216-
dark: '/img/assets/quick-start-guide/qsg-strapi-cloud-1_DARK.png',
217-
}}
220+
alt="Visit Strapi Cloud App GIF"
221+
sources={{
222+
light: '/img/assets/quick-start-guide/qsg-visit-cloud-app.gif',
223+
dark: '/img/assets/quick-start-guide/qsg-visit-cloud-app_DARK.gif',
224+
}}
218225
/>
219226

220-
1. Click the **+ Create project** button.
221-
2. Select the free trial plan.
222-
3. Scroll down, and in the "Import git repository section", choose the appropriate Account and Repository from the list (for instance, Account: `yourname`, Repository: `my-first-strapi-project`).
223-
4. Scroll down further, and in the "Setup" section, give your project a Display name (for instance `my-first-strapi-project`) and leave the other options unchanged.
224-
5. Click **Create project** at the bottom of the page.
225-
226-
Your Strapi project should be deployed within minutes. 🚀 Once it's done, you'll be able to log into your deployed Strapi project by clicking the **Visit app** button in the top right corner.
227-
228-
</details>
229-
230227
:::callout 🥳 CONGRATULATIONS!
231228
Now your project is hosted on Strapi Cloud and accessible online. You can learn more about Strapi Cloud by reading [its dedicated documentation](/cloud/intro) or proceed to part D to log in into your online Strapi project and add your first data from there.
232229
:::
233230

231+
:::tip
232+
Feel free to play with the Content-Type Builder even further and add more fields to your content-types or create new content-types. Anytime you make such changes, deploy them again on Strapi Cloud, by running the appropriate `deploy` command, and see your hosted project updated within a few minutes. Magical, isn't it? 🪄
233+
:::
234+
234235
## 📝 Part D: Add content to your Strapi Cloud project with the Content Manager
235236
236237
Now that we have created a basic data structure with 2 collection types, "Restaurant" and "Category", and deployed your project to Strapi Cloud, let's use the Cloud to actually add content by creating new entries.
@@ -242,7 +243,7 @@ Now that we have created a basic data structure with 2 collection types, "Restau
242243

243244
Now that your Strapi Cloud project is created, let's log in into the project:
244245
245-
1. From your [Strapi Cloud dashboard](https://cloud.strapi.io/projects), click the `my-first-strapi-project` project.
246+
1. From your [Strapi Cloud dashboard](https://cloud.strapi.io/projects), click the `my-strapi-project` project.
246247
3. Click the **Visit app** button.
247248
4. In the new page that opens, complete the form to create the first administrator user of this Strapi Cloud project.
248249
@@ -433,4 +434,5 @@ Now that you know the basics of creating and publishing content with Strapi, we
433434
434435
- 👉 learn how to use Strapi's [REST](/dev-docs/api/rest) API to query the content,
435436
- 👉 learn more about Strapi features by browsing the [User Guide](/user-docs/intro),
437+
- 👉 learn more about Strapi Cloud projects by reading the [Cloud Documentation](/cloud/intro),
436438
- 👉 and [customize your Strapi back end](/dev-docs/backend-customization) and [admin panel](/dev-docs/admin-panel-customization) for advanced use cases.
Loading
Loading
Loading

0 commit comments

Comments
 (0)