inital working version
This commit is contained in:
@@ -59,6 +59,7 @@ StoryCove is a self-hosted web application designed to store, organize, and read
|
||||
CREATE TABLE stories (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
title VARCHAR(500) NOT NULL,
|
||||
summary TEXT,
|
||||
author_id UUID NOT NULL,
|
||||
content_html TEXT NOT NULL,
|
||||
content_plain TEXT NOT NULL,
|
||||
@@ -67,7 +68,7 @@ CREATE TABLE stories (
|
||||
series_id UUID,
|
||||
volume INTEGER,
|
||||
rating INTEGER CHECK (rating >= 1 AND rating <= 5),
|
||||
cover_image_path VARCHAR(500),
|
||||
cover_image_path VARCHAR(500), -- Phase 2: Consider storing base filename without size suffix
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (author_id) REFERENCES authors(id),
|
||||
@@ -82,7 +83,7 @@ CREATE TABLE authors (
|
||||
name VARCHAR(255) NOT NULL UNIQUE,
|
||||
notes TEXT,
|
||||
author_rating INTEGER CHECK (author_rating >= 1 AND author_rating <= 5),
|
||||
avatar_image_path VARCHAR(500),
|
||||
avatar_image_path VARCHAR(500), -- Phase 2: Consider storing base filename without size suffix
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
@@ -136,6 +137,7 @@ CREATE TABLE story_tags (
|
||||
"fields": [
|
||||
{"name": "id", "type": "string"},
|
||||
{"name": "title", "type": "string"},
|
||||
{"name": "summary", "type": "string", "optional": true},
|
||||
{"name": "author_name", "type": "string"},
|
||||
{"name": "content", "type": "string"},
|
||||
{"name": "tags", "type": "string[]"},
|
||||
@@ -264,6 +266,11 @@ Serve images (covers or avatars)
|
||||
- type: "covers" or "avatars"
|
||||
- filename: stored filename
|
||||
|
||||
**Phase 2 Enhancement**: Support for size variants
|
||||
- `GET /api/images/{type}/{filename}?size=thumb|medium|full`
|
||||
- Default to 'full' if no size specified
|
||||
- Return appropriate resized version
|
||||
|
||||
#### DELETE /api/stories/{id}/cover
|
||||
Remove cover image from story
|
||||
|
||||
@@ -334,6 +341,20 @@ Get all stories in a series ordered by volume
|
||||
- Theme selection (Light/Dark)
|
||||
- Reading width preference
|
||||
|
||||
### 5.3 Color Specifications
|
||||
|
||||
#### Light Mode
|
||||
- **Background**: Off-White (#FAFAF8)
|
||||
- **Primary Text**: Charcoal (#2C3E50)
|
||||
- **Headers**: Deep Navy (#0A1628)
|
||||
- **Accents**: Teal Blue (#2A4D5C)
|
||||
|
||||
#### Dark Mode
|
||||
- **Background**: Deep Navy (#0A1628)
|
||||
- **Primary Text**: Warm Cream (#F5E6D3)
|
||||
- **Headers**: Warm Cream (#F5E6D3)
|
||||
- **Accents**: Golden Amber (#D4A574)
|
||||
|
||||
## 6. Technical Implementation Details
|
||||
|
||||
### 6.1 Frontend (Next.js)
|
||||
@@ -362,6 +383,25 @@ Get all stories in a series ordered by volume
|
||||
// Automatic image optimization on backend
|
||||
```
|
||||
|
||||
#### Theme Implementation
|
||||
```typescript
|
||||
// CSS Variables approach for theme switching
|
||||
// Light Mode:
|
||||
--color-background: #FAFAF8;
|
||||
--color-text-primary: #2C3E50;
|
||||
--color-text-header: #0A1628;
|
||||
--color-accent: #2A4D5C;
|
||||
|
||||
// Dark Mode:
|
||||
--color-background: #0A1628;
|
||||
--color-text-primary: #F5E6D3;
|
||||
--color-text-header: #F5E6D3;
|
||||
--color-accent: #D4A574;
|
||||
|
||||
// Theme preference stored in localStorage
|
||||
// Respects system preference on first visit
|
||||
```
|
||||
|
||||
### 6.2 Backend (Spring Boot)
|
||||
|
||||
#### Key Dependencies
|
||||
@@ -410,7 +450,15 @@ Get all stories in a series ordered by volume
|
||||
// Automatic resizing: covers to 800x1200 max, avatars to 400x400
|
||||
// Store in filesystem: /app/images/covers/ and /app/images/avatars/
|
||||
// Generate unique filenames using UUID
|
||||
// Thumbnail generation for list views
|
||||
// Current: Single size per image type
|
||||
|
||||
// PHASE 2 ENHANCEMENT: Multi-size generation during upload
|
||||
// Generate multiple sizes for optimal performance:
|
||||
// - Cover images: thumbnail (200x300), medium (400x600), full (800x1200)
|
||||
// - Avatar images: small (64x64), medium (200x200), full (400x400)
|
||||
// Store with naming convention: {uuid}_thumb.jpg, {uuid}_medium.jpg, {uuid}_full.jpg
|
||||
// Frontend selects appropriate size based on usage context
|
||||
// Significant bandwidth and loading time improvements
|
||||
```
|
||||
|
||||
### 6.3 Search Integration
|
||||
@@ -525,10 +573,25 @@ APP_PASSWORD=application_password_here
|
||||
- Content extraction rules per site
|
||||
- Image download and storage
|
||||
|
||||
### 9.2 Image Support
|
||||
- Image storage in filesystem or S3-compatible storage
|
||||
- Image optimization pipeline
|
||||
- Inline image display in stories
|
||||
### 9.2 Enhanced Image Processing & Optimization
|
||||
- **Multi-size generation during upload**
|
||||
- Cover images: thumbnail (200x300), medium (400x600), full (800x1200)
|
||||
- Avatar images: small (64x64), medium (200x200), full (400x400)
|
||||
- Automatic format optimization (WebP when supported)
|
||||
- Progressive JPEG for faster loading
|
||||
- **Smart image serving**
|
||||
- Context-aware size selection in frontend
|
||||
- Responsive images with srcset support
|
||||
- Lazy loading implementation
|
||||
- **Storage optimization**
|
||||
- Image compression with quality settings
|
||||
- Optional cloud storage integration (S3-compatible)
|
||||
- Automatic cleanup of unused images
|
||||
- **Advanced features**
|
||||
- Image metadata extraction (dimensions, EXIF)
|
||||
- Batch image processing tools
|
||||
- Image quality assessment and warnings
|
||||
- Inline image display in stories (future)
|
||||
|
||||
### 9.3 Story Collections
|
||||
- Collection management interface
|
||||
|
||||
Reference in New Issue
Block a user