Skip to content

Dometrain/getting-started-rust

Repository files navigation

Getting Started with Rust

A hands-on Rust programming course with practical modules covering web development, syntax, ownership, structs, error handling, web frameworks, databases, and configuration.

Course Structure

This repository contains multiple modules, each focusing on different Rust concepts:

Module 1: Hello Web

  • Location: module-1-hello-web/
  • Focus: Introduction to Rust and web development
  • Technologies: Actix-web, Tokio
  • Key Concepts:
    • Setting up a basic Actix-web server
    • Creating HTTP endpoints
    • Using async/await in Rust
    • Running a web server

Module 2: Syntax

  • Location: module-2-syntax/
  • Focus: Rust syntax fundamentals

Module 3: Ownership

  • Location: module-3-ownership/
  • Focus: Rust's ownership system and memory management

Module 4: Structs and Errors

  • Location: module-4-structs-errors/
  • Focus: Data structures and error handling in Rust

Module 5: Web Framework

  • Location: module-5-web-framework/
  • Focus: Building web applications with Rust frameworks

Module 6: Database Basics

  • Location: module-6-database-basics/
  • Focus: Database integration and basic operations

Module 7: Configuration

  • Location: module-7-configuration/
  • Focus: Application configuration and environment management

Getting Started

Prerequisites

  • Rust toolchain installed (rustc, cargo)
  • Basic understanding of programming concepts

Running a Module

Each module is a standalone Rust project. To run a specific module:

cd module-1-hello-web
cargo run

The server will start and you can access it at http://127.0.0.1:8080 (or the port specified in each module).

Example: Module 1

Module 1 demonstrates a simple web server with two endpoints:

  • GET /hello - Returns "Hello, Rust!"
  • GET /goodbye - Returns "Goodbye Dometrain, go build some Rust!"

To run:

cd module-1-hello-web
cargo run

Then visit:

Course Progression

The modules are designed to be completed in order:

  1. Start with Module 1 to get familiar with Rust web development
  2. Move to Module 2 for syntax fundamentals
  3. Learn Rust's unique ownership system in Module 3
  4. Explore structs and error handling in Module 4
  5. Build more complex web applications in Module 5
  6. Add database functionality in Module 6
  7. Learn configuration management in Module 7

Development

Building

cargo build

Running Tests

cargo test

Formatting

cargo fmt

Linting

cargo clippy

License

This is an educational repository for learning Rust. Each module may have its own licensing considerations based on the dependencies used.

Contributing

This repository is structured as a learning resource. If you find issues or have suggestions for improvement, feel free to:

  • Open an issue
  • Submit a pull request
  • Provide feedback on the course structure

Resources

Happy Rust coding! 🦀

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors