From 38d95adc0170d8a187dcbddcb7675163ecad27b5 Mon Sep 17 00:00:00 2001 From: Amy Haywood Dutton Date: Thu, 6 Jul 2023 17:21:58 -0500 Subject: [PATCH] Added documentation for the Create Redwood App (#8777) **Notion ID:** [CTL-282](https://www.notion.so/redwoodjs/Add-documentation-for-all-the-prompts-that-are-included-aaaab2be79cf4bb69dbf3962a5bd03a8?pvs=4) ## Feature description Added documentation for the Create Redwood App. This doc includes - All the prompts that the Create Redwood App wil ask you. - Instructions for running some of the commands manually - Information about all the flags available ## Related PRs: #8673 includes a doc for working with nvm. I linked to the doc created within that PR. --- docs/docs/create-redwood-app.md | 102 ++++++++++++++++++++++++++++++++ docs/sidebars.js | 1 + 2 files changed, 103 insertions(+) create mode 100644 docs/docs/create-redwood-app.md diff --git a/docs/docs/create-redwood-app.md b/docs/docs/create-redwood-app.md new file mode 100644 index 000000000000..51ed1ec6a60e --- /dev/null +++ b/docs/docs/create-redwood-app.md @@ -0,0 +1,102 @@ +--- +slug: create-redwood-app +description: Instructions and usage examples for Create Redwood App +--- + +# Create Redwood App + +To get up and running with Redwood, you can use Create Redwood App: + +```terminal +yarn create redwood-app +``` + +## Set up for success +Redwood requires that you're running Node version 18.0.0 or higher. + +If you're running Node version 19.0.0 or higher, you can still use Create Redwood App, but it may make your project incompatible with some deploy targets, such as AWS Lambdas. + +To see what version of Node you're running, you can run the following command in your terminal: + +```terminal +node -v +``` + +If you need to update your version of Node or run multiple versions of Node, we recommend installing nvm and have [documentation about how to get up and running.](/docs/how-to/using-nvm) + +You also need to have yarn version 1.15 or higher installed. To see what version of yarn you're running, you can run the following command in your terminal: + +```terminal +yarn -v +``` + +To upgrade your version of yarn, [you can refer to the yarn documentation](https://yarnpkg.com/getting-started/install). + +## What you can expect + +### Select your preferred language +Options: TypeScript (default) or JavaScript + +If you choose JavaScript, you can always [add TypeScript later](/docs/typescript/introduction#converting-a-javascript-project-to-typescript). + +### Do you want to initialize a git repo? +Options: yes (default) or no + +If you mark "yes", then it will ask you to **Enter a commit message**. The default is message is "Initial commit." + +You can always initialize a git repo later and add a commit message by running the following commands in your terminal: + +```terminal +git init +git add . +git commit -m "Initial commit" +``` + +If you're new to git, here's a recommended playlist on YouTube: [git for Beginners](https://www.youtube.com/playlist?list=PLrz61zkUHJJFmfTgOVL1mBw_NZcgGe882) + +### Do you want to run `yarn install`? +Options: yes (default) or no + +_NOTE: This prompt will only display if you're running yarn, version 1._ + +This command will download all of your project's dependencies. + +If you mark "no", you can always run this command later: + +```terminal +cd +yarn install +``` + +## Running the development server + +Once the Create Redwood app has finished running, you can start your development server by running the following command: + +```terminal +cd +yarn install +yarn rw dev +``` + +- This will start your development server at `http://localhost:8910`. +- Your API will be available at `http://localhost:8911`. +- You can visit the Redwood GraphQL Playground at `http://localhost:8911/graphql`. + +## Flags +You can by pass these prompts by using the following flags: + +| Flag | Alias | What it does | +| :--- | :--- | :--- | +| `--yarn-install` | | Run `yarn install` | +| `--typescript` | `ts` | Set TypeScript as the preferred language (default to JavaScript) | +| `--overwrite` | | Overwrites the existing directory, if it has the same name | +| `--git-init` | `git` | Initializes a git repository | +| `--commit-message "Initial commit"` | `m` | Specifies the initial git commit message | + +For example, here's the project with all flags enabled: + +```terminal +yarn create redwood-app --typescript --git-init --commit-message "Initial commit" --yarn-install +``` + + diff --git a/docs/sidebars.js b/docs/sidebars.js index 46c9266cf39f..5845c0378a0a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -101,6 +101,7 @@ module.exports = { 'contributing-overview', 'contributing-walkthrough', 'cors', + 'create-redwood-app', 'custom-web-index', 'data-migrations', {