Skip to content

Example Rust codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld API spec.

Notifications You must be signed in to change notification settings

hsharpsoftware/rust-realworld-example-app

Repository files navigation

RealWorld Example App

Build status

Rust codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with Rust fast HTTP implementation Hyper in including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Rust community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

This is an application written in Rust using these crates:

  • Hyper - a fast HTTP implementation written in and for Rust
  • Tiberius - Microsoft SQL Server async Rust driver written in Rust
  • Serde - a framework for serializing and deserializing Rust data structures efficiently and generically
  • Reroute - A router for Rust's hyper framework using regular expressions
  • IIS - Set of helper functions for running web server written in Rust on Internet Information Services (IIS)

Getting started

Install Rust: https://www.rustup.rs/

Get Microsoft SQL Server 2017+. SQL Express Edition is OK (when released), Azure SQL Database is OK, LocalDB does NOT work. Make sure TCP is enabled on the Server (enabled in Azure SQL by default, disabled by default on local installations).

On the desired Microsoft SQL Server run database.sql script to create database Conduit and all the tables, functions etc.

Copy conduit - sample.toml to conduit.toml and set your connection string there. Please note the connection encryption must adhere to crate configuration in Cargo.toml see Tiberius documentation on Encryption. Default Cargo.toml configuration works for Azure SQL (encrypted; if using please make sure you add your local IP address to the firewall rules).

Build locally with integration tests:

  • ./locbld.cmd

Or run locally:

  • ./run.cmd

API URL: http://localhost:6767

About

Example Rust codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld API spec.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published