Skip to content

Commit

Permalink
docs: split docs into tabs, update links (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 authored Feb 8, 2024
1 parent fd5548f commit 80e551b
Show file tree
Hide file tree
Showing 27 changed files with 197 additions and 264 deletions.
2 changes: 1 addition & 1 deletion examples/actix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This section revolves around simple Actix examples you can get quickly started w
2. Copy pasting the contents of the example you want to deploy -- make sure to check the tabs of the snippet(s) to ensure you are copying the right code/file
3. Running the `cargo shuttle deploy` command

<Tip>If you are looking for step-by-step guides, check out our [How To](../tutorials) section.</Tip>
<Tip>If you are looking for step-by-step guides, check out our [Tutorials](/templates/tutorials) section.</Tip>

You can clone the example below by running the following (you'll need `cargo-shuttle` installed):
```bash
Expand Down
2 changes: 1 addition & 1 deletion examples/axum.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This section revolves around simple Axum examples you can get quickly started wi
2. Copy pasting the contents of the example you want to deploy -- make sure to check the tabs of the snippet(s) to ensure you are copying the right code/file
3. Running the `cargo shuttle deploy` command

<Tip>If you are looking for step-by-step guides, check out our [How To](../tutorials) section.</Tip>
<Tip>If you are looking for step-by-step guides, check out our [Tutorials](/templates/tutorials) section.</Tip>

You can clone the example below by running the following (you'll need `cargo-shuttle` installed):

Expand Down
3 changes: 2 additions & 1 deletion examples/examples-repo-link.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: "All Examples"
url: "https://github.com/shuttle-hq/shuttle-examples"
url: "https://github.com/shuttle-hq/shuttle-examples#readme"
icon: "github"
---
14 changes: 14 additions & 0 deletions examples/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Overview"
---

This section of the docs allows you to browse the various starter examples available on the [shuttle-examples](https://github.com/shuttle-hq/shuttle-examples#readme).

For more feature complete starter templates and tutorials, check out the [Templates and Tutorials](/templates).

Here are some relevant links to help you find what you're looking for:

- [Shuttle Examples repo](https://github.com/shuttle-hq/shuttle-examples#readme) - contains all officially maintained examples and starter templates.
- [Shuttle Community Templates](https://github.com/shuttle-hq/shuttle-examples#community-examples) - a list of more templates made by the community.
- [Awesome Shuttle](https://github.com/shuttle-hq/awesome-shuttle#readme) - A list of awesome projects built on Shuttle.
- [Shuttlings](https://github.com/shuttle-hq/shuttlings) - A collection of code challenges that also happens to be a good tutorial for backend development on Shuttle.
2 changes: 1 addition & 1 deletion examples/rocket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This section revolves around simple Rocket examples you can get quickly started
2. Copy pasting the contents of the example you want to deploy -- make sure to check the tabs of the snippet(s) to ensure you are copying the right code/file
3. Running the `cargo shuttle deploy` command

<Tip>If you are looking for step-by-step guides, check out our [How To](../tutorials) section.</Tip>
<Tip>If you are looking for step-by-step guides, check out our [Tutorials](/templates/tutorials) section.</Tip>

You can clone the example below by running the following (you'll need `cargo-shuttle` installed):
```bash
Expand Down
32 changes: 14 additions & 18 deletions examples/shuttle-next.mdx
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
---
title: "Shuttle-next"
description:
"Shuttle-next is a batteries-included, WASM-based backend web-framework."
title: "Shuttle Next"
---

Shuttle-next is a brand new WASM web-framework based on axum and hyper. There are many benefits to
Shuttle-next is a brand new WASM web-framework based on Axum and Hyper. There are many benefits to
using WASM for a backend web-framework, but one of the key features is the isolation it offers. Since
WASM modules have no notion of a file system, a shuttle-next project can only interact with the host
through resources explicitly declared by us. In this first iteration, the only resource available is
an HTTP stream to and from a project.

Shuttle-next is very much a work in progress, and we're releasing this iteration without some of the
features that make shuttle a pleasure to use, for example the ability to effortlessly deploy and connect
to a database. It's also not currently possible to use any middleware. We're planning to implement this
functionality, and more, in the near future. We're also hoping that the feedback we get from this release
will help us see which features we should prioritize, and which areas of the framework's design need the
Shuttle-next is very much a work in progress, and we're releasing this iteration without some of the
features that make shuttle a pleasure to use, for example the ability to effortlessly deploy and connect
to a database. It's also not currently possible to use any middleware. We're planning to implement this
functionality, and more, in the near future. We're also hoping that the feedback we get from this release
will help us see which features we should prioritize, and which areas of the framework's design need the
most attention going forward.

> Note: shuttle-next does not currently work on Windows, it only works on unix systems (i.e mac, Linux and
> Windows Subsystem for Linux). We aim to resolve this in future releases.
<Info> Note: shuttle-next does not currently work on Windows, it only works on unix systems (i.e mac, Linux and Windows Subsystem for Linux). We aim to resolve this in future releases. </Info>

## Hello world!

Simple 'Hello world' app using shuttle-next.
Simple 'Hello world' app using Shuttle Next.

```bash
cargo new --lib hello-world
cd hello-world
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
You'll also notice that this is a `cdylib` and not a binary, like other shuttle projects.
You'll also notice that this is a `cdylib` and not a binary, like other Shuttle projects.

```toml Cargo.toml
[package]
Expand Down Expand Up @@ -82,19 +78,19 @@ We can also add an endpoint that takes the body from the request using the axum
extractor, lazily map its bytes to uppercase and stream it back in our response:

First, lets add the `futures` crate to our `Cargo.toml`:
```
```bash
cargo add futures
```

```rust lib.rs
shuttle_next::app! {
// We need to add some imports (inside the app! macro),
// We need to add some imports (inside the app! macro),
// all re-exported from axum 0.6
use shuttle_next::body::StreamBody;
use shuttle_next::extract::BodyStream;
use shuttle_next::response::{Response, IntoResponse};
// We'll also need the futures `TryStreamExt` trait to manipulate

// We'll also need the futures `TryStreamExt` trait to manipulate
// the body stream
use futures::TryStreamExt;

Expand Down
49 changes: 0 additions & 49 deletions fullstack/saas-template.mdx

This file was deleted.

14 changes: 10 additions & 4 deletions getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,26 @@ cargo shuttle init

![Shuttle Scaffolding](/images/actix-scaffold-demo.gif)

If you didn't create the project environment in the init command, run:
You can then `cd` into the folder and try the app locally:

```sh
cargo shuttle run
```

In case you didn't create the project environment in the `init` command, run:

```sh
cargo shuttle project start
```

And to deploy it:
Then, the app can be deployed with:

```sh
cargo shuttle deploy --allow-dirty
```

<Info>`--allow-dirty` allows deploying without your changes being committed to git.</Info>
<Info>`--allow-dirty` or `--ad` allows deploying with uncommitted git changes.</Info>

You can also run your project locally for development, check out our [local run](./local-run) section.

Feel free to build on top of the generated "Hello, World!" project or check out one of our [examples](../examples/axum).
Feel free to build on top of the generated "Hello, World!" project or check out one of our [examples](/examples) or [templates](/templates).
2 changes: 1 addition & 1 deletion getting-started/shuttle-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ All project-related commands can use:
### Manage resources

- `cargo shuttle resource list`: List resources linked to this project.
- `cargo shuttle resource delete <type>`: Delete a resource. Thus far, only databases can be deleted with this command.
- `cargo shuttle resource delete <type>`: Delete a resource such as databases and secrets.

### Shell completions

Expand Down
21 changes: 19 additions & 2 deletions introduction/welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,38 @@ icon: "hand-wave"
<Card
title="Examples"
icon="book"
href="/examples/axum"
href="/examples"
color="#f8b5F2"
>
Check out some Shuttle examples
</Card>
<Card
title="Templates"
icon="sparkles"
href="/templates"
color="#ffdf54"
>
Get started from one of many templates
</Card>
<Card
title="Tutorials"
icon="list-check"
href="/templates/tutorials"
color="#a26"
>
Follow one of our tutorials
</Card>
<Card
title="Migration"
icon="Rocket"
href="/migration/migrating-to-shuttle"
color="#fb7f14"
>
Migrate an existing project to Shuttle
</Card>
</CardGroup>

---
###

<CardGroup>
<Card
Expand Down
6 changes: 3 additions & 3 deletions introduction/what-is-shuttle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Shuttle is a Rust-native cloud development platform that lets you
icon: "question"
---

![](/images/infra-from-code.gif)
![infra-from-code](/images/infra-from-code.gif)

<Info>The GIF above demonstrates how easy it is to add resources to your project, visualized with the [Shuttle Console](https://console.shuttle.rs/).</Info>

Expand Down Expand Up @@ -42,11 +42,11 @@ To make life easier we have implemented all the boilerplate required for these R
- [Poem](/examples/other)
- [Tide](/examples/other)
- [Thruster](/examples/other)
- [shuttle-next](/shuttle-next/overview)
- [shuttle-next](/examples/shuttle-next)

The Discord Bot building frameworks [Serenity](/examples/serenity) and [Poise](/examples/poise) are also officially supported.

If you need a custom service, you can take a look at our guide [right here](../tutorials/custom-service).
If you need a custom service, you can take a look at our guide [right here](/templates/tutorials/custom-service).

## Resource Provisioning

Expand Down
Loading

0 comments on commit 80e551b

Please sign in to comment.