How mickael-kerjean/filestash works
Filestash is a plugin-driven file management platform: users authenticate, browse or modify files across storage backends, and can search, share, preview, or automate file activity. The server initializes plugins and workflows, then exposes HTTP routes for the web client and APIs; optional plugins add storage, authentication, editors, and protocol gateways such as MCP. The README also describes native synchronization and gateway products, but this repository’s sampled runtime is principally the server. Several subsystem links below are documented capabilities rather than inspected calls because their implementation excerpts were not provided.
Main entry points: routes.go HTTP Routes · index.go Plugin Registry · files File Operations · main.go Server Startup
Components 25
Server Runtime
- Server Startup
cmd/main.go - HTTP Routes
server/routes.go - App Kernel
server/pkg/kernel - Request Middleware
server/middleware/index.go - Admin Console
server/pkg/admin/handler.go - Web Frontend
server/pkg/frontend/static.go
Identity And Access
- Session Authentication
server/pkg/session/handler_auth_direct.go - Identity Provider Login
server/pkg/session/handler_auth_idp.go - Token Service
server/pkg/token/handler.go
File Management
- File Operations
server/pkg/files - File Save
server/pkg/files/handler_save.go - File Search
server/pkg/files/handler_search.go
Plugin Ecosystem
- SQLite Full-Text Search
server/plugin/plg_search_sqlitefts/query.go - Storage Backends
server/plugin/plg_backend_local/index.go - Plugin Registry
server/plugin/index.go - Extension Runtime
server/pkg/extension/adapter/runtime/runtime.go - File Editors
server/plugin/plg_editor_wopi/handler.go - MCP Gateway
server/plugin/plg_handler_mcp/handler.go
Sharing And Automation
- Shared Links
server/pkg/share/handler.go - Workflow Engine
server/pkg/workflow/handler.go - Workflow Triggers
server/pkg/workflow/trigger - Event Journal
server/pkg/journal
Other components
- Web User
- External Storage
- MCP Client
Connections 28
- Server Startup → Plugin Registry: discovers
cmd/main.go - Server Startup → Workflow Engine: initializes
cmd/main.go - Server Startup → HTTP Routes: builds routes
cmd/main.go - Web User → HTTP Routes: uses web/API
- HTTP Routes → Session Authentication: routes authentication
server/routes.go - HTTP Routes → Token Service: routes token requests
server/routes.go - HTTP Routes → File Operations: routes file requests
server/routes.go - HTTP Routes → Admin Console: routes admin requests
server/routes.go - HTTP Routes → Shared Links: routes sharing
server/routes.go - HTTP Routes → Workflow Engine: routes workflows
server/routes.go - HTTP Routes → Request Middleware: wraps handlers
server/routes.go - Session Authentication → Token Service: injects token
server/pkg/session/handler_auth_direct.go - Identity Provider Login → Token Service: injects token
server/pkg/session/handler_auth_idp.go - File Operations → File Save: dispatches save
- File Operations → File Search: dispatches search
- File Search → SQLite Full-Text Search: queries hook
server/pkg/files/handler_search.go - File Save → Event Journal: publishes events
server/pkg/files/handler_save.go - Plugin Registry → Storage Backends: registers backends
server/plugin/index.go - Server Startup → Extension Runtime: initializes extensions
cmd/main.go - File Operations → Storage Backends: accesses storage
- Plugin Registry → File Editors: registers editor
server/plugin/index.go - Plugin Registry → MCP Gateway: registers gateway
server/plugin/index.go - Plugin Registry → SQLite Full-Text Search: registers search
- MCP Client → MCP Gateway: connects gateway
- File Editors → External Storage: fetches editor discovery
server/plugin/plg_editor_wopi/handler.go - Workflow Engine → Workflow Triggers: accepts triggers
- Workflow Triggers → Workflow Engine: starts workflows
- Shared Links → File Operations: shares file paths