Code Monkey home page Code Monkey logo

svelte-on-rust's Introduction

Svelte-on-Rust

Starter template for Svelte frontend apps with Rust Rocket backend server.

Requirements

NodeJs - Install

Rust - Install

Rust Nightly for the project folder

Get started

Create a new project based on this template using degit and install the dependencies...

npx degit sachinbhutani/svelte-on-rust svelte-rocket
cd svelte-rocket
npm install

...then start Rocket server and Vite in two different terminals

Terminal 1: (To run the rust server)

cargo run  

Terminal 2: (To build and hot reload svelte components)

npm run dev  

Navigate to localhost:8000. You should see your app running. All svelte component live in client directory. Save any changes live-reloading. All Rocket code lives in src directory. To rebuild Rust code use cargo run after saving your changes. All static files are served from public direcotry. Including the JS code compiled by Svelte Compiler.

Building and running in production mode

To create an optimised version of the app:

npm run build
cargo build

Built With

Rocket

Svelte

YRV

Vite

Change Log

v0.2.0: Complete Rewrite

  • upgraded to rust stable
  • upgraded to new svelte version
  • removed rollup, using vite now
  • removed bulma, pure css only.

v0.1.4: update packages because cargo run failed

v0.1.3: Added authentication example with private cookies

v0.1.2: Added Bulma CSS styling

svelte-on-rust's People

Contributors

sachinbhutani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

svelte-on-rust's Issues

Exclude target/ in .gitignore

Do not upload the compiled output, it makes the Git repo massive Recommendation is to delete the target folder and exclude /target/ in the .gitignore file.

Rename cargo.toml to Cargo.toml

Windows doesn't care about capitalization, but Linux and Mac does. Having the TOML file in lowercase will generate errors on other Operating Systems.

error: could not find `Cargo.toml` in `/home/foorack/Documents/git/sonygo` or any parent directory, but found cargo.toml please try to rename it to Cargo.toml

Please rename cargo.toml to Cargo.toml

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.