Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
check:
name: Type Check & Build Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install frontend dependencies
run: npm ci

- name: Type check
run: npx tsc --noEmit

- name: Build frontend
run: npm run build

build:
name: Build Tauri App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install frontend dependencies
run: npm ci

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
libvips-dev \
build-essential \
pkg-config

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "./src-tauri"

- name: Build frontend
run: npm run build

- name: Create temporary SQLite database for sqlx verification
run: |
touch ci-test.db
echo "DATABASE_URL=sqlite:ci-test.db" >> src-tauri/.env

- name: Install Tauri CLI
run: cargo install tauri-cli --version "^2"

- name: Build Tauri app
run: cargo tauri build --ci --verbose
working-directory: ./src-tauri
env:
DATABASE_URL: sqlite:ci-test.db
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: write

jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-22.04
args: ""
- platform: macos-latest
args: ""
- platform: windows-latest
args: ""

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install system dependencies (Linux)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libvips-dev \
libclang-dev \
libsqlite3-dev \
pkg-config

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install frontend dependencies
run: npm ci

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri

- name: Create dummy database for sqlx
run: |
touch dummy.db
echo "DATABASE_URL=sqlite://dummy.db" > src-tauri/.env
shell: bash

- name: Build and publish with Tauri
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: "Praetorian ${{ github.ref_name }}"
releaseBody: "See the assets to download this version and start using it."
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
46 changes: 35 additions & 11 deletions PROMPT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
# Role
# Phase 1 Prompt
Prompt: "I am going to build this in stages. For now, just understand the architecture and do not generate code yet."

# Phase 2 Prompt - The Skeleton Setup
Prompt: "Initialize the Tauri v2 + Rust + React project structure. Configure `Cargo.toml` with dependencies for SQLite, libvips, and ONNX Runtime (with CUDA support). Create the basic database schema but don't implement the full business logic yet. At each phase of the project make sure the app is buildable and compiles successfully."

# Phase 3 Prompt - The UI Shell
Prompt: "Create a React layout using Tailwind CSS that mimics Lightroom's dark mode interface (Sidebar, Main Grid, Right Panel). Connect it to Tauri but use mock data for now."

# Phase 4 Prompts - Feature by Feature work

## Iteration A
Prompt: "Implement the Rust backend logic to scan a directory and save paths to SQLite."

## Iteration B
Prompt: Implement the libvips background worker to generate thumbnails and smart previews."

## Iteration C
Prompt: "Integrate ONNX Runtime for face detection using GPU acceleration."

---

# Full Project Requirements

## Role
Act as a Senior Systems Architect specializing in Rust and Tauri applications. You are building "Praetorian," a high-performance, local-first photo library application designed to replace Lightroom Classic's cataloging features while offering modern AI capabilities.

# Tech Stack & Architecture Constraints
## Tech Stack & Architecture Constraints
1. **Framework:** Tauri v2 (System WebView) + React/TypeScript/Tailwind CSS.
2. **Backend Language:** Rust.
3. **Database:** SQLite (`rusqlite` or `sqlx`). This acts as the "Catalog" file (`.praetorian`).
Expand All @@ -14,39 +38,39 @@ Act as a Senior Systems Architect specializing in Rust and Tauri applications. Y
- Use **ONNX Runtime** with CUDA/Vulkan execution providers to leverage the user's GPU (Nvidia/AMD) for face detection.
- Priority: Accuracy over speed for face recognition, but it must run asynchronously in a background thread to avoid UI lag.

# Core Requirements & Features (MVP)
## Core Requirements & Features (MVP)

## 1. The "Catalog" System
### 1. The "Catalog" System
- **Database Location:** The app should allow the user to select/create a `.praetorian` catalog file (SQLite). This database stores metadata, paths, and face embeddings.
- **Metadata Sync:** While the DB is source of truth, provide an option to export ratings/tags back to XMP sidecars or DNG files (IPTC).
- **Import Workflow:** Ability to scan directories (e.g., SD Card) and index photos into the catalog without moving them.

## 2. Tiered Image Loading Pipeline (The "Smart Preview" Logic)
### 2. Tiered Image Loading Pipeline (The "Smart Preview" Logic)
Implement a background worker that triggers on import:
1. Generate a tiny thumbnail for the grid view.
2. Generate a "Smart Preview" (e.g., 2048px width, compressed JPEG) stored alongside the catalog or in a cache folder.
3. When a user clicks an image, load the Smart Preview immediately; only fetch the full RAW file if they zoom in deeply or export.

## 3. Photo Details & EXIF Metadata View
### 3. Photo Details & EXIF Metadata View
- **Metadata Panel:** A dedicated UI panel (similar to Lightroom's right-hand sidebar) that displays detailed info for selected images.
- **Data Points:** Must display Camera Make/Model, Lens Model, Date/Time Original, ISO, Aperture, Shutter Speed, Focal Length, and GPS Location (if available).
- **Indexing:** Store this EXIF data in the SQLite catalog to allow fast filtering later (e.g., "Show all photos taken with Canon 5D").

## 4. Face Recognition Engine
### 4. Face Recognition Engine
- **Model:** Use a high-accuracy model (e.g., YOLOv8-face or RetinaFace) via ONNX Runtime.
- **GPU Support:** Configure Rust to automatically detect and use GPU acceleration if available.
- **Re-indexing:** Add a feature button "Rebuild Face Index" that triggers a full rescan of the library asynchronously.

## 5. AI Upscaling Bridge (Python Integration)
### 5. AI Upscaling Bridge (Python Integration)
- We need a bridge between Rust and Python for upscaling features.
- Implement a mechanism where Rust can spawn a Python subprocess (or use `pyo3`) to run an external script (e.g., Real-ESRGAN) on selected images.

# UI/UX Guidelines (Lightroom Cloud Style)
- **Aesthetic:** Clean, dark-mode default, minimal chrome, focus on the image grid.
## UI/UX Guidelines (Lightroom Cloud Style)
- **Aesthetic:** Clean, dark-mode default, minimal chrome, focus on the image grid. Look to ./design/mockups/00000-4162059048.png to base the look and feel on.
- **Performance:** The main gallery must use "Virtual Scrolling" (windowing) to render thousands of thumbnails without lagging the main thread.
- **Responsiveness:** UI should not freeze during heavy background tasks (thumbnailing or face detection).

# Implementation Plan for this Session
## Implementation Plan for this Session
Please provide:
1. **Database Schema:** A robust SQLite schema handling `Images`, `Faces`, `People` (face embeddings), and `Folders`. Ensure it includes columns for all major EXIF tags mentioned above.
2. **The Background Worker Architecture:** Show how to use Rust's `tokio` runtime to handle the asynchronous generation of Smart Previews without blocking the Tauri UI thread.
Expand Down
Binary file added app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading