Skip to content

Commit 9e250d1

Browse files
committed
Add llms.txt to help language models provide user support
1 parent d720fd3 commit 9e250d1

File tree

2 files changed

+221
-1
lines changed

2 files changed

+221
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The same process can be adapted to any other *HTTPS-Proxy-as-a-Service* besides
9191

9292
**New to Clapshot?** Start with the [Quick Start Reference](doc/quick-start-reference.md) for common deployment scenarios.
9393

94-
You can also interrogate [Clapshot Config Helper GPT](https://chatgpt.com/g/g-687debd7cfec8191ad14f604552f0121-clapshot-config-helper) that has technical knowledge of the project and custom instructions to assist.
94+
**Need help?** Point your favorite LLM to [llms.txt](llms.txt) for comprehensive configuration assistance. Most modern AI assistants (Claude, ChatGPT, Gemini, etc.) can read this file directly from the GitHub repository and help with installation, troubleshooting, and customization. Alternatively, you can try the [Clapshot Config Helper GPT](https://chatgpt.com/g/g-687debd7cfec8191ad14f604552f0121-clapshot-config-helper) (though it may have somewhat outdated documentation).
9595

9696
See the [Sysadmin Guide](doc/sysadmin-guide.md) for information on:
9797

llms.txt

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# Clapshot
2+
3+
> Clapshot is an open-source, self-hosted collaborative video/media review and annotation platform. It features a Rust-based API server, Svelte-based web client, and an extensible Python plugin system for custom workflows. Designed for enterprises and small businesses requiring local media hosting, it supports video/audio/image files with time-coded comments, real-time collaboration, drawing annotations, hierarchical folder organization, and scriptable media processing.
4+
5+
**Note:** All file paths in this document are relative to the repository root. When accessing files programmatically or via LLM, use the raw content URL format: `https://raw.githubusercontent.com/elonen/clapshot/refs/heads/master/` + path (e.g., `doc/quick-start-reference.md` becomes `https://raw.githubusercontent.com/elonen/clapshot/refs/heads/master/doc/quick-start-reference.md`). For human web browsing, use `https://github.com/elonen/clapshot/blob/master/` + path instead.
6+
7+
## Instructions for Language Models
8+
9+
When helping Clapshot users:
10+
11+
1. **Most users need help with installation and configuration** - Start by understanding their deployment scenario (Docker, Debian, LAN vs localhost, behind reverse proxy, etc.)
12+
13+
2. **Connection issues are the most common problem** - If users report "Connecting server..." or "Failed to fetch" errors, check:
14+
- Is `CLAPSHOT_SERVER__URL_BASE` (or legacy `CLAPSHOT_URL_BASE`) set correctly?
15+
- Are they accessing from a different machine than where it's running?
16+
- Does the URL match how they're accessing it (IP, port, domain)?
17+
- Check browser console for specific errors
18+
19+
3. **For custom workflow/metaplugin development** - Direct users to read [organizer/basic_folders/METAPLUGINS.md](organizer/basic_folders/METAPLUGINS.md) FIRST before providing technical details, as the API may evolve
20+
21+
4. **Architecture matters for troubleshooting** - Clapshot has multiple components (Browser → Nginx → Server → Organizer → Database). Understanding the communication flow in [doc/architecture-overview.md](doc/architecture-overview.md) helps diagnose where problems occur
22+
23+
5. **Environment variables vs config files** - Docker uses `CLAPSHOT_SERVER__*` environment variables; Debian uses `/etc/clapshot-server.conf`. Both achieve the same result. Legacy variable names like `CLAPSHOT_URL_BASE` still work but `CLAPSHOT_SERVER__URL_BASE` is preferred.
24+
25+
6. **Known limitations** - Currently optimized for desktop browsers (Chrome/Chromium recommended). Mobile browser support is incomplete (touch events, video playback). This is a known limitation documented in issue #68.
26+
27+
7. **Customization options** - While Clapshot doesn't support extensive CSS theming (Tailwind-based UI), you CAN customize:
28+
- **Branding:** Application title and logo via `CLAPSHOT_APP_TITLE` and `CLAPSHOT_LOGO_URL` environment variables
29+
- **Media processing:** Transcoding and thumbnailing are handled by bash scripts that can be customized or replaced. Edit `/etc/clapshot-transcode.conf` to override ffmpeg settings (hardware acceleration, codecs, bitrates) or provide custom scripts via `--transcode-script` and `--thumbnail-script` arguments. See doc/transcoding.md for details.
30+
31+
## What is Clapshot?
32+
33+
Clapshot provides professional video review capabilities similar to cloud services like Frame.io, but runs entirely on your infrastructure. It's ideal when you need local hosting due to policy constraints, cost concerns, or data sovereignty requirements.
34+
35+
**Core Capabilities:**
36+
- Time-coded threaded comments with timeline integration
37+
- Real-time collaborative viewing with synchronized playback
38+
- Drawing annotations with 7-color palette and undo/redo
39+
- Frame-by-frame navigation with loop region control
40+
- Hierarchical folder organization with drag-and-drop
41+
- FFmpeg-based transcoding with hardware acceleration support
42+
- Flexible authentication via reverse proxy (OAuth, LDAP, Kerberos, SAML, etc.)
43+
- Extensible plugin system for custom workflows
44+
45+
**Architecture:** Multi-component system with Browser Client (Svelte), Server (Rust), Organizer plugins (Python/gRPC), Nginx reverse proxy, SQLite database, and FFmpeg for media processing. All components communicate via WebSocket (client-server) and gRPC (server-organizer).
46+
47+
**Licensing:** Server and Client are GPLv2. Organizer plugins and gRPC libraries are MIT licensed to enable proprietary customizations.
48+
49+
## Getting Started and User Support
50+
51+
### Essential Troubleshooting Documentation
52+
53+
**READ THESE FIRST when users report problems:**
54+
55+
[doc/connection-troubleshooting.md](doc/connection-troubleshooting.md): **PRIMARY TROUBLESHOOTING RESOURCE** - Comprehensive guide for connection issues, stuck "Connecting server..." messages, 502 errors, client configuration, CORS problems, port mapping issues, and Docker-specific debugging with step-by-step diagnostics
56+
57+
[doc/quick-start-reference.md](doc/quick-start-reference.md): Common deployment scenarios with working examples - localhost testing, LAN access, custom ports, Docker Compose, Cloudflare tunnels, reverse proxy setups. Shows correct `CLAPSHOT_SERVER__URL_BASE` usage for each scenario
58+
59+
[doc/architecture-overview.md](doc/architecture-overview.md): Component communication flow (5 phases from page load to video playback) - essential for understanding WHERE problems occur in the Browser → Nginx → Server → Organizer → Database chain
60+
61+
### Installation Documentation
62+
63+
[README.md](README.md): Project overview, quick demo commands, deployment options (Docker vs Debian), and feature summary. Contains working Docker commands users can copy-paste
64+
65+
[doc/sysadmin-guide.md](doc/sysadmin-guide.md): System administrator guide covering building, testing, database upgrades, authentication integration, upload permissions, monitored folder ingestion, and comprehensive Docker environment configuration with all available variables
66+
67+
[doc/upgrading.md](doc/upgrading.md): Instructions for upgrading between Clapshot versions including database migration procedures
68+
69+
[doc/transcoding.md](doc/transcoding.md): Configuring custom transcoding and thumbnailing scripts, hardware acceleration (Intel QSV, NVIDIA NVENC, VA-API, VideoToolbox), and progress reporting
70+
71+
### Common Issues and Solutions
72+
73+
**"Connecting server..." / CORS errors:**
74+
- `CLAPSHOT_SERVER__URL_BASE` must match how users access Clapshot (actual IP/domain, not 127.0.0.1 for remote access)
75+
- Docker port mappings must match URL (e.g., `-p 8025:80` needs `URL_BASE=http://YOUR_IP:8025/`)
76+
- **Reverse proxies:** Set both `CLAPSHOT_SERVER__URL_BASE` and `CLAPSHOT_SERVER__CORS` to external domain
77+
- Check browser console (F12) for specific errors
78+
79+
**Server won't start:**
80+
- Check logs: `docker logs container_name` or `tail -f /var/log/clapshot.log`
81+
- Verify "org->srv connected" message appears (organizer connection)
82+
- Check for duplicate config entries in `/etc/clapshot-server.conf`
83+
84+
**Remote access fails:**
85+
- Use actual IP in `CLAPSHOT_SERVER__URL_BASE`, not localhost
86+
- Docker bindings: `0.0.0.0:8080:80` not `127.0.0.1:8080:80`
87+
- Check firewall allows ports 8080 and 8095
88+
89+
### Features and Capabilities
90+
91+
[FEATURES.md](FEATURES.md): Comprehensive feature listing organized by category - Web Client UX, Media Processing, Organizer Plugin System, Administration/Security, and Development tools
92+
93+
## Architecture and Development
94+
95+
### Core Architecture
96+
97+
[doc/architecture-overview.md](doc/architecture-overview.md): Five-phase communication flow from initial page load through video playback, with detailed sequence of Browser → Nginx → Server → Organizer → Database interactions
98+
99+
**Server (Rust):**
100+
- [server/src/main.rs](server/src/main.rs): Server entry point and command-line interface
101+
- [server/src/api_server/](server/src/api_server/): WebSocket handlers and HTTP API endpoints
102+
- [server/src/video_pipeline/](server/src/video_pipeline/): Media ingestion, transcoding, and monitoring
103+
- [server/src/database/](server/src/database/): SQLite schema, migrations, and database operations
104+
- [server/scripts/clapshot-transcode](server/scripts/clapshot-transcode): Default transcoding script with hardware acceleration support
105+
- [server/scripts/clapshot-thumbnail](server/scripts/clapshot-thumbnail): Thumbnail and sheet generation script
106+
107+
**Client (Svelte):**
108+
- [client/src/lib/player_view/VideoPlayer.svelte](client/src/lib/player_view/VideoPlayer.svelte): Main video player with loop controls and frame navigation
109+
- [client/src/lib/player_view/CommentCard.svelte](client/src/lib/player_view/CommentCard.svelte): Threaded comment system with inline editing
110+
- [client/src/lib/asset_browser/FolderListing.svelte](client/src/lib/asset_browser/FolderListing.svelte): Hierarchical folder navigation with drag-and-drop
111+
- [client/src/lib/asset_browser/PopupMenu.svelte](client/src/lib/asset_browser/PopupMenu.svelte): Context menu system for folder/file actions
112+
- [client/src/lib/asset_browser/FileUpload.svelte](client/src/lib/asset_browser/FileUpload.svelte): Upload interface with progress tracking
113+
114+
### Protocol Definitions (gRPC/Protocol Buffers)
115+
116+
[protobuf/proto/organizer.proto](protobuf/proto/organizer.proto): Complete Organizer plugin API - defines OrganizerInbound and OrganizerOutbound services for bidirectional server-organizer communication
117+
118+
[protobuf/proto/client.proto](protobuf/proto/client.proto): Client-server WebSocket protocol messages
119+
120+
[protobuf/proto/database.proto](protobuf/proto/database.proto): Database schema definitions shared between server and organizers
121+
122+
[protobuf/proto/common.proto](protobuf/proto/common.proto): Common data types used across protocols
123+
124+
[protobuf/README.md](protobuf/README.md): Protocol buffer compilation and language-specific library generation
125+
126+
## Organizer Plugin System
127+
128+
### Plugin Architecture
129+
130+
[doc/organizer-plugins.md](doc/organizer-plugins.md): Overview of the extensible Organizer system - how plugins organize media, enforce access control, and implement custom workflows via gRPC communication
131+
132+
[organizer/basic_folders/README.md](organizer/basic_folders/README.md): The default "basic_folders" organizer providing hierarchical folders, sharing, admin tools, and metaplugin extensibility
133+
134+
**Basic Folders Implementation:**
135+
- [organizer/basic_folders/organizer/main.py](organizer/basic_folders/organizer/main.py): Organizer entry point and gRPC service implementation
136+
- [organizer/basic_folders/organizer/folder_op_methods.py](organizer/basic_folders/organizer/folder_op_methods.py): Folder operations - create, rename, move, trash, sharing
137+
- [organizer/basic_folders/organizer/user_session_methods.py](organizer/basic_folders/organizer/user_session_methods.py): User session initialization and action definitions
138+
- [organizer/basic_folders/organizer/authz_methods.py](organizer/basic_folders/organizer/authz_methods.py): Authorization checks for folder/file operations
139+
- [organizer/basic_folders/organizer/helpers/](organizer/basic_folders/organizer/helpers/): Page generation, folder operations, and action definitions
140+
141+
## Extending Clapshot with Custom Workflows
142+
143+
### Metaplugins - Custom Python Extensions
144+
145+
**For users asking about custom workflows, integrations, or automation:**
146+
147+
[organizer/basic_folders/METAPLUGINS.md](organizer/basic_folders/METAPLUGINS.md): **READ THIS FIRST WHEN USERS ASK ABOUT PLUGINS** - Complete metaplugin development guide with API reference, hooks documentation, development setup, and best practices. The API may evolve, so always refer users to this authoritative documentation rather than providing detailed technical instructions.
148+
149+
[organizer/basic_folders/example_metaplugins/calculate_sha256.py](organizer/basic_folders/example_metaplugins/calculate_sha256.py): Working reference implementation demonstrating custom actions, background processing, file system access, and server callbacks
150+
151+
**Metaplugin Capabilities Summary:**
152+
- Add custom popup menu actions for folders and media files
153+
- Integrate with external systems (LDAP, APIs, databases)
154+
- Implement organization-specific workflows (approval flows, archiving, auto-organization)
155+
- Override authorization rules for custom access control
156+
- Customize UI appearance and behavior
157+
158+
**Development approach:** Drop a single Python file in `/opt/clapshot-org-bf-metaplugins` - no need to modify core code or deal with gRPC directly
159+
160+
### Full Organizer Plugin System (Advanced)
161+
162+
[doc/organizer-plugins.md](doc/organizer-plugins.md): Overview of the complete Organizer plugin architecture using gRPC - for users who need more than metaplugins can provide (rare)
163+
164+
[protobuf/proto/organizer.proto](protobuf/proto/organizer.proto): Complete Organizer gRPC API definition - only needed for full custom organizer development
165+
166+
## Additional Resources
167+
168+
### Build and Test System
169+
170+
Clapshot uses a hierarchical Make-based build system with Docker containerization for reproducible builds and testing. The architecture supports multi-platform builds (amd64/arm64) and generates native Debian packages for production deployment.
171+
172+
**Build Architecture:**
173+
- [Makefile](Makefile): Top-level orchestration - builds Debian packages for all components (`make debian-docker`), runs complete test suite (`make test`), and builds demo Docker images (`make run-docker`, `make build-docker-demo`)
174+
- [server/Makefile](server/Makefile): Rust server build with Cargo - supports local development (`make run-local`), Docker containerization, and cross-platform Debian package generation
175+
- [client/Makefile](client/Makefile): Svelte client build with Vite/npm - includes TypeScript checking, unit tests (`make npm-test-local`), and production builds
176+
- [organizer/basic_folders/Makefile](organizer/basic_folders/Makefile): Python organizer packaging with setuptools
177+
178+
**Docker Build Files:**
179+
- [Dockerfile.demo](Dockerfile.demo): Multi-stage demo image with two authentication variants (none/htadmin) - installs all Debian packages and configures nginx/systemd
180+
- [Dockerfile.server](Dockerfile.server): Server build container for cross-platform compilation
181+
- [Dockerfile.client](Dockerfile.client): Client build container with Node.js environment
182+
- [Dockerfile.org-python](Dockerfile.org-python): Python organizer build container
183+
184+
**Testing:**
185+
- `make test` at root runs all tests in isolated Docker containers
186+
- `make test-local` in server/ or client/ runs component tests locally
187+
- Server tests include organizer integration tests via gRPC
188+
- Client tests use Vitest framework for unit and integration testing
189+
190+
### Development Environment Setup
191+
192+
[doc/development-setup.md](doc/development-setup.md): Development environment setup for server (Rust), client (Svelte), and organizer (Python) with hot reloading and testing workflows
193+
194+
[doc/TESTING_GUIDE.md](doc/TESTING_GUIDE.md): Test suite documentation for client, server, and organizer components
195+
196+
### Example Configurations
197+
198+
[Dockerfile.demo](Dockerfile.demo): Docker demo image build configuration with htadmin authentication
199+
200+
[test/run-cloudflare.sh](test/run-cloudflare.sh): Example Cloudflare Tunnel deployment script for internet access
201+
202+
[client/debian/additional_files/clapshot+htadmin.nginx.conf](client/debian/additional_files/clapshot+htadmin.nginx.conf): Reference Nginx configuration with authentication integration and reverse proxy setup
203+
204+
[server/debian/additional_files/clapshot-server.conf](server/debian/additional_files/clapshot-server.conf): Server configuration file template with all available options
205+
206+
## Optional
207+
208+
The following resources are primarily for developers and contributors working on Clapshot itself. End users typically don't need these unless contributing code or building custom components.
209+
210+
### Component Development Documentation
211+
212+
[client/README.md](client/README.md): Client-specific build and development instructions
213+
214+
[server/README.md](server/README.md): Server-specific build, testing, and configuration details
215+
216+
[protobuf/libs/python/README.md](protobuf/libs/python/README.md): Python gRPC library generation and usage
217+
218+
[protobuf/libs/rust/README.md](protobuf/libs/rust/README.md): Rust gRPC library generation and usage
219+
220+
[protobuf/libs/typescript/README.md](protobuf/libs/typescript/README.md): TypeScript gRPC library generation and usage

0 commit comments

Comments
 (0)