Skip to content

Commit b6cc267

Browse files
committed
docs: standardise readmes
1 parent cf09fdf commit b6cc267

File tree

47 files changed

+148
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+148
-54
lines changed

actix-web/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Actix Web with shuttle
1+
# Actix Web with Shuttle
22

33
Normally one would configure an application with [Actix Web](https://docs.rs/actix-web/latest/actix_web/index.html) using the [App](https://docs.rs/actix-web/latest/actix_web/struct.App.html) struct. However, shuttle needs to move the users configuration across threads to start the server on our backend, and the `App` struct is `!Send` and `!Sync`.
44

actix-web/clerk/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using Clerk auth with a Rust Actix web backend
1+
# Actix Web with Clerk auth
22

33
This template uses Actix-web and the clerk-rs crate for providing authentication from Clerk in the backend.
44

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Cookie authentication with actix-session
1+
# Actix Web Cookie authentication with actix-session
22

33
This template uses the [actix_identity](https://docs.rs/actix-identity) and [actix_session](https://docs.rs/actix-session) crates to manage user sessions.
44

5+
## How to use
6+
57
Running the project and visiting <http://localhost:8000> will show the currently logged in user.
68
Visiting <http://localhost:8000/login> will log you in as `user1` (no authentication logic is in place).
79
Visiting <http://localhost:8000/logout> will log you out again.

actix-web/hello-world/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Actix Web Hello World
2+
13
A `Hello world!` example for using Actix Web with Shuttle.
24

3-
## Example usage
5+
## How to use this template
46

57
Run the app and go to <http://localhost:8000>.

actix-web/postgres/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Shuttle shared Postgres DB with Actix Web
1+
# Actix Web with Shuttle Shared DB (Postgres)
22

33
This template shows how to connect a Postgres database and use it for a simple TODO list app.
44

5-
## Example usage
5+
## How to use this template:
6+
7+
Run the project then run the following `curl` commands below:
68

79
```bash
810
curl -X POST -H 'content-type: application/json' localhost:8000/todos --data '{"note":"My todo"}'

actix-web/static-files/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Actix Web static files
1+
## Actix Web Static Files
22

33
This template uses `actix_files` to serve the files in the `assets` directory.
44

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Actix Web actorless websockets
1+
# Actix Web Actorless Websockets
22

33
This template shows how to use actorless websockets to build an API monitoring service and a simple chat app.
44

5-
## Example usage
5+
## How to use this template
66

77
Run the app and go to <http://localhost:8000>.

axum/hello-world/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Axum Hello World
2+
13
A `Hello world!` example for using Axum with Shuttle.
24

3-
## Example usage
5+
## How to use this template
46

57
Run the app and go to <http://localhost:8000>.

axum/htmx-crud/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Axum + htmx
1+
# Axum with HTMx
22

33
This is an example of how you can use Shuttle with Axum, Askama and htmx to create a frontend that's easily extendable and requires zero framework knowledge, while being able to easily inject variables from the backend into the frontend.
44

55
The app is a TODO list with a main page and an event stream page.
66

7-
## Usage
7+
## How to use this template
88

99
Run the app and go to <http://localhost:8000> to add and remove TODOs from the list.

axum/jwt-authentication/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
# JWT authentication in Axum
1+
# Axum JWT authentication
22

33
This template uses the `jsonwebtoken` crate to encode and decode claims in a JWT, which clients use in the Authorization HTTP header to access protected resources (endpoints).
4+
5+
## Example usage
6+
7+
Run the app and go to <http://localhost:8000>.

axum/metadata/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Axum with Shuttle metadata
2+
13
An example that showcases Shuttle metadata at the base route using Axum.
24

3-
## Example usage
5+
## How to use this template
46

57
Run the app and go to <http://localhost:8000>.

axum/oauth2/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Google OAuth in Axum
1+
# Axum with Google OAuth
22

33
This template is an example of how you can implement Google OAuth using the Axum web framework in Rust.
44

5-
## Prerequisites
5+
## How to use this template
66

77
Make sure you set up your Google OAuth, which you can find a link to set up [here.](https://console.cloud.google.com/apis/dashboard)
88

axum/openai/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
# Axum with OpenAI
2+
13
A simple endpoint that sends a chat message to ChatGPT and returns the response.
24

5+
## How to use this template
6+
37
Set your OpenAI API key in `Secrets.toml`, then try it on a local run with:
48

59
```sh

axum/postgres/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Shuttle shared Postgres DB with Axum
1+
# Axum with Shuttle Shared DB (Postgres)
22

33
This template shows how to connect a Postgres database and use it for a simple TODO list app.
44

5-
## Example usage
5+
## How to use this template
6+
7+
Run the project then try the following `curl` commands:
68

79
```bash
810
curl -X POST -H 'content-type: application/json' localhost:8000/todos --data '{"note":"My todo"}'

axum/qdrant/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Connect to a Qdrant Cloud DB from Shuttle
1+
# Axum with Qdrant on Shuttle
22

33
This example shows how to use `shuttle-qdrant` to connect to a Qdrant vector database from Shuttle.
44

5-
## Prerequisites
5+
## How to use this template
66

77
Go to [Qdrant](https://qdrant.tech/) and start a database.
88
Paste the URL and API key in the Secrets.toml file.

axum/static-files/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# Serving Static Assets with Axum
1+
# Axum with Static Assets
22

33
This example shows how to serve static assets using [axum](https://github.com/tokio-rs/axum) and Shuttle.
44

55
This example is inspired by the static-file-server example from the axum repo, to see more ways to do this check out the [original](https://github.com/tokio-rs/axum/blob/main/examples/static-file-server/src/main.rs).
6+
7+
## Example usage
8+
9+
Run the project and visit <http://localhost:8000>.

axum/turso/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Axum with Turso
2+
13
An example that showcases using Turso with Axum and Shuttle.
24

3-
## Example usage
5+
## How to use this template
46

57
Set your `TURSO_DB_TOKEN` in Secrets.toml and Turso database in `src/main.rs` in the annotation.
68

axum/websocket/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Axum with Websockets
2+
13
This template shows how to use websockets with Axum in a Shuttle project.
24

3-
## Example usage
5+
## How to use this template
46

57
Run the project and visit <http://localhost:8000> to try it out.

bevy/hello-world/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Bevy on Shuttle (with Axum)
2+
13
Example of how you can compile Bevy to WASM and run it on Shuttle.
24

3-
## Instructions
5+
## How to use this template
46

57
Make sure you have `wasm-bindgen-cli` and the rustup `wasm32-unknown-unknown` compilation target added. If you don't, you can get them by running the following:
68
```bash

custom-resource/pdo/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Custom Shuttle Resource
2+
13
This template shows how to create your own custom Shuttle resource in a Shuttle project, using Axum for the `main.rs` file to set up the router.
24

3-
## Example usage
5+
## How to use this template
46

57
Run the project and visit <http://localhost:8000>.

custom-service/none/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Shuttle Custom Service
2+
13
This template shows how to create your own custom Shuttle service that can run anything HTTP-based.
24

3-
## Example usage
5+
## How to use this template
46

57
Set up whatever you want to do in the `bind()` function, then visit <http://localhost:8000> (or your relevant routes) to try it out.
68

fullstack-templates/saas/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ users will be able to view their customers, sales records as well as some analyt
2121
- Typescript.
2222
- [cargo-shuttle](https://www.shuttle.rs)
2323

24-
## Instructions for Usage
24+
## How to use this template
2525

2626
- Initialize the template with:
2727

loco/hello-world/README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ Welcome to the [Loco](https://loco.rs) Hello World Shuttle Template, designed wi
1414

1515
So see more Loco features, check out our [documentation website](https://loco.rs/docs/getting-started/tour/).
1616

17-
## Quick Start
17+
## How to use this template
1818

19-
To launch your app, simply use the following command:
20-
21-
```sh
22-
shuttle run
23-
```
19+
Run the project and visit <http://localhost:8000>.

other/feature-flags/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Cargo Feature Flags with Shuttle
2+
13
An example that showcases how to use feature flags with Shuttle (see `Cargo.toml`).
24

3-
## Example usage
5+
## How to use this template
46

57
Run the project and visit <http://localhost:8000>.

other/standalone-binary/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ All startup logic is placed in the binary source files, while the implementation
88
- `src/bin/standalone.rs` is without Shuttle, run with `cargo run --bin standalone` (you can change the name)
99

1010
This example shows how to use separate logic for getting secrets (Shuttle secrets vs homemade solution), but the same approach can be applied to other resources that are initiated by Shuttle's main function.
11+
12+
## How to use this template
13+
14+
Run the project and visit <http://localhost:8000>.
15+
16+
You can use `cargo run --bin standalone` to run the non-Shuttle binary.

poem/hello-world/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
An example that showcases using the `poem` web service framework with Shuttle.
1+
# Poem Hello World
22

3-
## Example usage
3+
An example that showcases using the `poem` web service framework with shuttle.
4+
5+
## How to use this template
46

57
Run the project and visit <http://localhost:8000>.

poise/hello-world/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
In this example we will deploy a Poise/Serenity bot with Shuttle that responds to the `/hello` command with `world!`. To run this bot we need a valid Discord Token. To get started log in to the [Discord developer portal](https://discord.com/developers/applications).
44

5+
## How to use this template
6+
57
1. Click the New Application button, name your application and click Create.
68
2. Navigate to the Bot tab in the lefthand menu, and add a new bot.
79
3. On the bot page click the Reset Token button to reveal your token. Put this token in your `Secrets.toml`. It's very important that you don't reveal your token to anyone, as it can be abused. Create a `.gitignore` file to omit your `Secrets.toml` from version control.

rocket/dyn-templates/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# Rendering Handlebars dynamic templates with Rocket
1+
# Rocket with dynamic templates using Handlebars
22

33
This example shows how to render templated content using Handlebars templates from [rocket](https://github.com/SergioBenitez/Rocket/) and shuttle.
44

55
This example is inspired by templating example from the rocket repo, to see more ways to do this checkout the [original](https://github.com/SergioBenitez/Rocket/tree/master/examples/templating).
6+
7+
## How to use
8+
9+
Run the project and visit <http://localhost:8000>.

rocket/hello-world/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Rocket Hello World
2+
13
An example that showcases using the `rocket` web service framework with Shuttle.
24

3-
## Example usage
5+
## How to use this template
46

57
Run the project and visit <http://localhost:8000>.

rocket/jwt-authentication/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Issue and verify JWT for authentication
1+
# Rocket with JWT authentication
22

33
This example shows how to use [Rocket request guards](https://rocket.rs/v0.5-rc/guide/requests/#request-guards) for authentication with [JSON Web Tokens](https://jwt.io/) (JWT for short).
44
The idea is that all requests authenticate first at <https://authentication-rocket-app.shuttleapp.rs/login> to get a JWT.
@@ -35,7 +35,7 @@ shuttle deploy
3535

3636
Now make a note of the `Host` for the deploy to use in the examples below. Or just use `authentication-rocket-app.shuttleapp.rs` as the host below.
3737

38-
### Seeing it in action
38+
## How to use this template
3939

4040
First, we should be able to access the public endpoint without any authentication using:
4141

rocket/opendal-memory/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@ The project consists of the following files
88

99
- `Shuttle.toml` contains the name of the app
1010
- `src/main.rs` is where all the magic happens - it creates a Shuttle service with two endpoints: one for adding new data and one for retrieving it back.
11+
12+
## How to use this template
13+
14+
Run the project, then try out the following `curl` command:
15+
16+
```bash
17+
curl -X POST -H 'content-type: application/json' localhost:8000/todo --data '{"note":"My todo"}'
18+
# {"id":1,"note":"My todo"}
19+
```

rocket/postgres/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Shuttle shared Postgres DB with Rocket
1+
# Rocket with Shuttle Shared DB (Postgres)
22

33
This template shows how to connect a Postgres database and use it for a simple TODO list app.
44

5-
## Example usage
5+
## How to use this template
6+
7+
Run the project then try the following `curl` commands:
68

79
```bash
810
curl -X POST -H 'content-type: application/json' localhost:8000/todo --data '{"note":"My todo"}'

rocket/secrets/README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
## How to use
1+
## Using Shuttle Secrets with Rocket
2+
3+
This example shows how to use secrets using [rocket](https://github.com/rwf2/rocket) and Shuttle.
4+
25
The secrets resource requires a `Secrets.toml` file to be present in your crate. Each like in this file
36
should be a key-value pair that you can access using `SecretStore::get(&self, key)`.
47

8+
## How to use
9+
510
Rename `Secrets.toml.example` to `Secrets.toml` to use this example.
11+
12+
Once done, run the example and visit <http://localhost:8000>.

rocket/static-files/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
# Serving Static Assets with Rocket
1+
## Serving Static Assets with Rocket
22

33
This example shows how to serve static assets using [rocket](https://github.com/rwf2/rocket) and Shuttle.
4+
5+
## Example usage
6+
7+
Run the project and visit <http://localhost:8000>.

rocket/url-shortener/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Url Shortener
1+
# Rocket URL Shortener
22

33
A URL shortener that you can use from your terminal - built with shuttle, rocket and postgres/sqlx.
44

5-
## How to use it
5+
## How to use this template
66

77
You can use this URL shortener directly from your terminal. Just copy and paste this command to your terminal and replace `<URL>` with the URL that you want to shorten
88

rocket/workspace/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# Rocket with Cargo Workspaces
12
This example shows how to use a Cargo workspace with Shuttle using the `rocket` web service frameowrk.
23

3-
## Example usage
4+
## How to use this template
45

56
Run the project and visit <http://localhost:8000>.

salvo/hello-world/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Salvo Hello World
2+
13
An example that showcases using the `salvo` web service framework with Shuttle.
24

3-
## Example usage
5+
## How to use this template
46

57
Run the project and visit <http://localhost:8000>.

salvo/image-rescaler/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# Image rescaler
1+
# Salvo image rescaler
22

33
This is a simple example showing how to use path parameters in Salvo and the `image` crate to load and manipulate an image.
44

5+
## How to use this template
6+
57
Running the project and going to `/400/400` returns the Shuttle logo image but rescaled to 400 x 400 pixels.

serenity/hello-world/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
In this example we will deploy a Serenity bot with Shuttle that responds to the `!hello` command with `world!`. To run this bot we need a valid Discord Token. To get started log in to the [Discord developer portal](https://discord.com/developers/applications).
44

5+
## How to use this template
6+
57
1. Click the New Application button, name your application and click Create.
68
2. Navigate to the Bot tab in the lefthand menu, and add a new bot.
79
3. On the bot page click the Reset Token button to reveal your token. Put this token in your `Secrets.toml`. It's very important that you don't reveal your token to anyone, as it can be abused. Create a `.gitignore` file to omit your `Secrets.toml` from version control.

0 commit comments

Comments
 (0)