Initial commit

This commit is contained in:
2024-12-22 10:53:10 -04:00
parent 7e9f329c9d
commit b9fe6f8882
27 changed files with 5659 additions and 0 deletions

14
frontend/index.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tauri App</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Hello, Tauri!</h1>
<button id="greet-btn">Greet</button>
<script src="script.js"></script>
</body>
</html>

3
frontend/main.js Normal file
View File

@@ -0,0 +1,3 @@
document.getElementById("greet-btn").addEventListener("click", () => {
alert("Hello from Tauri!");
});

10
frontend/style.css Normal file
View File

@@ -0,0 +1,10 @@
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 20px;
}
button {
padding: 10px 20px;
font-size: 16px;
}

4
src-tauri/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas

5516
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

26
src-tauri/Cargo.toml Normal file
View File

@@ -0,0 +1,26 @@
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
edition = "2021"
rust-version = "1.77.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.0.2", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
tauri = { version = "2.1.0", features = [] }
tauri-plugin-log = "2.0.0-rc"
mysql = "25.0.1"

4
src-tauri/build.rs Normal file
View File

@@ -0,0 +1,4 @@
fn main() {
tauri_build::build();
}

View File

@@ -0,0 +1,11 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "enables the default permissions",
"windows": [
"main"
],
"permissions": [
"core:default"
]
}

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

16
src-tauri/src/lib.rs Normal file
View File

@@ -0,0 +1,16 @@
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.setup(|app| {
if cfg!(debug_assertions) {
app.handle().plugin(
tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Info)
.build(),
)?;
}
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

21
src-tauri/src/main.rs Normal file
View File

@@ -0,0 +1,21 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use mysql::*;
use mysql::prelude::*;
fn main() {
app_lib::run();
if let Err(e) = mySqlConnect() {
eprintln!("Error connecting to MySQL: {}", e);
}
}
fn mySqlConnect() -> Result<()> {
let url = "mysql://rust:rust@localhost:43158";
let pool = Pool::new(url)?;
let mut conn = pool.get_conn()?;
Ok(())
}

34
src-tauri/tauri.conf.json Normal file
View File

@@ -0,0 +1,34 @@
{
"$schema": "https://schema.tauri.app/config/2.0.0-rc",
"productName": "AE2",
"version": "0.1.0",
"identifier": "com.tauri.dev",
"build": {
"frontendDist": "../frontend"
},
"app": {
"windows": [
{
"title": "Inventory",
"width": 800,
"height": 600,
"resizable": true,
"fullscreen": false
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}