Add NextSnap PWA with photo gallery viewer and continuous capture

Offline-first photo capture app for Nextcloud with:
- Camera capture with continuous mode (auto-reopens after each photo)
- File browser with fullscreen image gallery, swipe navigation, and rename
- Upload queue with background sync engine
- Admin panel for Nextcloud user management
- Service worker for offline-first caching (v13)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 04:53:13 -06:00
commit cad4118f72
55 changed files with 9038 additions and 0 deletions

43
config.py Normal file
View File

@@ -0,0 +1,43 @@
import os
class Config:
"""Application configuration loaded from environment variables."""
SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-secret-key-change-in-production')
NEXTCLOUD_URL = os.environ.get('NEXTCLOUD_URL', 'https://nextcloud.sdanywhere.com')
# Session configuration
SESSION_TYPE = 'filesystem'
SESSION_FILE_DIR = '/tmp/flask_session'
SESSION_PERMANENT = False
SESSION_USE_SIGNER = True
SESSION_COOKIE_SAMESITE = 'Strict'
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True # Set to False for local development
# Upload configuration
MAX_CONTENT_LENGTH = 50 * 1024 * 1024 # 50MB max upload
# Development mode
DEBUG = os.environ.get('FLASK_DEBUG', 'False').lower() == 'true'
class DevelopmentConfig(Config):
"""Development-specific configuration."""
DEBUG = True
SESSION_COOKIE_SECURE = False # Allow HTTP in development
class ProductionConfig(Config):
"""Production-specific configuration."""
DEBUG = False
# Ensure these are set in production
def __init__(self):
super().__init__()
if self.SECRET_KEY == 'dev-secret-key-change-in-production':
raise ValueError("SECRET_KEY must be set in production!")
# Configuration dictionary
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}