Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmichael123 committed Dec 2, 2022
0 parents commit dd81b0a
Show file tree
Hide file tree
Showing 40 changed files with 7,504 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Vite Tauri Desktop Application Template

This is a starter template for those who want to make a desktop application with web technologies. This template uses the below stack.

### Vite.js
Vite.js is a new modern bundler for javascript which is blazing fast and includes many sensible defaults.

### Tauri
Tauri is a new modern technology to turn your web apps into a desktop app for multiple platforms (Windows, MacOS, Linux, android and ios soon). Tauri apps have very small file size and tiny memory consumption.

### Vue 3
Vue.js is an incremental frontend framework which is an absolute joy to work with. It has seen very impressive improvements in version 3 including Composition Api, script setup, dynamic css binding and ... .

### UnoCSS
Vuetify is arguably the best component library for Vue 3 and is currently in alpha stage but will soon be ready for production. Lots of premade components will make your job as application developer easier and more fun.

## Installation
- Ready your workspace according to Tauri. [Tauri Getting Started](https://tauri.app/v1/guides/getting-started/prerequisites/)

- Note: You only need to install global things such as Rust and other OS level packages. Any thing related to application itself is already installed and ready for you.

- Clone repository
- `git clone https://github.com/yooneskh/vite-tauri-template app-name`

- `yarn` (or `npm install` but yarn is preferred)

- Modify these files according to your app.

- ./index.html
- ./package.json
- ./public/favicon.svg
- ./src-tauri/icons/*
- ./src-tauri/tauri.conf.json

## Development

There are two ways you can develo your app.

### In Browser
- `yarn serve`
- launches vite and you can test and develop your app in the browser at http://localhost:8080.

### In Tauri Window

Launch two terminals and in

1- `yarn serve:tauri`

This launches Vite and configures [Unified Network](https://github.com/yooneskh/unified-network) (which is mine) to use Tauri for api calls (to get around CORS problems).

2- `yarn serve:native`

This launches Tauri window and you would see your app in the native window.

**Note:** There are mainly 2 differences between development in browser and in Tauri window.

- One is who executes your http calls, because when in browser, you are subject to CORS rules, but when testing in Tauri mode, Tauri's native module is executing the http calls so CORS will not be a problem.

- Second is the renderer engine. In browsers, it is usually the latest modern engine, but in Tauri, it will be the OS's web engine, which is good, but maybe not as good as the browsers.

## Building

`yarn build` builds web application and packages them with Tauri in "./src-tauri/target/releases".

## License
Do whatever you want with it!
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>X Ray App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "vite-tauri-template",
"description": "Vite + Tauri + Vuetify bundled together to use",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"serve": "vite",
"serve:tauri": "VITE_NETWORK_PROCESSOR=tauri vite",
"serve:native": "tauri dev",
"build": "VITE_NETWORK_PROCESSOR=tauri vite build && tauri build",
"preview": "vite preview"
},
"dependencies": {
"@mdi/font": "7.0.96",
"@tauri-apps/api": "1.0.2",
"@unocss/reset": "^0.47.4",
"roboto-fontface": "0.10.0",
"typescript": "^4.9.3",
"unified-network": "0.4.0",
"vue": "3.2.37",
"vuetify": "3.0.0-beta.5"
},
"devDependencies": {
"@ow3/eslint-config": "^0.33.11",
"@tauri-apps/cli": "1.0.5",
"@unocss/vite": "^0.47.4",
"@vitejs/plugin-vue": "3.0.1",
"eslint": "^8.28.0",
"sass": "1.54.0",
"unocss": "^0.47.4",
"vite": "3.0.3"
},
"main": "index.js",
"repository": "[email protected]:yooneskh/vite-vuetify-template.git",
"author": "Yoones Khoshghadam <[email protected]>",
"license": "MIT"
}
1 change: 1 addition & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/target/
Loading

0 comments on commit dd81b0a

Please sign in to comment.