Coder Social home page Coder Social logo

chillcaw / rocket-yew-starter-pack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dontlaugh/rocket-yew-starter-pack

0.0 1.0 0.0 97 KB

Example boilerplate for websites in pure Rust

License: MIT License

Rust 70.57% HTML 0.83% CSS 24.50% Shell 4.10%

rocket-yew-starter-pack's Introduction

Rocket/Yew Starter Pack

Rocket is a framework for building web servers in Rust, with a routing API that feels like Flask (Python). Yew is a front end framework for writing apps in Rust using cutting-edge (but well-supported) WebAssembly technologies, and with an API inspired by patterns from Elm and React.

This project adapts the todoMVC example from the yew repo, and periodically syncs local state with a backend Rocket server.

We also include some scripts to demonstrate building the ui and shipping it over to the server to serve as static assets.

Getting Started

Install rust with rustup. Since we build with --target=wasm32-unknown-unknown, and rely on other unstable features, you must use nightly rust.

rustup default nightly

Build both ui and server on your current platform

./build.sh

Or, build ui and copy the outputs over to server to run locally.

./run-local.sh

Or, build the Rocket server backend as a static binary, using Eric Kidd's Docker container.

./static-binary.sh  # calls server/.container-script.sh

Other Libraries

This project also uses:

  • stdweb and cargo-web - core library and tooling that make frameworks like yew possible. You can support koute on Patreon.
  • maud - html templating
  • sled - an embedded, ordered key-value store
  • bincode - binary encoding for rust types, so we can put stuff in a sled tree

NOTE: This is a work in progress, but it should build, run and let you get started. These libraries are moving fast, so if anything is broken feel free to open an issue or a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.