Skip to content
/ rust-boilerplate Public template

🦀📦 Rust template built with best practices.

License

Notifications You must be signed in to change notification settings

mack/rust-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Boilerplate 🦀📦

A generic Rust application template that (hopefully) follows best practices.

Prerequisites

Getting started

  1. Create a new repository from this template.
    1. Update the name in Cargo.toml.
    2. Update author, title, etc in book.toml.
  2. Setup the local environment using make setup.
  3. Verify everything works by running cargo run -- hello -n 'John Wick'. You should see the following output:
cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/rust-boilerplate hello -n 'John Wick'`
Hello, John Wick!
  1. 🎉 Skip the boilerplate and get straight to developing!

Features

  • Basic CLI application to get you started.
  • Containerized application with Docker.
  • Precommit to validate format, linting, compilation, and more.
  • Generate Rust documentation using mdbook.
  • Several Makefile commands to accomplish common tasks.
  • ...and more to come! 🤞

Helpful commands

$ make help
docker-build                   Build the docker image for this application
docker-push                    Push the docker image to the default container registry
docker-run                     Run the docker image for this application
docs-build                     Generate docs using mdbook
docs-run                       Run a localhost version of docs
help                           Formatted list of make commands
lint                           Format and lint current package
release                        Compile current package into a new release
setup                          Setup and install local development tools (e.g. pre-commit, mdbook)
test-all                       Run the ignored tests
test                           Run the tests
version                        Print versioning info on common tools