Skip to content
/ MAYR Public

Rust based full stack web application. Inspired by M.E.A.N from NodeJS. Why be mean when you can be a mayr?

Notifications You must be signed in to change notification settings

spf5000/MAYR

Repository files navigation

What is this?

This is VERY SIMPLE web stack using leveraging

  • M: Mongo DB as the database.
  • A: Actix Web as the web server.
  • Y: Yew as the front end framework.
  • R: Rust, powering actix and yew.

This is largely inspired by M.E.A.N. websiting using NodeJS for the majority of development. Why be M.E.A.N. when you can be a M.A.Y.R. :)

Disclaimer: I'm new to Rust AND Web development. There are MANY ways this project can improve (ex: using an Agent instead of a Service in Yew, The handler functions to pass the requests to the Handler structs, etc.). This project was started to help me learn a bit about Rust, Mongo, and Docker and in that regard, I think it's been a success. That said, it's to a state where I think I'm happy to share it with anyone who stumbles on it on the internet.

Running the applications

Via Docker Compose

  1. docker-compose up

Via docker directly

  1. Build The Server:
docker build -t rust-server -f ./Dockerfile-server .
  1. Build the Client:
docker build -t rust-console -f ./Dockerfile-console .
  1. Launch Docker containers with mongo DB.

Locally

Server

cargo run -p rust-server

NOTE: You'll need mongo DB running locally as well.

Console

cargo build -p rust-console
wasm-pack build --target web --out-name wasm --out-dir static ./rust-console
miniserve ./rust-console/static/ --index index.html

Testing

Manually

First run the server using cargo run. TODO: DockerCompose

List Coffee Stores

curl -d "{}" localhost:9080/coffee/list

Create Coffee Store

curl -d '{"CoffeeStore": {"Name": "Rosolinis", "Description": "Coffee and Pastries", "AvgRating": 4.9}}' localhost:9080/coffee/create

About

Rust based full stack web application. Inspired by M.E.A.N from NodeJS. Why be mean when you can be a mayr?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages