Skip to content

tspycher/rust_livecoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Live Coding Session

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

Overview

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

Technologies Used

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.

Getting Started

To run the code from this repository, you'll need to have Rust installed on your machine.

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/tspycher/rust_livecoding.git
    
  2. Navigate to the project directory:

    cd rust_livecoding
    cp .env_example .env
    cargo install diesel_cli --no-default-features --features sqlite
    diesel setup
    

Running the Application

To build and run the application, execute:

cargo run

Running Tests

If the project includes tests, you can run them with:

cargo test

Build for Production

If the project includes tests, you can run them with:

cargo build --release
./target/release/tedtalk

Project Structure

  • src/ - Main source code directory
    • main.rs - The main entry point of the application
  • Cargo.toml - Project configuration file
  • diesel.toml - Diesel ORM configuration file
  • http/ - Example HTTP Requests (Postman/Insomnia alternative)

Learning Resources

Contributing

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! 🚀

About

LiveCoding Sessions in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published