Skip to content

Set up a modern rust+react web app by running one command.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

kat-ms/create-rust-app

 
 

Repository files navigation

Create Rust App

License: MIT OR Apache-2.0

Set up a modern rust+react web app by running one command.

Requirements

  • tsync (see install section)
  • yarn (or npm)
  • Stable rust

Install

cargo install create-rust-app

Quick start

# Creates a new rust+react project
create-rust-app my-todo-app
# .. select plugins, etc.

# Code-gen resources for your project
cd ./my-todo-app
create-rust-app
# .. select resource type / properties

Features

  • Project creation ($ create-rust-app <project_name>)
    • Run frontend & backend with a single command: cargo fullstack
    • Rust backend
      • Fastest backend server (via actix_web)
      • Database migrations (via diesel.rs)
      • Sending mail (via lettre)
      • PostgreSQL (via r2d2)
    • React frontend
      • Typescript, with backend type definition generation (via tsync)
      • Routing (via react-router-dom)
      • Typed react-query hooks generation ($ cd my_project && create-rust-app, then select "Generate react-query hooks")
      • Update to latest create-react-app (generated frontend is not ejected from create-react-app)
  • Resource creation ($ cd my_project && create-rust-app)
    • CRUD code-gen to reduce boileplate
    • react-query hooks generation for frontend
  • Auth plugin
    • Add JWT token-based auth with a simple command
    • Session management: restoration of previous session, revoking of refresh tokens
    • Credentials management/recovery
    • Email validation / activation flow
    • Adds frontend UI + react hooks
    • Adds auth service, and user / session models
    • Block your endpoints via Auth guard
    • Follows OWASP security best practices
  • Container plugin
    • Dockerfile to containerize your rust app into a single image
  • Admin Portal plugin
    • View your database via the admin portal (editing functionality coming soon™)
    • A "devbox" on the frontend indicates when the backend is compiling or when the database is not reachable
    • Moreover, the devbox displays when migrations are pending + includes a "run migrations" button

Walkthrough

(the full video can be found in the repo at this path: docs/create-rust-app-v2.mp4 )

Gif

About

Set up a modern rust+react web app by running one command.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 75.0%
  • TypeScript 21.6%
  • HTML 1.0%
  • CSS 0.8%
  • JavaScript 0.6%
  • PLpgSQL 0.6%
  • Other 0.4%