Set up a modern rust+react web app by running one command. Join us on discord.
tsync
cargo install tsync
diesel_cli
diesel_cli
with your system's libsqlite3
, you may run cargo install diesel_cli --no-default-features --features sqlite-bundled
.rustup install stable
(nightly is fine too)sh
cargo install create-rust-app_cli
```sh create-rust-app my-todo-app
```
```sh
cd ./my-todo-app create-rust-app
```
$ create-rust-app <project_name>
cargo fullstack
actix-web
, poem
or let us know which one you want to use!cargo dsync
in your project (see codegen section below)./views
folder contains all templates/frontend/bundles
folder contains all the bundles which can be included in your views via {{bundle(name="MyBundle.tsx")}}
create_rust_app::render_single_page_application("/app","your_spa.html")
cargo tsync
in your project folder; see codegen section below)react-router-dom
)react-query
hooks generation ($ cd my_project && create-rust-app
, then select "Generate react-query hooks")Available Plugins
Authentication (+ Authorization) plugin
Auth
guardContainer plugin
Development plugin
localhost:3000/admin
(editing functionality coming soon™)Storage plugin
Storage
extractor which allows you to upload/download files from an S3-compatible object store Attachment::*
!rs
let s3_key = Attachment::attach("avatar", "users", user_id, AttachmentData {
file_name: "image.png",
data: bytes
})?;
rs
let storage: Storage // retreive this via the appropriate extractor in your frameowrk of choice
let url = storage.download_uri(s3_key)?;
(note: see Attachment::*
and Storage::*
for more functionality!)GraphQL plugin
localhost:3000/graphql
$ cargo dsync
backend/models
folder!
$ cargo tsync
#[tsync::tsync]
. You'll find the output for this command here: frontend/src/types/rust.d.ts
.
$ cd my_project && create-rust-app
- CRUD code-gen to reduce boilerplate
- Scaffolds the db model, endpoints service file, and hooks it up in your /api
!
- react-query
hooks generation for frontend
- Generates a hook for each handler function defined in the services/
folder
- Edit generated hooks afterwards -- they won't be regenerated unless you delete (or rename) the hook!
Questions and comments are welcome in the issues section!
If you're experiencing slow compilation time, make sure there isn't any bloat in the template files (look for node_modules
or typescript / parcel caches and delete them).
Moreover, you can try using the mold linker which may also improve compilation times.