A simple fullstack project to determine once and for all who is the smartest DotA hero.

You can find the source code here

Technologies

This was written mostly to test out fullstack web development in Rust. As such, I’m using an exculsively rust based tech stack here.

Backend

Here is where Rust excels. It’s pretty well documentated at this point that there are a lot of really great backend Rust frameworks (Actix and Rocket come immediately to mind).

For this project, and probably most of my projects going forward, I chose Rocket. While Rocket is certainly not as fast as Actix, it’s still extremely fast as backend frameworks go, and I’ve found that it is very pleasing to work in. It has a super python-esque feel and you can write a simple API in like 10 lines of code. I mean look at this:

#[macro_use] extern crate rocket;

#[get("/hello/<name>/<age>")]
fn hello(name: &str, age: u8) -> String {
  format!("Hello, {} year old named {}!", age, name)
}
      
#[launch]
fn rocket() -> _ {
  rocket::build().mount("/", routes![hello])
}

It has a super lovely system for setting up requests, works great with Json and is just fun to play around in.

Frontend

When it comes to developing Rust on the frontend, there aren’t quite as many options as on the backend. I’ve selected Yew. It’s similar to React in its design and plenty capable for my purposes.

Database

For the database I’m using SQLite, and rusqlite to interface with it. Here we’re sticking to standards. We just need a simple DBMS and an interface with Rust, nothing too complicated.