feat: scaffold Tauri v2 + Svelte 5 project with base layout and utilities

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-21 10:45:53 -04:00
parent 95815ca6e0
commit 5cf61578ae
80 changed files with 8832 additions and 0 deletions

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

@@ -0,0 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas

4914
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

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

@@ -0,0 +1,40 @@
[package]
name = "tauri-app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "tauri_app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-shell = "2.3.6"
tauri-plugin-dialog = "2.7.3"
tauri-plugin-store = "2.4.5"
tauri-plugin-process = "2.3.1"
tokio = { version = "1.53.1", features = ["full"] }
thiserror = "2.0.20"
uuid = { version = "1.26.1", features = ["v4"] }
tempfile = "3.27.0"
# Read the optimization guideline for more details: https://tauri.app/concept/size/#cargo-configuration
[profile.release]
codegen-units = 1
lto = true
opt-level = 3
panic = "abort"
strip = true

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

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

View File

@@ -0,0 +1,18 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"core:default",
"shell:allow-execute",
"shell:allow-open",
"dialog:allow-open",
"dialog:allow-save",
"store:allow-get",
"store:allow-set",
"store:allow-save",
"store:allow-load",
"process:allow-exit"
]
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

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: 5.5 KiB

View File

@@ -0,0 +1 @@
// Dependency check and install commands — implemented in Task 2

View File

@@ -0,0 +1 @@
// Clip export commands — implemented in Task 12

View File

@@ -0,0 +1 @@
// Keyframe, waveform, thumbnail extraction commands — implemented in Tasks 9-11

View File

@@ -0,0 +1,4 @@
pub mod dependencies;
pub mod export;
pub mod media_analysis;
pub mod video;

View File

@@ -0,0 +1 @@
// Video resolve and download commands — implemented in Task 4/5

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

@@ -0,0 +1,14 @@
mod commands;
mod models;
mod services;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_store::Builder::new().build())
.plugin(tauri_plugin_process::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

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

@@ -0,0 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
tauri_app_lib::run()
}

105
src-tauri/src/models.rs Normal file
View File

@@ -0,0 +1,105 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VideoMetadata {
pub url: String,
pub title: String,
pub duration: f64,
pub fps: f64,
pub thumbnail_url: Option<String>,
pub stream_url: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Clip {
pub id: String,
pub start_time: f64,
pub end_time: f64,
pub label: String,
pub color: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ThumbnailSpritesheet {
pub file_path: String,
pub start_index: usize,
pub count: usize,
pub thumb_width: u32,
pub thumb_height: u32,
pub columns: u32,
pub interval_seconds: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", tag = "type")]
pub enum CookieSource {
#[serde(rename = "browser")]
Browser { browser: String },
#[serde(rename = "file")]
File { path: String },
#[serde(rename = "none")]
None,
}
impl CookieSource {
pub fn to_ytdlp_args(&self) -> Vec<String> {
match self {
CookieSource::Browser { browser } => {
vec!["--cookies-from-browser".to_string(), browser.clone()]
}
CookieSource::File { path } => {
vec!["--cookies".to_string(), path.clone()]
}
CookieSource::None => vec![],
}
}
}
impl Default for CookieSource {
fn default() -> Self {
CookieSource::Browser {
browser: "firefox".to_string(),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", tag = "mode")]
pub enum CutMode {
#[serde(rename = "lossless")]
Lossless,
#[serde(rename = "precise")]
Precise { format: String },
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", tag = "scope")]
pub enum ExportScope {
#[serde(rename = "individual")]
Individual,
#[serde(rename = "merged")]
Merged,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExportConfig {
pub clips: Vec<Clip>,
pub cut_mode: CutMode,
pub export_scope: ExportScope,
pub output_directory: String,
pub video_title: String,
pub source_file_path: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DependencyStatus {
pub name: String,
pub installed: bool,
pub version: Option<String>,
pub install_command: String,
}

View File

@@ -0,0 +1 @@
// Implemented in Task 12

View File

@@ -0,0 +1 @@
// Implemented in Task 2

View File

@@ -0,0 +1 @@
// Implemented in Task 5

View File

@@ -0,0 +1 @@
// Implemented in Task 9

View File

@@ -0,0 +1,7 @@
pub mod clip_exporter;
pub mod dependency_manager;
pub mod download_manager;
pub mod keyframe_index;
pub mod thumbnail_extractor;
pub mod video_resolver;
pub mod waveform_generator;

View File

@@ -0,0 +1 @@
// Implemented in Task 11

View File

@@ -0,0 +1 @@
// Implemented in Task 4

View File

@@ -0,0 +1 @@
// Implemented in Task 10

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

@@ -0,0 +1,35 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Video Clipper",
"version": "0.1.0",
"identifier": "xyz.cottongin.gui-video-clipper",
"build": {
"beforeDevCommand": "npm run dev",
"devUrl": "http://localhost:1420",
"beforeBuildCommand": "npm run build",
"frontendDist": "../dist"
},
"app": {
"windows": [
{
"title": "Video Clipper",
"width": 800,
"height": 600
}
],
"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"
]
}
}