Set up a modern rust+react web app by running one command.
tsync
cargo install tsync
diesel_cli
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!/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")
tsync
)react-router-dom
)react-query
hooks generation ($ cd my_project && create-rust-app
, then select "Generate react-query hooks")create-react-app
)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
$ 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).