The purpose of the create-tauri-app
rebuild is to create a single entry-point for any user coming from any background or project setup and enable them to quickly get started with Tauri.
This should be implemented in a way that can run on any system without dependencies (i.e. Node, Rust) being setup and with the goal of including the work @chippers is working on around prerequisites.
Note: This is currently just in the stage where we request comments on the USER FLOW. The actual technical implementations and details can be hashed out during development.
Personas
These are the different types of users and the paths they could take when getting started with Tauri.
Benny: New Node Project User
- Familiar with Node
- Wants to stay in the Node ecosystem/tooling
Jannett: New Rust Project User
- Familiar with Cargo/Rust
- Wants to stay in the Rust ecosystem/tooling
Jose: New to Both Ecosystems
- "I don't have a preference on which tool I use"
- Could be new to development or coming from a Java or similar background
Matéo: Existing Node Project User
- Already has a Node project setup and just wants to add Tauri to it
Ginevra: Existing Rust Project User
- Already has a Rust project setup and just wants to add Tauri to it
Flows
Benny: New Node Project User
npm create tauri-app
- Executes a native node add-on, similar to how we do with
@tauri-apps/cli
(thanks, Amr!)
- Skip forward to Common Flow...
Jannett: New Rust Project User
cargo install create-tauri-app
- Builds
create-tauri-app
binary
- Execute
cargo create-tauri-app
or create-tauri-app
- Skip forward to Common Flow...
Jose: New to Both Ecosystems
- Run
curl create.tauri.app | sh
that downloads and executes create-tauri-app
Rust Engine
- Skip forward to Common Flow...
Matéo: Existing Node Project User
npm create tauri-app
- Runs shell script
curl create.tauri.app | sh
that downloads and executes create-tauri-app
Rust Engine
- Skip forward to Common Flow...
Ginevra: Existing Rust Project User
cargo install create-tauri-app
- Builds
create-tauri-app
binary
- Execute
cargo create-tauri-app
or create-tauri-app
- Skip forward to Common Flow...
Common Flow
- ❓ Check if prerequisites are met...
- Need check with @chippers on what he's building and how it could be integrated
- If setup initiated through shell script directly (not via Node)...
- If a Node project exists...
- Go to "If setup initiated via Node" step
- If a cargo project exists...
- Go to "If setup initiated via cargo..." step
- Else ask user if they'd like to use Node or cargo
- Fall through to relevant step based on choice
- If setup initiated via Node
- If there is already a Node project...
- Add Tauri as dependency
- Run
tauri init
prompting for these questions:
- (Would be good to link to a Getting Started guide that explains each of these commands a bit better before/during being prompted)
- (Dynamically parse out the project name from
package.json
)
- Before Dev Command
- ❗️ Would need to be added to
tauri init
upstream
- Dev Path
- Before Build Command
- ❗️ Would need to be added to
tauri init
upstream
- Dist Dir
- Else set up a new Node project...
- Ask them which package manager they want to use (yarn, npm, etc.)
- Ask which frontend template they want to use (vanilla, Svelte, React, etc.)
- Setup relevant template
- If setup initiated via cargo...
- If there is already a cargo project...
- Add Tauri to dependencies
- Ask which frontend template they want to use (vanilla, yew, dominator, etc.)
- Else setup a new cargo project bootstrapped with the HTML template
- Link to the Getting Started Guides
Technical Implementation
Shell Script
Only responsible for downloading and executing the compiled create-tauri-app
Rust Engine
Node
Only responsible for downloading and running the shell script (or directly downloading and executing the create-tauri-app
Rust Engine)
create-tauri-app
Rust Engine
TBD
Templating System
Have some way to have centralised styles and assets to 1) minimise bundle size and 2) centralise styles if we want to update them later.
TBD
Prerequisites Checker
TBD, need to check with @chippers on this and see how we can implement it.
CC @amrbashir @JonasKruckenberg @chippers @FabianLars