Vibe Engines
YouTube

Free course · 34 short lessons · runs in your browser

Learn Rust by building a chat app

One small project, from an empty folder to a chat client that talks to a real AI model. Each lesson teaches one idea from the basics up, then adds it to the project. No experience needed.

Start · 1.1 What a program is → 0 of 34 available lessons done
  1. Chapter 1

    Hello

    What a program is, how Rust runs one, and your first Chatterbox greeting.

    1. 1.1What a program isNothing yet: you read the finished program first.Start · 6 min
    2. 1.2Make and run a projectThe Chatterbox project exists and runs.6 min
    3. 1.3Printing and commentsChatterbox prints a banner.7 min
    4. 1.4Chatterbox says helloA greeting that fills in your name.6 min
  2. Chapter 2

    Values

    Names, numbers, true and false, and text: the things a program remembers.

    1. 2.1Names for valuesThe bot gets a name and a version.7 min
    2. 2.2Values that changeA message counter.8 min
    3. 2.3Numbers and true/falseA token budget and a "quiet" switch.8 min
    4. 2.4TextChatterbox holds a message as text.9 min
  3. Chapter 3

    Decisions

    if, match, loops and functions: teaching Chatterbox to react to what you type.

    1. 3.1Choosing with ifEmpty input is ignored.8 min
    2. 3.2Choosing with matchCommands: /help, /quit.9 min
    3. 3.3Doing things againThe chat loop.10 min
    4. 3.4Functionsreply() is its own function.9 min
    5. 3.5Reading a lineChatterbox reads what you type.11 min
  4. Chapter 4

    Ownership

    The idea Rust is famous for, in one picture: one owner, borrowing, and why it saves you.

    1. 4.1One owner, one keyThe mental model; no code change.8 min
    2. 4.2Handing over the keySpot why the old message disappears.10 min
    3. 4.3Borrowingreply() borrows the message.11 min
    4. 4.4Borrowing to changeA function that edits the history.11 min
    5. 4.5Parts of a valuePrint the first word of a message.11 min
  5. Chapter 5

    Shapes

    struct, enum and Option: giving Chatterbox a real Message type.

    1. 5.1Bundling fields: structA Message struct.7 min
    2. 5.2Giving a struct behaviourMessage::new, plus shout and is_empty methods.8 min
    3. 5.3One of several: enumA Command enum, matched exhaustively.8 min
    4. 5.4Maybe nothing: Optionfind_command_arg() returns an Option; the bot replies with a Message.9 min
  6. Chapter 6

    Collections

    Vec, HashMap and closures: keeping the whole conversation.

    1. 6.1A list: VecThe conversation history.8 min
    2. 6.2Walking a listPrint the history.9 min
    3. 6.3Lookup by key: HashMapA HashMap counts messages per author.9 min
    4. 6.4Small functions on the spotA closure-powered /long command.9 min
  7. Chapter 7

    When things fail

    Result, the ? operator, modules and files: a Chatterbox that survives bad input.

    1. 7.1Operations that can fail: ResultParse a command safely.8 min
    2. 7.2The ? operatorErrors pass upward in one character.9 min
    3. 7.3Splitting code into filesmessage.rs and command.rs split out of main.rs.8 min
    4. 7.4Saving and loadingHistory survives a restart.11 min
  8. Chapter 8

    The real model

    JSON, traits and one HTTP call: Chatterbox talks to a real model.

    1. 8.1JSON with serdeMessages become JSON.9 min
    2. 8.2TraitsA Replier trait with an echo and a pretend model.10 min
    3. 8.3One HTTP callChatterbox calls a model.14 min
    4. 8.4Ship itcargo build --release; the finished project.10 min

Learn Rust by building a chat app: frequently asked questions

Is this course free?

Yes. Every lesson and exercise is free, with no account. Progress is stored in your own browser.

Do I need to know how to code?

No. The course starts from what a program is and builds up one idea at a time. If you can already code in another language, the early lessons are quick.

Do I need to install anything?

Not to start. Code boxes compile and run in the page through the official Rust Playground. From chapter 3 you will want Rust on your own machine to run Chatterbox in a terminal; lesson 1.2 shows how.

What will I have at the end?

A working command-line chat program written in Rust that keeps a conversation, saves it to disk and talks to a real AI model, and the Rust fundamentals you used to write it: variables, types, control flow, ownership and borrowing, structs and enums, collections, error handling, traits and one HTTP call.

Are the compiler messages real?

Yes. Every error shown was produced by running the snippet through the Rust compiler during the site build, and the build fails if a snippet stops producing the error it claims.