Rust implementation of the quote editor from Turbo Rails Tutorial.
The main motivation is learning to develop web applications with Rust and JavaScript combined. It now includes the following stack:
In the past it included these technologies:
Some features of the tutorial were intentionally left out and possibly will be worked on in the future:
- Broadcasting with WebSockets (Chapter 5)
- Security (Chapter 6)
Additionally, there were some other features that haven't been replicated yet:
- The look and feel deviates from the Turbo Rails Tutorial demo because the author has made some UI enhancements that are not in the tutorial
- Viewports less than tablet sizing
- Labels for input fields
- Delete confirmation
- ...probably a few others
- Rust version 1.78.0 or greater installed
- NodeJS version 20 or greater installed
- Install Node dependencies
npm install
- Build web with
npm run build
- Install Rust dependencies
cargo install
- Build with
cargo build
- Run with
cargo run
- Docker and Docker Compose or compatible software installed.
- Create volume with
docker volume create db-data
- Build with
docker build -t rust-quote-editor .
- Run with
docker run -itd -p 8080:8080 -v db-data:/data rust-quote-editor
- Build with
docker compose build
- Run with
docker compose up
ordocker compose up -d
(build step not necessary once built)
- Create account if necessary
fly auth login
fly apps create <GLOBALLY-UNIQUE-APP-NAME>
- Update
app
property infly.toml
with
- Update
- Choose fly.io region
- Update
primary_region
property infly.toml
- Update
fly volumes create <VOLUME-NAME> -s 1 -r <REGION>
- Update
mounts.source
property infly.toml
with
- Update
docker build -t registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER> --target deploy .
fly deploy --image registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>
Automated deployment of new versions with GitHub action
- Set up your
FLY_API_TOKEN
secret in your repository - Tag release with a tag name starting with 'v'
- Example:
git tag -a v2 -m "My new release!" && git push --tags
- Example:
docker build -t registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER> --target deploy .
fly auth docker
docker push registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>
fly deploy --image registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>