Our great sponsors
-
minijinja
MiniJinja is a powerful but minimal dependency template engine for Rust compatible with Jinja/Jinja2
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
cryptoflow
A Q&A web application to demostrate how to build a secured and scalable client-server application with axum and sveltekit
-
PostgreSQL
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch
-
tokio
A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
Redis
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
MiniJinja v1 - Templating engine
Typescript - Language in which the frontend will be written
View on GitHub
As stated, CryptoFlow will support user authentication and authorization and questions and answers management. We need to persist these data and to do this, we need SQL relations. We're building the application with PostgreSQL. Since we use SQLx, our data schema needs to be inside the migrations folder at the root of of project (in the same level as src). Create this folder and then issue the following command:
Docker - For containerization
You also get to specify the accepted HTTP method of the URL via axum::routing. To answer its name, modularity, Axum also supports nested routes as we'll see later in this series. Next is the layer, a method used to apply tower::Layer to all routes before it. This means that routes added after the layer method will not have such a layer applied to their requests. In our case, we used the layer to add tracing to all HTTP requests and responses to our routes. This is needed for proper logging. The tower_http::trace::TraceLayer can even be really customised.
tokio - An asynchronous runtime for Rust
I used cargo-watch here so that every time my source changes, the server will automatically restart and re-serve the updated code.
Pure CSS3 and TailwindCSS v3.4 - Styles
serde - Serializing and Deserializing Rust data structures
Redis - A storage to store tokens, and sessions etc.
Being a pragmatist, it's always intriguing to learn by building cool systems with the best tools currently available. The last time I did this, three series came out and it was fulfilling. Having had some break, I decided to build something with axum, "a rust web application framework that focuses on ergonomics and modularity". As usual, SvelteKit comes to our rescue at the front end. What are we building? That's a nice question!