Skip to content

Commit

Permalink
update docs to match new cli updates (#488)
Browse files Browse the repository at this point in the history
doc updates for nitric new and stack new commands

---------

Co-authored-by: Ryan Cartwright <39504851+HomelessDinosaur@users.noreply.github.com>
  • Loading branch information
davemooreuws and HomelessDinosaur authored Nov 23, 2023
1 parent 92a9d90 commit c87350e
Show file tree
Hide file tree
Showing 21 changed files with 171 additions and 181 deletions.
1 change: 1 addition & 0 deletions dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ structs
CORs
ci
OSTYPE
fastify

^.+[-:_]\w+$
[a-z]+([A-Z0-9]|[A-Z0-9]\w+)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@ export const description =
We'll start by creating a new project for our API.

```bash
nitric new
```

Create a project, name it and select your preferred starter template.

```bash
? What is the name of the project? my-profile-api
? Choose a template: official/Go - Starter
nitric new my-profile-api "official/Go - Starter (experimental)"
```

Next, open the project in your editor of choice.
Expand Down Expand Up @@ -284,9 +277,9 @@ nitric stack new
```

```
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

### AWS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,16 @@ There is also an extended section of the guide that adds file operations using a

## Getting started

Let's start by creating a new project from a Nitric template, this will provide a base to start building the API.

```bash
nitric new
```

Create a project, name it and select your preferred starter template. In this case, you can choose the Java or Kotlin starter, examples for both are provided.
Let's start by creating a new project from a Nitric template, this will provide a base to start building the API. In this case, you can choose the Java or Kotlin starter, examples for both are provided.

<CodeGroup>

```bash {{ title: "Java" }}
? What is the name of the project? my-profile-api
? Choose a template: official/Java - Starter
nitric new my-profile-api "official/Java - Starter (experimental)"
```

```bash {{ title: "Kotlin" }}
? What is the name of the project? my-profile-api
? Choose a template: official/Kotlin - Starter
nitric new my-profile-api "official/Kotlin - Starter (experimental)"
```

</CodeGroup>
Expand Down Expand Up @@ -383,9 +375,9 @@ nitric stack new
```

```
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

### AWS
Expand Down
2 changes: 1 addition & 1 deletion src/pages/guides/getting-started/local-dashboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Streamline your local development workflow with Nitric's intuitive Local Develop

What's more, the dashboard updates in real-time, so you can stay on top of any changes you make to your application without missing a beat. But that's not all! Nitric is constantly expanding its features and capabilities, so you can look forward to even more exciting features in the future.

To access Nitric's powerful dashboard, simply fire up your Nitric application using the `nitric start` command, and follow the link provided in your terminal. With Nitric's Local Development Dashboard, you'll be able to supercharge your local development experience like never before!
To access Nitric's powerful dashboard, simply fire up your Nitric project using the `nitric start` command, run your application and follow the link provided in your terminal. With Nitric's Local Development Dashboard, you'll be able to supercharge your local development experience like never before!

```bash
$ nitric start
Expand Down
6 changes: 3 additions & 3 deletions src/pages/guides/getting-started/nodejs/api-with-nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,9 @@ nitric stack new
```
```
? What do you want to call your new stack? todo
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? todo
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```
Then, you can deploy with the `up` command.
Expand Down
15 changes: 8 additions & 7 deletions src/pages/guides/getting-started/nodejs/expressjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ To complete this guide you'll need the following:
Let's start by setting up a Nitric project and adding Express.js:

```bash {{ label: 'terminal' }}
nitric new
? What is the name of the project? express-example
? Choose a template: official/JavaScript - Starter
nitric new express-example "official/JavaScript - Starter"
```

Then install dependencies and add express:

# install depedencies and add express
```
cd express-example
yarn install
yarn add express
Expand Down Expand Up @@ -168,9 +169,9 @@ The new stack command can help you create the stack by following prompts. In thi

```txt {{ label: 'terminal' }}
nitric stack new
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

This command will create a file named `nitric-dev.yaml`, with contents like this:
Expand Down
15 changes: 8 additions & 7 deletions src/pages/guides/getting-started/nodejs/fastify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ To complete this guide you'll need the following:
Let's start by setting up a Nitric project and adding Fastify:

```bash {{ label: 'terminal' }}
nitric new
? What is the name of the project? fastify-example
? Choose a template: official/JavaScript - Starter
nitric new fastify-example "official/JavaScript - Starter"
```

Then install dependencies and add fastify:

# install depedencies and add fastify
```
cd fastify-example
yarn install
yarn add fastify
Expand Down Expand Up @@ -173,9 +174,9 @@ The new stack command can help you create the stack by following prompts. In thi

```txt {{ label: 'terminal' }}
nitric stack new
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

This command will create a file named `nitric-dev.yaml`, with contents like this:
Expand Down
15 changes: 4 additions & 11 deletions src/pages/guides/getting-started/nodejs/graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ Here's a video of this guide built with Node.js:
We'll start by creating a new project for our API.

```bash
nitric new
```

Create a project, name it and select your preferred starter template.

```bash
? What is the name of the project? my-profile-api
? Choose a template: official/TypeScript - Starter
nitric new my-profile-api "official/TypeScript - Starter"
```

Next, open the project in your editor of choice.
Expand Down Expand Up @@ -402,9 +395,9 @@ nitric stack new
```

```
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

You can then deploy using the following command:
Expand Down
6 changes: 3 additions & 3 deletions src/pages/guides/getting-started/nodejs/nestjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ You can create a new stack by running `nitric stack new` and following the promp

```txt
nitric stack new
? What do you want to call your new stack? awsdev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? awsdev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

Finally, run the `up` command to deploy the stack and push your code to the cloud:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,10 @@ Now that Supabase and SendGrid are both setup, let's create a new Nitric project
follow the [installation instructions](/guides/getting-started/installation).
</Note>

Follow the prompts with the `new` command to create your project from the JavaScript starter template.
Create a Nitric JavaScript project using the `new` command:

```
nitric new welcome-guide
? Choose a template: official/JavaScript - Starter
? Glob for the function handlers? functions/*.js
nitric new welcome-guide "official/JavaScript - Starter"
```

Next, let's navigate to the project directory and install the npm dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ Let's start with a new nitric project and select the TypeScript starter template

```bash
# create the project
nitric new api-guide
? Choose a template: [Use arrows to move, type to filter]
> official/TypeScript - Starter
official/JavaScript - Starter
nitric new api-guide "official/TypeScript - Starter"

# navigate to the new project directory
cd api-guide
Expand Down Expand Up @@ -506,9 +503,9 @@ You can create a new stack by running `nitric stack new` and following the promp

```txt
nitric stack new
? What do you want to call your new stack? awsdev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? awsdev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

Finally, run the `up` command to deploy the stack and push your code to the cloud:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,10 @@ Here's a video of this guide built with Node.js - [Build and Deploy a REST API f

## Getting started

Let's start by creating a new project from a Nitric template, this will provide a base to start building the API.
Let's start by creating a new project from a Nitric TypeScript template, this will provide a base to start building the API.

```bash
nitric new
```

Create a project, name it and select your preferred starter template. In this case, we'll be using the TypeScript template.

```bash
? What is the name of the project? my-profile-api
? Choose a template: official/TypeScript - Starter
nitric new my-profile-api "official/TypeScript - Starter"
```

Next, open the project in your editor of choice.
Expand Down Expand Up @@ -261,9 +254,9 @@ nitric stack new
```

```
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

### AWS
Expand Down
16 changes: 4 additions & 12 deletions src/pages/guides/getting-started/nodejs/stripe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@ Creating a Stripe checkout backed by a Nitric API and collections. This API will
We'll start by creating a new project for our API.

```bash
nitric new
```

Create a project name, select the TypeScript template and choose the default glob handler.

```bash
? What is the name of the stack? nitric-stripe
? Choose a template: official/TypeScript - Starter
? Glob for the function handlers? functions/*.ts
nitric new nitric-stripe "official/TypeScript - Starter"
```

Next, open the project in your editor of choice.
Expand Down Expand Up @@ -306,9 +298,9 @@ nitric stack new
```

```
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

To deploy the stack run the following command:
Expand Down
5 changes: 1 addition & 4 deletions src/pages/guides/getting-started/nodejs/twilio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ In this guide we'll use the Nitric Framework with [Twilio](https://twilio.com) t
Create a new project using:

```
nitric new
? What is the name of the project? nitric-twilio
? Choose a template: official/TypeScript - Starter
? Glob for the function handlers? functions/*.ts
nitric new nitric-twilio "official/TypeScript - Starter"
```

This will scaffold the project ready for defining your API.
Expand Down
15 changes: 8 additions & 7 deletions src/pages/guides/getting-started/nodejs/websockets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ To complete this guide you'll need the following:
Let's start by setting up a Nitric project:

```bash {{ label: 'terminal' }}
nitric new
? What is the name of the project? websocket-example
? Choose a template: official/Typescript - Starter
nitric new websocket-example "official/TypeScript - Starter"
```

Install dependencies:

# install depedencies and add express
```
cd websocket-example
yarn install
```
Expand Down Expand Up @@ -169,9 +170,9 @@ The new stack command can help you create the stack by following prompts. In thi

```txt {{ label: 'terminal' }}
nitric stack new
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

This command will create a file named `nitric-dev.yaml`, with contents like this:
Expand Down
15 changes: 4 additions & 11 deletions src/pages/guides/getting-started/python/create-histogram.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ We'll be making a serverless application which can take information from a HTTP
We'll start by creating a new project for our API.

```bash
nitric new
```

Create a project, name it and select your preferred starter template.

```bash
? What is the name of the project? histogram-api
? Choose a template: official/Python - Starter
nitric new histogram-api "official/Python - Starter"
```

Next, open the project in your editor of choice.
Expand Down Expand Up @@ -184,9 +177,9 @@ nitric stack new
```

```
? What do you want to call your new stack? dev
? Which Cloud do you wish to deploy to? aws
? select the region us-east-1
? What should we name this stack? dev
? Which provider do you want to deploy with? aws
? Which region should the stack deploy to? us-east-1
```

You can then deploy using the following command:
Expand Down
Loading

0 comments on commit c87350e

Please sign in to comment.