Skip to content

WangWilly/rust-patent-protector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-patent-protector

Toy project to learn Rust and Diesel.

Backend (Rust)

Setup

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install Diesel CLI
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/diesel-rs/diesel/releases/latest/download/diesel_cli-installer.sh | sh

# Create database
cd develop-gears
docker compose up -d

# Database tables
diesel migration generate [migration-name]

# Run migrations
./scripts/migrate.sh

Run

./scripts/serve-backend.sh dev

Deploy

./scripts/build-backend.sh

Misc

Learning Rust

Why using macros?

To illustrate the necessity of using macros in Rust, let's consider a situation where you need to generate repetitive or boilerplate code. Macros provide a powerful way to automate this process, reducing errors and improving maintainability.

Read more

Lifetimes explaination

Lifetimes are a fundamental concept in Rust that help the compiler ensure memory safety without the need for a garbage collector. Understanding lifetimes is crucial for writing safe and efficient Rust code.

Read more

Logging in Rust

Error Handling in Rust

You should use core::result::Result when you need to represent the outcome of an operation that can either succeed or fail. This type is particularly useful in functions that may encounter errors and need to propagate them to the caller.

Read more

About

Toy project to learn building web services with Rust.

Resources

Stars

Watchers

Forks