Welcome to the Rust Live Coding Session repository! This project was created as part of an internal "TED Talk" to introduce our team to the Rust programming language through a live coding experience.
The Video of the Coding Session is here: https://youtu.be/PDF20YdlHTw
During the session, we explored Rust's features by building a simple application. This repository contains:
- The source code developed during the live session
- Examples demonstrating key Rust concepts
- Additional resources for further learning
The application leverages several Rust libraries and frameworks to provide a robust, asynchronous, and efficient system:
-
Tokio: Tokio is the main component of the application, offering an event-driven, non-blocking I/O platform for writing asynchronous applications.
-
Axum: The primary web framework used is Axum, which provides a modular and ergonomic way to build web services on top of Tokio.
-
Serde: For serialization and deserialization of JSON, we utilize Serde, a powerful framework for handling Rust data structures efficiently.
-
Utoipa: To generate API documentation (OpenAPI), we integrated Utoipa with Axum, enabling automatic and up-to-date API docs.
-
Reqwest: For making API calls to other systems, we use Reqwest, a convenient and high-level HTTP client.
-
Diesel: As our ORM, Diesel provides safe and efficient interactions with the database, leveraging Rust's type system to prevent runtime errors.
By combining these technologies, the application achieves high performance, safety, and scalability, embodying Rust's strengths in systems programming and modern web development.
To run the code from this repository, you'll need to have Rust installed on your machine.
- Rust: Install Rust by following the instructions on the official website: https://www.rust-lang.org/tools/install
-
Clone the repository:
git clone https://github.com/tspycher/rust_livecoding.git
-
Navigate to the project directory:
cd rust_livecoding cp .env_example .env cargo install diesel_cli --no-default-features --features sqlite diesel setup
To build and run the application, execute:
cargo run
If the project includes tests, you can run them with:
cargo test
If the project includes tests, you can run them with:
cargo build --release
./target/release/tedtalk
src/
- Main source code directorymain.rs
- The main entry point of the application
Cargo.toml
- Project configuration filediesel.toml
- Diesel ORM configuration filehttp/
- Example HTTP Requests (Postman/Insomnia alternative)
- The Rust Programming Language Book: https://doc.rust-lang.org/book/
- Rust By Example: https://doc.rust-lang.org/rust-by-example/
- Official Rust Documentation: https://doc.rust-lang.org/
This project is intended for educational purposes within our team. If you have suggestions or improvements, feel free to create a branch or discuss them during our next meeting.
Happy coding! 🚀