Refactoring code, fixing name and adding readme
This commit is contained in:
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -75,7 +75,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13"
|
||||
|
||||
[[package]]
|
||||
name = "api-tester"
|
||||
name = "Resona"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"reqwest",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "api-tester"
|
||||
name = "Resona"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
default-run = "api-tester"
|
||||
default-run = "resona"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
|
||||
|
||||
0
src-tauri/src/client/mod.rs
Normal file
0
src-tauri/src/client/mod.rs
Normal file
@@ -3,3 +3,17 @@ mod collection;
|
||||
|
||||
pub use workspace::*;
|
||||
pub use collection::*;
|
||||
|
||||
pub fn handlers() -> impl Fn(tauri::ipc::Invoke) -> bool {
|
||||
tauri::generate_handler![
|
||||
create_workspace,
|
||||
get_workspaces,
|
||||
get_workspace,
|
||||
update_workspace,
|
||||
delete_workspace,
|
||||
create_collection,
|
||||
get_workspace_collections,
|
||||
update_collection,
|
||||
delete_collection
|
||||
]
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
mod api;
|
||||
mod models;
|
||||
mod storage;
|
||||
mod commands;
|
||||
mod client;
|
||||
|
||||
use commands::handlers as h;
|
||||
use storage::Storage;
|
||||
use tauri::Manager;
|
||||
use std::sync::Mutex;
|
||||
|
||||
fn main() {
|
||||
let handlers = h();
|
||||
tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
let app_dir = app.path().app_data_dir()
|
||||
@@ -19,17 +21,7 @@ fn main() {
|
||||
app.manage(Mutex::new(storage));
|
||||
Ok(())
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::create_workspace,
|
||||
commands::get_workspaces,
|
||||
commands::get_workspace,
|
||||
commands::update_workspace,
|
||||
commands::delete_workspace,
|
||||
commands::create_collection,
|
||||
commands::get_workspace_collections,
|
||||
commands::update_collection,
|
||||
commands::delete_collection,
|
||||
])
|
||||
.invoke_handler(handlers)
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ pub struct Storage {
|
||||
|
||||
impl Storage {
|
||||
pub fn new(app_dir: PathBuf) -> rusqlite::Result<Self> {
|
||||
let db_path = app_dir.join("api-client.db");
|
||||
let db_path = app_dir.join("resona.db");
|
||||
let data_dir = app_dir.join("data");
|
||||
|
||||
fs::create_dir_all(&data_dir).map_err(|e| rusqlite::Error::InvalidPath(data_dir.clone()))?;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "api-client",
|
||||
"productName": "resona",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.api-client.app",
|
||||
"identifier": "com.resona.app",
|
||||
"build": {
|
||||
"beforeDevCommand": "bun run dev",
|
||||
"devUrl": "http://localhost:1420",
|
||||
@@ -12,7 +12,7 @@
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "api-client",
|
||||
"title": "resona",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user