Skip to content

Commit 35fb1d3

Browse files
committed
add more documentation, correct drifts
1 parent b7b2ae0 commit 35fb1d3

File tree

10 files changed

+152
-59
lines changed

10 files changed

+152
-59
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ Contributions welcome! Check out our [Contribution Guide](docs/Contribute.md) an
4141

4242
## Installation
4343

44+
### Quick Try (Docker)
45+
46+
Want to quickly test Lychee? Use the minimal docker-compose template:
47+
48+
```bash
49+
curl -O https://raw.githubusercontent.com/LycheeOrg/Lychee/master/docker-compose.minimal.yaml
50+
docker compose -f docker-compose.minimal.yaml up -d
51+
```
52+
53+
Then open http://localhost:8000 in your browser. This setup includes a separate worker container for background jobs.
54+
4455
### Docker (Recommended)
4556

4657
The easiest way to deploy Lychee with all dependencies configured:

docs/specs/1-concepts/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ Album
7272
├─ has children → Albums (self-referencing, nested tree)
7373
├─ owned by → User (many-to-one)
7474
├─ has → AccessPermissions (one-to-many)
75-
├─ has → Statistics (one-to-one)
75+
├─ has → AlbumSizeStatistics (one-to-one) - size/count aggregates
76+
├─ has → Statistics (one-to-one) - visit/download tracking
7677
└─ can be → Purchasable (one-to-one)
7778
7879
Photo
@@ -132,4 +133,4 @@ Now that you understand Lychee's core concepts:
132133

133134
---
134135

135-
*Last updated: December 22, 2025*
136+
*Last updated: January 21, 2026*

docs/specs/2-how-to/configure-pagination.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# How-To: Configure Album and Photo Pagination
22

33
**Author:** Lychee Team
4-
**Last Updated:** 2026-01-10
4+
**Last Updated:** 2026-01-21
55
**Feature:** 007-pagination
66
**Related:** [Feature 007 Spec](../4-architecture/features/007-pagination/spec.md)
77

@@ -20,7 +20,7 @@ Pagination improves performance and user experience for large galleries:
2020

2121
## Configuration Settings
2222

23-
Pagination is configured through four settings in the admin panel under **Settings > Gallery**.
23+
Pagination is configured through six settings in the admin panel under **Settings > Gallery**.
2424

2525
### Page Size Settings
2626

@@ -98,6 +98,32 @@ Controls how users load additional album pages. Same options as photos.
9898
| Default | infinite_scroll |
9999
| Location | Settings > Gallery |
100100

101+
### Infinite Scroll Threshold Settings
102+
103+
These settings control when the next page loads during infinite scroll mode.
104+
105+
#### photos_infinite_scroll_threshold
106+
107+
Controls how early to trigger loading the next page of photos.
108+
109+
| Property | Value |
110+
|----------|-------|
111+
| Type | Integer |
112+
| Default | 2 |
113+
| Location | Settings > Gallery |
114+
115+
The value represents the number of viewport heights from the bottom of the page at which to trigger loading. A higher value means earlier loading (preloading more content), but may load unnecessary data if the user doesn't scroll that far.
116+
117+
#### albums_infinite_scroll_threshold
118+
119+
Controls how early to trigger loading the next page of albums. Same behavior as photos threshold.
120+
121+
| Property | Value |
122+
|----------|-------|
123+
| Type | Integer |
124+
| Default | 2 |
125+
| Location | Settings > Gallery |
126+
101127
## Configuring via Admin Panel
102128

103129
1. Log in as an administrator

docs/specs/2-how-to/sql-timeout-logging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The max execution time is configured in `config/octane.php`:
4141

4242
### 1. Query Execution Logging
4343

