diff --git a/community/contribute.mdx b/community/contribute.mdx index 79d6af7..cc98de1 100644 --- a/community/contribute.mdx +++ b/community/contribute.mdx @@ -1,6 +1,6 @@ --- title: Contributing -description: "This document describes the best way to get started with contributing to Shuttle" +description: "Learn about the best way to get started with contributing to Shuttle." icon: "code-pull-request" --- diff --git a/community/get-involved.mdx b/community/get-involved.mdx index 3769381..b99fd12 100644 --- a/community/get-involved.mdx +++ b/community/get-involved.mdx @@ -1,5 +1,6 @@ --- title: "Get Involved" +description: "Learn how to get involved with Shuttle." icon: "hand-holding-hand" --- @@ -25,7 +26,7 @@ If you are wondering what the best way is to get involved, here's how: Go to @shuttle_dev on Twitter diff --git a/community/open-source.mdx b/community/open-source.mdx index 9f58d4f..6fda9c1 100644 --- a/community/open-source.mdx +++ b/community/open-source.mdx @@ -1,5 +1,6 @@ --- title: "Open Source" +description: "Learn about how to get involved with the open source side of Shuttle." icon: "osi" --- diff --git a/examples/examples-repo-link.mdx b/examples/examples-repo-link.mdx index 49dc1f7..3e56119 100644 --- a/examples/examples-repo-link.mdx +++ b/examples/examples-repo-link.mdx @@ -2,4 +2,5 @@ title: "All Examples" url: "https://github.com/shuttle-hq/shuttle-examples#readme" icon: "github" +noindex: true --- diff --git a/examples/other.mdx b/examples/other.mdx index efa2196..250f4de 100644 --- a/examples/other.mdx +++ b/examples/other.mdx @@ -1,4 +1,8 @@ -This section contains examples for the following frameworks: Tower, Warp, Salvo, Poem, Thruster, and Tide. +--- +title: "Other Examples" +description: "This section contains examples for the following frameworks: Tower, Warp, Salvo, Poem, Thruster, and Tide." +icon: "github" +--- ### Hello World diff --git a/examples/serenity-todo.mdx b/examples/serenity-todo.mdx index 7383663..187c739 100644 --- a/examples/serenity-todo.mdx +++ b/examples/serenity-todo.mdx @@ -1,5 +1,6 @@ --- title: "Todo List Bot" +description: "Learn how to write a Serenity bot that can manage a to-do list." --- ### Prerequisites diff --git a/integrations/custom-resources.mdx b/integrations/custom-resources.mdx index a172861..46c5700 100644 --- a/integrations/custom-resources.mdx +++ b/integrations/custom-resources.mdx @@ -1,5 +1,6 @@ --- title: "Custom Resources" +description: "This example shows how you can make a custom Shuttle resource annotation." icon: "toolbox" --- diff --git a/integrations/shuttle-openai.mdx b/integrations/shuttle-openai.mdx index 5d02228..23aa8d0 100644 --- a/integrations/shuttle-openai.mdx +++ b/integrations/shuttle-openai.mdx @@ -1,5 +1,6 @@ --- title: "OpenAI" +description: "Learn about Shuttle's OpenAI resource annotation." icon: "microchip" --- diff --git a/integrations/shuttle-opendal.mdx b/integrations/shuttle-opendal.mdx index 5c0fe71..82e87c0 100644 --- a/integrations/shuttle-opendal.mdx +++ b/integrations/shuttle-opendal.mdx @@ -1,5 +1,6 @@ --- title: "Apache OpenDAL" +description: "Learn about Shuttle's OpenDAL resource annotation." icon: "database" --- This plugin allows services to connect to [Apache OpenDAL™](https://github.com/apache/opendal). OpenDAL is a data access layer that allows users to easily and efficiently retrieve data from various storage services in a unified way. diff --git a/integrations/shuttle-turso.mdx b/integrations/shuttle-turso.mdx index 6a5e2e7..20c1652 100644 --- a/integrations/shuttle-turso.mdx +++ b/integrations/shuttle-turso.mdx @@ -1,5 +1,6 @@ --- title: "Turso" +description: "Learn about how to use Shuttle with Turso, a distributed SQLite cloud service." icon: "database" --- diff --git a/introduction/docs.mdx b/introduction/docs.mdx index 8b0bc2e..482ad14 100644 --- a/introduction/docs.mdx +++ b/introduction/docs.mdx @@ -84,7 +84,7 @@ icon: "hand-wave" title="Follow us on Twitter" icon="twitter" color="#1DA1F2" - href="https://twitter.com/shuttle_dev" + href="https://x.com/shuttle_dev" > Go to @shuttle_dev on Twitter diff --git a/introduction/how-shuttle-works.mdx b/introduction/how-shuttle-works.mdx index c233518..6c2185b 100644 --- a/introduction/how-shuttle-works.mdx +++ b/introduction/how-shuttle-works.mdx @@ -1,5 +1,6 @@ --- title: "How Shuttle works" +description: "Learn about how Shuttle works." icon: "puzzle-piece" --- diff --git a/migrations/frameworks/actix-web.mdx b/migrations/frameworks/actix-web.mdx index aac06c5..8e7d94a 100644 --- a/migrations/frameworks/actix-web.mdx +++ b/migrations/frameworks/actix-web.mdx @@ -1,7 +1,6 @@ --- title: "Actix Web" description: "How to migrate a web service that uses Actix Web to Shuttle" - --- ## Reference diff --git a/platform-update/platform-update.mdx b/platform-update/platform-update.mdx index 4e3b275..7887032 100644 --- a/platform-update/platform-update.mdx +++ b/platform-update/platform-update.mdx @@ -17,14 +17,14 @@ Introducing the new Shuttle platform! We've supercharged what developers love ab ### Access the NEW platform -- New Console: [console.shuttle.dev](http://console.shuttle.dev) -- New Docs: [docs.shuttle.dev](http://docs.shuttle.dev) +- New Console: [console.shuttle.dev](https://console.shuttle.dev) +- New Docs: [docs.shuttle.dev](https://docs.shuttle.dev) - Command Line: new `shuttle` command (installed alongside `cargo shuttle`) ### Access the OLD platform (for existing users) -- Old Console: [console.shuttle.rs](http://console.shuttle.rs) -- Old Docs: [docs.shuttle.rs](http://docs.shuttle.rs) +- Old Console: [console.shuttle.rs](https://console.shuttle.rs) +- Old Docs: [docs.shuttle.rs](https://docs.shuttle.rs) - Command Line: `cargo shuttle` (unchanged) ## Changelog diff --git a/resources/resources.mdx b/resources/resources.mdx index 4ca55f1..367ea96 100644 --- a/resources/resources.mdx +++ b/resources/resources.mdx @@ -1,5 +1,6 @@ --- title: "Resources" +description: "Learn about the resources that are officially supported by Shuttle." icon: "boxes-stacked" --- diff --git a/resources/shuttle-shared-db.mdx b/resources/shuttle-shared-db.mdx index b971d7a..3199ae0 100644 --- a/resources/shuttle-shared-db.mdx +++ b/resources/shuttle-shared-db.mdx @@ -1,5 +1,6 @@ --- title: "Shuttle Shared Databases" +description: "Learn about the Shuttle Shared Database resource." icon: "database" --- diff --git a/support/faq.mdx b/support/faq.mdx index 07d777e..17253d4 100644 --- a/support/faq.mdx +++ b/support/faq.mdx @@ -1,5 +1,6 @@ --- title: "Frequently Asked Questions" +description: "Learn about the most frequently asked questions from Shuttle users." icon: "comment-question" --- diff --git a/support/troubleshooting.mdx b/support/troubleshooting.mdx index a2e5829..ac4feae 100644 --- a/support/troubleshooting.mdx +++ b/support/troubleshooting.mdx @@ -1,5 +1,6 @@ --- title: "Troubleshooting" +description: "Learn about how to solve common problems you might run into while using Shuttle." icon: "bug" --- diff --git a/templates/fullstack/saas-template.mdx b/templates/fullstack/saas-template.mdx index 6349cdf..bf2e013 100644 --- a/templates/fullstack/saas-template.mdx +++ b/templates/fullstack/saas-template.mdx @@ -1,5 +1,6 @@ --- title: "SaaS Starter Template" +description: Learn how you can deploy a fully working SaaS template using Next.js & Rust. --- We've created a SaaS template that you can use to get started quickly with a fullstack Rust + Next.js app. diff --git a/templates/overview.mdx b/templates/overview.mdx index 9ccf54a..f687d18 100644 --- a/templates/overview.mdx +++ b/templates/overview.mdx @@ -1,5 +1,6 @@ --- title: "Overview" +description: "Learn more about the official Shuttle templates." 'og:title': "Shuttle Templates - Overview" --- diff --git a/templates/tutorials/authentication.mdx b/templates/tutorials/authentication.mdx index e359ff6..5266959 100644 --- a/templates/tutorials/authentication.mdx +++ b/templates/tutorials/authentication.mdx @@ -1,5 +1,6 @@ --- title: "Authentication" +description: "Learn how to implement authentication using Rust." --- Most websites have some kind of user system. But implementing authentication can diff --git a/templates/tutorials/databases-with-rust.mdx b/templates/tutorials/databases-with-rust.mdx index 06336bb..0d9fd5c 100644 --- a/templates/tutorials/databases-with-rust.mdx +++ b/templates/tutorials/databases-with-rust.mdx @@ -1,12 +1,13 @@ --- title: "Working with Databases in Rust" +description: "Learn how to work with databases using Rust." --- In this guide we'll be looking at working with PostgresQL & `shuttle-persist` (Shuttle's key-value data store) and how we can interface with them easily using Rust. By the end of this guide you'll have more of an idea of how to use both and when each one would be better for your use case. It will be assumed you already have a project initialised - if not, you can always initialise a new project with `shuttle init`. -## SQL +## SQL Relational databases are the classical way to store data in the backend of web applications when it comes to storing records and persisted data. Shuttle currently offers free provisioned SQL instances for your applications and currently provides it through an SQLx connection pool. It should be noted that although we're using Postgres for this guide, the same concepts works equally well with both MySQL and MariaDB. To get started with SQLx (and using our new database), we'll want to add the `sqlx` crate to an initialised Rust program. We will also want to add the `shuttle-shared-db` crate which allows us to use the macro that provisions the database instance to us. @@ -75,7 +76,7 @@ let query = sqlx::query::_as<_, Message>("SELECT id, message FROM messages") .await; ``` -This is much more convenient for us for gathering information since we already know what we want the outputted data type from the query to be, so when we carry out the query it'll now automatically be converted into a vector of structs. +This is much more convenient for us for gathering information since we already know what we want the outputted data type from the query to be, so when we carry out the query it'll now automatically be converted into a vector of structs. One of SQLx's main strengths in addition to the above is being able to create data for compile-time queries. To do this, we'll want to enable the macros flag for SQLx by adding the `macros` feature flag to SQLx in our Cargo.toml file, though if following this guide from the start you'll probably have it already. If not, you can run this command: @@ -124,12 +125,12 @@ cargo add serde --features derive Then you need to add the Serialize derive macro to your structs as required, and then when you return the JSON-serialized data it'll automatically be accepted as a HTTP-compatible response. ## shuttle-persist -Shuttle Persist is shuttle's own persistent key-value style store that you can use to store your data in and is great for storing long-term data that you might need on the server but you don't need a relational database for, or you want to be able to store data that's still structured via structs but you also might want to store metadata (ie total number of records, combined value of something from all structs in a vector, or similar). +Shuttle Persist is shuttle's own persistent key-value style store that you can use to store your data in and is great for storing long-term data that you might need on the server but you don't need a relational database for, or you want to be able to store data that's still structured via structs but you also might want to store metadata (ie total number of records, combined value of something from all structs in a vector, or similar). To get started, we'll want to add `shuttle-persist` to an already initialised Rust program by adding the crate: ```bash -cargo add shuttle-persist +cargo add shuttle-persist ``` `shuttle-persist` works by taking a struct or other type and using that as the basis of what we want to save our value as for the key-value store, using the Deserialize & Serialize derive macros from Serde to be able to convert it to/from JSON to make it HTTP response-compatible. We'll want to create a struct that will act as the field type and attach the macros mentioned previously: @@ -184,10 +185,10 @@ async fn add_record( Json(req): Json, ) -> Result { let mut data = state.persist.load::("data"); - + data.people.push( Person { name: req.name, age: req.age } ); data.total_records += 1; - + match state.persist.save::("data", data) { Ok(_) => Ok((StatusCode::OK, "Successful!".to_string())), Err(e) => Err((StatusCode::INTERNAL_SERVER_ERROR, e.to_string())) diff --git a/templates/tutorials/discord-weather-forecast.mdx b/templates/tutorials/discord-weather-forecast.mdx index 14d0319..e4fc0b3 100644 --- a/templates/tutorials/discord-weather-forecast.mdx +++ b/templates/tutorials/discord-weather-forecast.mdx @@ -1,5 +1,6 @@ --- title: "Discord Weather Forecast Bot" +description: "Learn how to write a Discord bot that can get the weather forecast." --- In this tutorial, we will look at a simple way to add custom functionality to a @@ -14,7 +15,7 @@ The full code can be found in ### Registering our bot Before we start making our bot, we need to register it for Discord. We do that -by going to https://discord.com/developers/applications and creating a new +by going to [the Discord Developers applications page](https://discord.com/developers/applications) and creating a new application. ![](/images/discord-weather-forecast-1.png) @@ -60,9 +61,9 @@ Oh, they're offline 😢 At this moment, our bot is not running because there is no code. We will have to write it and run it before we can start interacting with it. -### [Serenity](https://docs.rs/serenity/latest/serenity/index.html) +### Serenity -Serenity is a library for writing Discord bots (and communicating with the +[Serenity](https://docs.rs/serenity/latest/serenity/index.html) is a library for writing Discord bots (and communicating with the Discord API). If you don't have Shuttle yet, you can install it with diff --git a/templates/tutorials/rest-http-service-with-axum.mdx b/templates/tutorials/rest-http-service-with-axum.mdx index 2181212..e2dac72 100644 --- a/templates/tutorials/rest-http-service-with-axum.mdx +++ b/templates/tutorials/rest-http-service-with-axum.mdx @@ -1,5 +1,6 @@ --- title: "Writing a Rest HTTP Service with Axum" +description: "Learn how to write a REST HTTP service with Axum." --- In this guide you'll learn the basics of how to write a competent Axum HTTP REST service - first starting off with basic routing and writing functions to act as our endpoints, adding app State and middleware functions, using cookies and CORS, then finally looking at testing our app. @@ -86,7 +87,7 @@ Now if we plug this into a router that has this function using a GET request at Hello world 32! ``` -Now that we know the basics of writing endpoint functions, we can use them to write a router that has a few endpoints and can take multiple request methods at an endpoint that uses dynamic routing. +Now that we know the basics of writing endpoint functions, we can use them to write a router that has a few endpoints and can take multiple request methods at an endpoint that uses dynamic routing. ```rust async fn router() -> Router { @@ -158,9 +159,9 @@ impl FromRef for ApiState { ### Static Files -Let's say you want to serve some static files using Axum - or that you have an application made using a frontend JavaScript framework like React, and you want to combine it with your Axum backend to make one large application instead of having to host your frontend and backend separately. How would you do that? +Let's say you want to serve some static files using Axum - or that you have an application made using a frontend JavaScript framework like React, and you want to combine it with your Axum backend to make one large application instead of having to host your frontend and backend separately. How would you do that? -Axum does not by itself have capabilities to be able to do this; however, what it does have is super-strong compatibility with `tower-http`, which offers utility for serving your own static files whether you're running a SPA, statically-generated files from a framework like Next.js or simply just raw HTML, CSS and JavaScript. +Axum does not by itself have capabilities to be able to do this; however, what it does have is super-strong compatibility with `tower-http`, which offers utility for serving your own static files whether you're running a SPA, statically-generated files from a framework like Next.js or simply just raw HTML, CSS and JavaScript. If you're using static-generated files, you can easily slip this into your router (assuming your static files are in a 'dist' folder at the root of your project): @@ -213,7 +214,7 @@ struct AppState { key: Key, } -// this impl tells `SignedCookieJar` and `PrivateCookieJar how to access the +// this impl tells `SignedCookieJar` and `PrivateCookieJar how to access the // key from our state impl FromRef for Key { fn from_ref(state: &AppState) -> Self { @@ -224,7 +225,7 @@ impl FromRef for Key { #[shuttle_runtime::main] async fn axum() -> shuttle_axum::ShuttleAxum { let state = AppState { - key: Key::generate() + key: Key::generate() }; // ... the rest of your code @@ -276,7 +277,7 @@ async fn logout( ### Middleware -Middleware is essentially a function that runs before the client hits an endpoint; it can be used for things like adding a wait time to prevent server overload, to validating user sessions from cookies. Fortunately, middleware in Axum is quite simple to use! +Middleware is essentially a function that runs before the client hits an endpoint; it can be used for things like adding a wait time to prevent server overload, to validating user sessions from cookies. Fortunately, middleware in Axum is quite simple to use! There's two ways to be able to create middleware in Axum, but we will be focusing on the more simple way which is to just write a function that uses Axum's middleware utilities as parameters, then simply just adding it to our router and declaring it as middleware. We can also add middleware that uses state this way too, which is great as it means we can share a database connection pool (for example) in the middleware: diff --git a/templates/tutorials/send-your-logs-to-datadog.mdx b/templates/tutorials/send-your-logs-to-datadog.mdx index 3243c7f..c785a22 100644 --- a/templates/tutorials/send-your-logs-to-datadog.mdx +++ b/templates/tutorials/send-your-logs-to-datadog.mdx @@ -1,5 +1,6 @@ --- title: 'Using Shuttle with Datadog' +description: "Learn how to send your logs to Datadog with Roberto." --- > written by [Roberto Huertas](https://robertohuertas.com/) diff --git a/templates/tutorials/serverless-calendar-app.mdx b/templates/tutorials/serverless-calendar-app.mdx index cb08742..52b1d25 100644 --- a/templates/tutorials/serverless-calendar-app.mdx +++ b/templates/tutorials/serverless-calendar-app.mdx @@ -1,5 +1,6 @@ --- title: "Serverless Calendar App" +description: "Learn how to build a serverless calendar application with Matthias." --- > written by [Matthias Endler](https://endler.dev/) @@ -362,7 +363,7 @@ shuttle deploy Right, that's all. It's that easy. Thanks to the folks over at [shuttle.dev](https://github.com/shuttle-hq/shuttle) for making this possible. -The calendar app is now available at https://zerocal.shuttle.app. +The calendar app is now available at `https://zerocal.shuttle.app`. Now I can finally send my friends a link to a calendar event for our next pub crawl. They'll surely appreciate it.yeahyeah diff --git a/templates/tutorials/url-shortener.mdx b/templates/tutorials/url-shortener.mdx index 0b741f6..002cf62 100644 --- a/templates/tutorials/url-shortener.mdx +++ b/templates/tutorials/url-shortener.mdx @@ -1,5 +1,6 @@ --- title: "URL Shortener" +description: "Learn how to write a URL shortener with Terrence." --- I was trying to get to sleep on a Wednesday night - I check my phone, it's 2:54 diff --git a/templates/tutorials/websocket-chat-app-js.mdx b/templates/tutorials/websocket-chat-app-js.mdx index ab28eaf..128b881 100644 --- a/templates/tutorials/websocket-chat-app-js.mdx +++ b/templates/tutorials/websocket-chat-app-js.mdx @@ -1,5 +1,6 @@ --- title: "Chat app with React & Rust" +description: "Learn how to write a Rust chat application with React on the frontend." --- Source code can be found [here](https://github.com/joshua-mo-143/react-websocket-chat-rust).