├── .gitignore ├── .vscode └── extensions.json ├── README.md ├── Screenshot-dark.png ├── Screenshot-light.png ├── astro.config.mjs ├── package.json ├── public ├── astro-dark.svg ├── astro-light.svg └── tauri.svg ├── renovate.json ├── src-tauri ├── .gitignore ├── Cargo.toml ├── build.rs ├── icons │ ├── 128x128.png │ ├── 128x128@2x.png │ ├── 32x32.png │ ├── Square107x107Logo.png │ ├── Square142x142Logo.png │ ├── Square150x150Logo.png │ ├── Square284x284Logo.png │ ├── Square30x30Logo.png │ ├── Square310x310Logo.png │ ├── Square44x44Logo.png │ ├── Square71x71Logo.png │ ├── Square89x89Logo.png │ ├── StoreLogo.png │ ├── icon.icns │ ├── icon.ico │ └── icon.png ├── src │ ├── lib.rs │ └── main.rs └── tauri.conf.json ├── src ├── components │ └── Greet.tsx ├── env.d.ts ├── layouts │ └── Layout.astro └── pages │ └── index.astro └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | # generated types 4 | .astro/ 5 | 6 | # dependencies 7 | node_modules/ 8 | 9 | # logs 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | 16 | # environment variables 17 | .env 18 | .env.production 19 | 20 | # macOS-specific files 21 | .DS_Store 22 | 23 | # jetbrains setting folder 24 | .idea/ 25 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode", "tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"], 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tauri + Astro 2 | 3 | This template should help get you started developing with Tauri and Astro. 4 | 5 | ![App Screenshot](./Screenshot-light.png#gh-light-mode-only) 6 | ![App Screenshot](./Screenshot-dark.png#gh-dark-mode-only) 7 | 8 | ## Getting started 9 | 10 | First, make sure you have completed the [prerequisites](https://beta.tauri.app/guides/prerequisites/) to have a working development environment. 11 | 12 | Then install the dependencies using the package manager of your choice: 13 | 14 | ```bash 15 | npm install 16 | # OR 17 | pnpm install 18 | ``` 19 | 20 | Then to get started run: 21 | 22 | ```bash 23 | npm run tauri dev 24 | # OR 25 | pnpm tauri dev 26 | ``` 27 | 28 | to build your app run 29 | 30 | ```bash 31 | npm run tauri build 32 | # OR 33 | pnpm tauri build 34 | ``` 35 | 36 | ## Recommended IDE Setup 37 | 38 | [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer). 39 | -------------------------------------------------------------------------------- /Screenshot-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/Screenshot-dark.png -------------------------------------------------------------------------------- /Screenshot-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/Screenshot-light.png -------------------------------------------------------------------------------- /astro.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'astro/config'; 2 | import solidJs from "@astrojs/solid-js"; 3 | 4 | import playformCompress from "@playform/compress"; 5 | import playformInline from "@playform/inline"; 6 | 7 | // https://astro.build/config 8 | export default defineConfig({ 9 | integrations: [solidJs(), playformInline(), playformCompress()] 10 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "adorable-azimuth", 3 | "type": "module", 4 | "version": "0.0.1", 5 | "scripts": { 6 | "dev": "astro dev", 7 | "start": "astro dev", 8 | "build": "astro check && astro build", 9 | "preview": "astro preview", 10 | "astro": "astro", 11 | "tauri": "tauri" 12 | }, 13 | "dependencies": { 14 | "@astrojs/check": "^0.5.10", 15 | "@astrojs/solid-js": "^4.1.0", 16 | "@playform/compress": "^0.0.3", 17 | "@playform/inline": "^0.0.2", 18 | "@tauri-apps/api": ">=2.0.0-beta.0", 19 | "@tauri-apps/cli": ">=2.0.0-beta.0", 20 | "astro": "^4.6.0", 21 | "solid-js": "^1.8.16", 22 | "typescript": "^5.4.5" 23 | } 24 | } -------------------------------------------------------------------------------- /public/astro-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/astro-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/tauri.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:base"], 3 | "packageRules": [ 4 | { 5 | "matchUpdateTypes": ["minor", "patch", "pin", "digest"], 6 | "automerge": true 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /src-tauri/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Generated by Tauri 6 | # will have schema files for capabilities auto-completion 7 | /gen/schemas 8 | -------------------------------------------------------------------------------- /src-tauri/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tauri-app" 3 | version = "0.0.0" 4 | description = "A Tauri App" 5 | authors = ["you"] 6 | edition = "2021" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [lib] 11 | name = "tauri_app_lib" 12 | crate-type = ["lib", "cdylib", "staticlib"] 13 | 14 | [build-dependencies] 15 | tauri-build = { version = "2.0.0-beta", features = [] } 16 | 17 | [dependencies] 18 | tauri = { version = "2.0.0-beta", features = [] } 19 | tauri-plugin-shell = "2.0.0-beta" 20 | serde = { version = "1", features = ["derive"] } 21 | serde_json = "1" 22 | 23 | [profile.release] 24 | panic = "abort" # Strip expensive panic clean-up logic 25 | codegen-units = 1 # Compile crates one after another so the compiler can optimize better 26 | lto = true # Enables link to optimizations 27 | opt-level = "s" # Optimize for binary size 28 | strip = true 29 | -------------------------------------------------------------------------------- /src-tauri/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build() 3 | } 4 | -------------------------------------------------------------------------------- /src-tauri/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/128x128.png -------------------------------------------------------------------------------- /src-tauri/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/128x128@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/32x32.png -------------------------------------------------------------------------------- /src-tauri/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/StoreLogo.png -------------------------------------------------------------------------------- /src-tauri/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/icon.icns -------------------------------------------------------------------------------- /src-tauri/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/icon.ico -------------------------------------------------------------------------------- /src-tauri/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonasKruckenberg/tauri-astro-template/0bd69a761991902cf141122026dff14be6d01ff4/src-tauri/icons/icon.png -------------------------------------------------------------------------------- /src-tauri/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command 2 | #[tauri::command] 3 | fn greet(name: &str) -> String { 4 | format!("Hello, {}! You've been greeted from Rust!", name) 5 | } 6 | 7 | #[cfg_attr(mobile, tauri::mobile_entry_point)] 8 | pub fn run() { 9 | tauri::Builder::default() 10 | .plugin(tauri_plugin_shell::init()) 11 | .invoke_handler(tauri::generate_handler![greet]) 12 | .run(tauri::generate_context!()) 13 | .expect("error while running tauri application"); 14 | } 15 | -------------------------------------------------------------------------------- /src-tauri/src/main.rs: -------------------------------------------------------------------------------- 1 | // Prevents additional console window on Windows in release, DO NOT REMOVE!! 2 | #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] 3 | 4 | fn main() { 5 | tauri_app_lib::run() 6 | } 7 | -------------------------------------------------------------------------------- /src-tauri/tauri.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "productName": "tauri-app", 3 | "version": "0.0.0", 4 | "identifier": "com.tauri.devs", 5 | "build": { 6 | "beforeDevCommand": "pnpm dev", 7 | "devUrl": "http://localhost:4321/", 8 | "beforeBuildCommand": "pnpm build", 9 | "frontendDist": "../dist" 10 | }, 11 | "app": {"windows": [ 12 | { 13 | "title": "tauri-app", 14 | "width": 800, 15 | "height": 600 16 | } 17 | ], 18 | "security": { 19 | "csp": null 20 | } 21 | }, 22 | "bundle": { 23 | "active": true, 24 | "targets": "all", 25 | "icon": [ 26 | "icons/32x32.png", 27 | "icons/128x128.png", 28 | "icons/128x128@2x.png", 29 | "icons/icon.icns", 30 | "icons/icon.ico" 31 | ] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/components/Greet.tsx: -------------------------------------------------------------------------------- 1 | import {createSignal} from "solid-js"; 2 | import {invoke} from "@tauri-apps/api/core"; 3 | 4 | export function Greet() { 5 | const [greetMsg, setGreetMsg] = createSignal(""); 6 | const [name, setName] = createSignal(""); 7 | 8 | async function greet() { 9 | // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command 10 | return setGreetMsg(await invoke("greet", { name: name() })); 11 | } 12 | 13 | return <> 14 |
{ 17 | e.preventDefault(); 18 | greet(); 19 | }} 20 | > 21 | setName(e.currentTarget.value)} 24 | placeholder="Enter a name..." 25 | /> 26 | 27 |
28 | 29 |

{greetMsg()}

30 | 31 | } -------------------------------------------------------------------------------- /src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/layouts/Layout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/pages/index.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from "../layouts/Layout.astro"; 3 | import {Greet} from "../components/Greet.tsx"; 4 | --- 5 | 6 | 7 |
8 | 25 |

Click on the Tauri and Astro logos to learn more.

26 |

27 | Recommended IDE setup: 28 | VS Code 29 | + 30 | 34 | Tauri 35 | 36 | + 37 | 41 | rust-analyzer 42 | 43 |

44 | 45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strictest", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "jsxImportSource": "solid-js" 6 | } 7 | } --------------------------------------------------------------------------------