44-
**Location**: [app/Providers/AppServiceProvider.php:238-300](app/Providers/AppServiceProvider.php#L238-L300)
44+
**Location**: [app/Providers/AppServiceProvider.php:261-350](app/Providers/AppServiceProvider.php#L261-L350)
4545

4646
The `logSQL()` method logs queries after they complete with severity based on execution time:
4747
- **Debug**: Normal slow queries (>100ms)
@@ -52,15 +52,15 @@ The `logSQL()` method logs queries after they complete with severity based on ex
5252

5353
**Location**: [app/Listeners/LogQueryTimeout.php](app/Listeners/LogQueryTimeout.php)
5454

55-
Registered in [app/Providers/EventServiceProvider.php:97-99](app/Providers/EventServiceProvider.php#L97-L99)
55+
Registered in [app/Providers/EventServiceProvider.php:99](app/Providers/EventServiceProvider.php#L99)
5656

5757
This listener provides detailed logging for queries that exceed warning/critical thresholds:
5858
- **70% threshold**: WARNING level log
5959
- **90% threshold**: CRITICAL/ERROR level log
6060

6161
### 3. PHP Timeout Handler
6262

63-
**Location**: [app/Providers/AppServiceProvider.php:200-216](app/Providers/AppServiceProvider.php#L200-L216)
63+
**Location**: [app/Providers/AppServiceProvider.php:204-220](app/Providers/AppServiceProvider.php#L204-L220)
6464

6565
A shutdown function that catches when PHP times out entirely, logging:
6666
- Error message
@@ -125,7 +125,7 @@ PDO::MYSQL_ATTR_INIT_COMMAND => 'SET SESSION wait_timeout=28800', // 8 hours
125125

126126
### Octane Database Ping
127127

128-
The AppServiceProvider pings database connections every 30 seconds to prevent timeouts: [app/Providers/AppServiceProvider.php:340-341](app/Providers/AppServiceProvider.php#L340-L341)
128+
The AppServiceProvider pings database connections every 30 seconds to prevent timeouts: [app/Providers/AppServiceProvider.php:409-424](app/Providers/AppServiceProvider.php#L409-L424)
129129

130130
## Viewing Logs
131131

docs/specs/2-how-to/translating-lychee.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ return [
3737
Ensure consistency across all languages:
3838

3939
```bash
40-
php artisan test --filter TranslationTest
40+
php artisan test --filter LangTest
4141
```
4242

4343
### Best Practices for Developers
@@ -217,4 +217,4 @@ This localization system ensures Lychee remains accessible to users worldwide wh
217217

218218
---
219219

220-
*Last updated: December 22, 2025*
220+
*Last updated: January 21, 2026*

docs/specs/2-how-to/using-renamer.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ The Renamer module allows you to automatically transform filenames during import
1818
To create a basic replacement rule:
1919

2020
1. Access the Renamer API or use the admin interface
21-
2. Define the pattern to find (needle)
22-
3. Specify the replacement text
23-
4. Choose the replacement mode (FIRST, ALL, or REGEX)
21+
2. Define the pattern to find (needle) - not needed for case/trim modes
22+
3. Specify the replacement text - not needed for case/trim modes
23+
4. Choose the replacement mode (FIRST, ALL, REGEX, TRIM, LOWER, UPPER, UCWORDS, or UCFIRST)
2424
5. Set the processing order
2525
6. Enable the rule
26+
7. Optionally set `is_photo_rule` and/or `is_album_rule` to control where the rule applies
2627

2728
### Example: Replace Camera Prefix
2829

@@ -31,13 +32,15 @@ Replace `IMG_` with `Photo_`:
3132
```php
3233
$rule = new RenamerRule();
3334
$rule->owner_id = Auth::id();
34-
$rule->name = 'Replace IMG_';
35+
$rule->rule = 'Replace IMG_';
3536
$rule->description = 'Replaces IMG_ with Photo_';
3637
$rule->needle = 'IMG_';
3738
$rule->replacement = 'Photo_';
3839
$rule->mode = RenamerModeType::FIRST; // Only replace first occurrence
3940
$rule->order = 1;
4041
$rule->is_enabled = true;
42+
$rule->is_photo_rule = true; // Apply to photo filenames
43+
$rule->is_album_rule = false; // Don't apply to album titles
4144
$rule->save();
4245
```
4346

@@ -50,7 +53,7 @@ Replace all underscores with spaces:
5053
```php
5154
$rule = new RenamerRule();
5255
$rule->owner_id = Auth::id();
53-
$rule->name = 'Underscores to Spaces';
56+
$rule->rule = 'Underscores to Spaces';
5457
$rule->description = 'Replace all underscores with spaces';
5558
$rule->needle = '_';
5659
$rule->replacement = ' ';
@@ -69,7 +72,7 @@ Use regex to add a date prefix:
6972
```php
7073
$rule = new RenamerRule();
7174
$rule->owner_id = Auth::id();
72-
$rule->name = 'Add Date Prefix';
75+
$rule->rule = 'Add Date Prefix';
7376
$rule->description = 'Extract date from filename and move to beginning';
7477
$rule->needle = '/^(.+)_(\d{4}-\d{2}-\d{2})(.+)$/';
7578
$rule->replacement = '$2_$1$3';
@@ -81,6 +84,39 @@ $rule->save();
8184

8285
**Result**: `vacation_2024-06-15_beach.jpg` becomes `2024-06-15_vacation_beach.jpg`
8386

87+
### Example: Transform Case
88+
89+
Use case transformation modes (needle/replacement are ignored for these):
90+
91+
```php
92+
// Convert to lowercase
93+
$rule = new RenamerRule();
94+
$rule->owner_id = Auth::id();
95+
$rule->rule = 'Lowercase';
96+
$rule->description = 'Convert filename to lowercase';
97+
$rule->mode = RenamerModeType::LOWER;
98+
$rule->order = 4;
99+
$rule->is_enabled = true;
100+
$rule->save();
101+
```
102+
103+
**Result**: `VACATION_Photo.jpg` becomes `vacation_photo.jpg`
104+
105+
### Example: Trim Whitespace
106+
107+
```php
108+
$rule = new RenamerRule();
109+
$rule->owner_id = Auth::id();
110+
$rule->rule = 'Trim spaces';
111+
$rule->description = 'Remove leading/trailing whitespace';
112+
$rule->mode = RenamerModeType::TRIM;
113+
$rule->order = 5;
114+
$rule->is_enabled = true;
115+
$rule->save();
116+
```
117+
118+
**Result**: ` photo name.jpg ` becomes `photo name.jpg`
119+
84120
## Applying Patterns
85121

86122
### Single Filename
@@ -259,4 +295,4 @@ Ensure:
259295

260296
---
261297

262-
*Last updated: December 22, 2025*
298+
*Last updated: January 21, 2026*

docs/specs/3-reference/api-design.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ Page sizes and UI modes are configurable via the admin settings panel or directl
297297
| photos_per_page | integer (1-1000) | 100 | Number of photos per page |
298298
| albums_pagination_ui_mode | enum | infinite_scroll | UI mode for album pagination |
299299
| photos_pagination_ui_mode | enum | infinite_scroll | UI mode for photo pagination |
300+
| albums_infinite_scroll_threshold | integer | 2 | Viewport heights from bottom to trigger album loading |
301+
| photos_infinite_scroll_threshold | integer | 2 | Viewport heights from bottom to trigger photo loading |
300302

301303
**UI Mode Options:**
302304
- `infinite_scroll` - Auto-load next page on scroll (default)
@@ -324,4 +326,4 @@ Page sizes and UI modes are configurable via the admin settings panel or directl
324326

325327
---
326328

327-
*Last updated: January 10, 2026*
329+
*Last updated: January 21, 2026*

docs/specs/3-reference/database-schema.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ Individual photos with metadata, EXIF data, and file information.
8383
- `id`: Primary key
8484
- `title`: Photo title
8585
- `description`: Optional description
86-
- `album_id`: Foreign key to Album (nullable)
8786
- `owner_id`: Foreign key to User
8887
- `type`: MIME type
8988
- `original_checksum`: SHA-256 checksum
@@ -93,13 +92,13 @@ Individual photos with metadata, EXIF data, and file information.
9392
- `latitude`, `longitude`: GPS coordinates
9493

9594
**Relationships:**
96-
- Belongs to `Album`
95+
- Belongs to many `Album` through `photo_album` pivot table (many-to-many)
9796
- Belongs to `User` (owner)
9897
- Has many `SizeVariant`
9998
- Has one `Palette`
100-
- Has many `Tag` through `photo_tag` pivot table
99+
- Has many `Tag` through `photos_tags` pivot table
101100
- Has many `PhotoRating`
102-
- Has one `PhotoStatistics` (virtual relationship for aggregated metrics)
101+
- Has one `Statistics` (visit/download tracking)
103102

104103
#### SizeVariant
105104
Different size versions of photos (original, medium, small, thumb).
@@ -228,10 +227,11 @@ This dual approach allows Lychee to provide:
228227
- **Users**: Own albums and photos, belong to user groups (SE edition)
229228

230229
### Many-to-Many
231-
- **Tags**: Many-to-many with photos through `photo_tag` pivot table
230+
- **Photos-Albums**: Many-to-many through `photo_album` pivot table (photos can belong to multiple albums)
231+
- **Tags**: Many-to-many with photos through `photos_tags` pivot table
232232

233233
### One-to-Many
234-
- **Photos**: Belong to one album, owned by one user
234+
- **Photos**: Owned by one user (but can belong to multiple albums)
235235
- **Size Variants**: Multiple variants per photo
236236
- **Access Permissions**: Multiple permissions per album
237237

@@ -258,4 +258,4 @@ Eager loading enforced with `Model::shouldBeStrict()`, which throws an exception
258258

259259
---
260260

261-
*Last updated: December 22, 2025*
261+
*Last updated: January 21, 2026*

docs/specs/3-reference/localization.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,30 @@ lang/
3939

4040
Each language directory contains the same set of PHP files that return associative arrays of translation keys:
4141

42+
- **`all_settings.php`** - Comprehensive settings labels and descriptions
43+
- **`aspect_ratio.php`** - Aspect ratio and layout options
44+
- **`changelogs.php`** - Version history and update information
45+
- **`diagnostics.php`** - System diagnostics and health checks
46+
- **`dialogs.php`** - Modal dialogs, confirmations, and user interactions
47+
- **`duplicate-finder.php`** - Duplicate photo detection
48+
- **`fix-tree.php`** - Album tree maintenance utilities
49+
- **`flow.php`** - Photo flow/timeline interface
4250
- **`gallery.php`** - Main gallery interface, albums, photos, and navigation
51+
- **`import_from_server.php`** - Server-side import functionality
52+
- **`jobs.php`** - Background job status and management
53+
- **`landing.php`** - Landing page content
54+
- **`left-menu.php`** - Left sidebar navigation menu
55+
- **`maintenance.php`** - Maintenance mode and system operations
56+
- **`profile.php`** - User profile management
57+
- **`renamer.php`** - Filename renaming rules interface
4358
- **`settings.php`** - Application settings and configuration options
44-
- **`dialogs.php`** - Modal dialogs, confirmations, and user interactions
45-
- **`toasts.php`** - Notification messages and alerts
4659
- **`sharing.php`** - Album and photo sharing functionality
47-
- **`profile.php`** - User profile management
48-
- **`users.php`** - User management (admin features)
49-
- **`user-groups.php`** - User group management
5060
- **`statistics.php`** - Statistics and analytics displays
51-
- **`maintenance.php`** - Maintenance mode and system operations
52-
- **`jobs.php`** - Background job status and management
53-
- **`diagnostics.php`** - System diagnostics and health checks
54-
- **`changelogs.php`** - Version history and update information
55-
- **`left-menu.php`** - Left sidebar navigation menu
56-
- **`landing.php`** - Landing page content
57-
- **`flow.php`** - Photo flow/timeline interface
58-
- **`fix-tree.php`** - Album tree maintenance utilities
59-
- **`duplicate-finder.php`** - Duplicate photo detection
60-
- **`aspect_ratio.php`** - Aspect ratio and layout options
61+
- **`tags.php`** - Tag management interface
62+
- **`toasts.php`** - Notification messages and alerts
63+
- **`user-groups.php`** - User group management
64+
- **`users.php`** - User management (admin features)
65+
- **`webshop.php`** - E-commerce and webshop functionality
6166

6267
## Translation Key Conventions
6368

@@ -157,7 +162,7 @@ Lychee's test suite validates translation consistency:
157162
php artisan test
158163

159164
# Run specific translation tests
160-
php artisan test --filter TranslationTest
165+
php artisan test --filter LangTest
161166
```
162167

163168
#### Common Test Failures
@@ -198,4 +203,4 @@ Weblate provides a web-based interface for translators to contribute translation
198203

199204
---
200205

201-
*Last updated: December 22, 2025*
206+
*Last updated: January 21, 2026*

0 commit comments

Comments
 (0)