Compare commits
46
Commits
f0b0114fc5
...
compare
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c2504ff83 | ||
|
|
43772aba68 | ||
|
|
145368692e | ||
|
|
bf1134e47f | ||
|
|
7580036c9d | ||
|
|
47a75b428e | ||
|
|
b91a2f0a31 | ||
|
|
66795471a8 | ||
|
|
67acb8e08a | ||
|
|
af0cc52d89 | ||
|
|
3669814731 | ||
|
|
a8edc251a2 | ||
|
|
d43813cc2a | ||
|
|
97424ea0af | ||
|
|
eafc5de6f2 | ||
|
|
fa710e914e | ||
|
|
e3e337af88 | ||
|
|
15ca74ad4b | ||
|
|
a11d76fd5f | ||
|
|
cf1238bbff | ||
|
|
d3b7f31730 | ||
|
|
52c06c4db7 | ||
|
|
3a320f3187 | ||
|
|
c37e2bd5e0 | ||
|
|
9418661be9 | ||
|
|
7349015177 | ||
|
|
918a6e9414 | ||
|
|
5909c0ec99 | ||
|
|
286b0410ff | ||
|
|
0c18f570d4 | ||
|
|
3f2160405a | ||
|
|
f3f57f7c53 | ||
|
|
957aab0656 | ||
|
|
0a94548f5e | ||
|
|
124fbacd2a | ||
|
|
0f0aeed2f1 | ||
|
|
fe6e55de16 | ||
|
|
dd454ebf6f | ||
|
|
2854907359 | ||
|
|
48417b6d73 | ||
|
|
ce7abd8a29 | ||
|
|
df12413c5d | ||
|
|
c56b07f999 | ||
|
|
c89cecd43f | ||
|
|
37f6166b37 | ||
|
|
dc31b0bebb |
@@ -0,0 +1,61 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
Turbo Sorter Pro v12.5 - A dual-interface image organization tool combining Streamlit (admin dashboard) and NiceGUI (gallery interface) for managing large image collections through time-sync matching, ID collision resolution, category-based sorting, and gallery tagging with pairing capabilities.
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Run Streamlit dashboard (port 8501)
|
||||||
|
streamlit run app.py --server.port=8501 --server.address=0.0.0.0
|
||||||
|
|
||||||
|
# Run NiceGUI gallery (port 8080)
|
||||||
|
python3 gallery_app.py
|
||||||
|
|
||||||
|
# Both services (container startup)
|
||||||
|
./start.sh
|
||||||
|
|
||||||
|
# Syntax check all Python files
|
||||||
|
python3 -m py_compile *.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Dual-Framework Design
|
||||||
|
- **Streamlit (app.py, port 8501)**: Administrative dashboard with 5 modular tabs for management workflows
|
||||||
|
- **NiceGUI (gallery_app.py, port 8080)**: Modern gallery interface for image tagging and pairing operations
|
||||||
|
- **Shared Backend**: Both UIs use `SorterEngine` (engine.py) and the same SQLite database
|
||||||
|
|
||||||
|
### Core Components
|
||||||
|
|
||||||
|
| File | Purpose |
|
||||||
|
|------|---------|
|
||||||
|
| `engine.py` | Static `SorterEngine` class - all DB operations, file handling, image compression |
|
||||||
|
| `gallery_app.py` | NiceGUI gallery with `AppState` class for centralized state management |
|
||||||
|
| `app.py` | Streamlit entry point, loads tab modules |
|
||||||
|
| `tab_*.py` | Independent tab modules for each workflow |
|
||||||
|
|
||||||
|
### Database
|
||||||
|
SQLite at `/app/sorter_database.db` with tables: profiles, folder_ids, categories, staging_area, processed_log, folder_tags, profile_categories, pairing_settings.
|
||||||
|
|
||||||
|
### Tab Workflows
|
||||||
|
1. **Time-Sync Discovery** - Match images by timestamp across folders
|
||||||
|
2. **ID Review** - Resolve ID collisions between target/control folders
|
||||||
|
3. **Unused Archive** - Manage rejected image pairs
|
||||||
|
4. **Category Sorter** - One-to-many categorization
|
||||||
|
5. **Gallery Staged** - Grid-based tagging with Gallery/Pairing dual modes
|
||||||
|
|
||||||
|
## Key Patterns
|
||||||
|
|
||||||
|
- **ID Format**: `id001_`, `id002_` (zero-padded 3-digit prefix)
|
||||||
|
- **Staging Pattern**: Two-phase commit (stage → commit) with undo support
|
||||||
|
- **Image Formats**: .jpg, .jpeg, .png, .webp, .bmp, .tiff
|
||||||
|
- **Compression**: WebP with ThreadPoolExecutor (8 workers)
|
||||||
|
- **Permissions**: chmod 0o777 applied to committed files
|
||||||
|
- **Default Paths**: `/storage` when not configured
|
||||||
Binary file not shown.
Binary file not shown.
+1463
-154
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
streamlit
|
streamlit
|
||||||
Pillow
|
Pillow
|
||||||
nicegui
|
nicegui
|
||||||
|
requests
|
||||||
@@ -1,18 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# 1. Navigate to app directory
|
# NiceSorter - Start Script
|
||||||
cd /app
|
# Runs the NiceGUI gallery interface on port 8080
|
||||||
|
|
||||||
# 2. Install dependencies (Including NiceGUI if missing)
|
set -e
|
||||||
# This checks your requirements.txt AND ensures nicegui is present
|
|
||||||
pip install --no-cache-dir -r requirements.txt
|
|
||||||
|
|
||||||
# 3. Start NiceGUI in the Background (&)
|
# Navigate to app directory if running in container
|
||||||
# This runs silently while the script continues
|
if [ -d "/app" ]; then
|
||||||
echo "🚀 Starting NiceGUI on Port 8080..."
|
cd /app
|
||||||
python3 gallery_app.py &
|
fi
|
||||||
|
|
||||||
# 4. Start Streamlit in the Foreground
|
# Install dependencies if requirements.txt exists
|
||||||
# This keeps the container running
|
if [ -f "requirements.txt" ]; then
|
||||||
echo "🚀 Starting Streamlit on Port 8501..."
|
echo "📦 Installing dependencies..."
|
||||||
streamlit run app.py --server.port=8501 --server.address=0.0.0.0
|
pip install --no-cache-dir -q -r requirements.txt
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize database
|
||||||
|
echo "🗄️ Initializing database..."
|
||||||
|
python3 -c "from engine import SorterEngine; SorterEngine.init_db()"
|
||||||
|
|
||||||
|
# Start NiceGUI
|
||||||
|
echo "🚀 Starting NiceSorter on http://0.0.0.0:8080"
|
||||||
|
exec python3 gallery_app.py
|
||||||
|
|||||||
Reference in New Issue
Block a user