Skip to content

aelgohar/rusty-connect4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty Connect 4 Web App

Rusty Connect 4 is a full-stack project written completely in Rust. It uses:

  • rocket on the backend
  • yew for creating front-end webapps with WebAssembly (yew is a great component-based framework!)
  • yew-router for routing
  • stdweb to provide Rust bindings for Web APIs

The backend is only used for requests and saving your progress. You can still play the game with just the frontend.

Gameplay

Dependencies

cargo-web

The frontend is built using cargo-web, which can be installed with the following command.

cargo install cargo-web

MongoDB

The backend uses MongoDB for storing game history. Instructions for how to install MongoDB can be found here.

nightly

Rocket requires the latest version of Rust nightly (see here). From the base directory of the project, run:

rustup override set nightly

Run

The project can be built and ran from by executing the following commands from the base directory of the project.

To compile the frontend and generate the static files for the webpage:

(cd frontend && cargo web deploy)

To build and run the backend:

cargo run -p backend

The game should now be up and running and can be accessed by going to localhost:8000 in any web browser.