# kaimosystemsolutions/kaimo_file_server architecture

> Architecture diagram of the GitHub repository kaimosystemsolutions/kaimo_file_server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kaimosystemsolutions/kaimo_file_server
- Repository: https://github.com/kaimosystemsolutions/kaimo_file_server

## Overview

Kaimo File Server is a self-hosted file server with granular access control, configurable storage, external-storage connections, synchronization, and search. Users access files through the web UI or SMB; authorization and file services govern operations against local or connected storage. Administrators configure shares, permissions, external connections, sync jobs, and notifications. The tree and excerpts support the sync-query, storage-provider, SMB authorization, and search layers shown here; several broader capability links are documented by the README but their runtime wiring was not sampled.

Main entry points: [`src/Kaimo_File_Server.Core/Services/File/FileService.cs`](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/File/FileService.cs) (File service), [`src/Kaimo_File_Server.SmbBridge/Services/AuthzGrpcService.cs`](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.SmbBridge/Services/AuthzGrpcService.cs) (SMB authorization), [`src/Kaimo_File_Server.Core/Services/Sync/SyncQueryService.cs`](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/Sync/SyncQueryService.cs) (Sync enumeration), [`src/Kaimo_File_Server.Search/ElasticSearchService.cs`](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Search/ElasticSearchService.cs) (Search service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and files"]
  node_web_ui["Web UI"]
  node_browse_api["Browse API"]
  node_auth["Authentication<br/>[ILoginService.cs]"]
  node_acl["ACL service<br/>[AclService.cs]"]
  node_smb_authz["SMB authorization"]
  node_file_service["File service<br/>[FileService.cs]"]
  node_file_versions["File versions"]
end

subgraph group_storage["Storage and sync"]
  node_storage_engine["Storage engine<br/>[IStorageEngine.cs]"]
  node_local_storage["Filesystem storage"]
  node_storage_connections["Storage connections"]
  node_provider_catalog["Provider catalog"]
  node_sync_scheduler["Sync scheduler"]
  node_sync_runner["Sync execution"]
  node_sync_api["Client sync API"]
  node_sync_query["Sync enumeration"]
end

subgraph group_search["Search"]
  node_search_indexing["Search indexing"]
  node_search_service["Search service"]
  node_search_ui["Global search"]
end

subgraph group_operations["Administration"]
  node_database[("Application database")]
  node_sync_admin["Sync configuration"]
  node_notifications["Notifications"]
end

node_web_user(("Web user"))
node_smb_client(("SMB client"))
node_external_provider["External storage"]
node_smtp["SMTP gateway"]

node_web_user -->|"uses"| node_web_ui
node_web_ui -->|"requests files"| node_browse_api
node_browse_api -->|"handles browsing"| node_file_service
node_file_service -->|"checks access"| node_acl
node_file_service -->|"performs file I/O"| node_storage_engine
node_storage_engine -->|"uses"| node_local_storage
node_smb_client -->|"requests authorization"| node_smb_authz
node_smb_authz -->|"resolves user"| node_auth
node_smb_authz -->|"checks permissions"| node_acl
node_sync_admin -->|"loads connections"| node_storage_connections
node_sync_admin -->|"signals schedule"| node_sync_scheduler
node_sync_scheduler -->|"dispatches jobs"| node_sync_runner
node_sync_runner -->|"selects provider"| node_provider_catalog
node_provider_catalog -->|"opens sessions"| node_external_provider
node_sync_api -->|"requests enumeration"| node_sync_query
node_sync_query -->|"lists files"| node_file_service
node_sync_query -->|"reads sync state"| node_database
node_file_service -.->|"version support"| node_file_versions
node_search_indexing -->|"updates index"| node_search_service
node_search_ui -->|"searches files"| node_search_service
node_search_service -->|"filters results"| node_acl
node_notifications -->|"persists events"| node_database
node_notifications -.->|"sends mail"| node_smtp

click node_web_ui "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Components/Pages/Files/FileBrowser/FileBrowser.razor.cs"
click node_browse_api "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Controllers/Api/BrowseApiController.cs"
click node_auth "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Security/ILoginService.cs"
click node_acl "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Security/AclService.cs"
click node_smb_authz "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.SmbBridge/Services/AuthzGrpcService.cs"
click node_file_service "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/File/FileService.cs"
click node_file_versions "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/File/FileVersionService.cs"
click node_storage_engine "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Storage/IStorageEngine.cs"
click node_local_storage "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Storage/FileSystemStorage.cs"
click node_database "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Persistence/ApplicationDbContext.cs"
click node_storage_connections "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Repositories/StorageConnectionRepository.cs"
click node_provider_catalog "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/ExternalStorage/StorageConnectionProviderCatalog.cs"
click node_sync_admin "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Components/ViewModels/ExternalStorage/ExternalStorageSyncViewModel.cs"
click node_sync_scheduler "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Clouds/CloudSyncSchedulerService.cs"
click node_sync_runner "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Clouds/CloudSyncExecutionService.cs"
click node_sync_api "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Controllers/Api/SyncApiController.cs"
click node_sync_query "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/Sync/SyncQueryService.cs"
click node_search_indexing "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Services/SearchIndexingService.cs"
click node_search_service "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Search/ElasticSearchService.cs"
click node_search_ui "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Components/Search/GlobalSearch.razor.cs"
click node_notifications "https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Notifications/DbNotificationPublisher.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_ui,node_browse_api,node_auth,node_acl,node_smb_authz,node_file_service,node_file_versions,node_web_user,node_smb_client toneBlue
class node_storage_engine,node_local_storage,node_storage_connections,node_provider_catalog,node_sync_scheduler,node_sync_runner,node_sync_api,node_sync_query,node_external_provider toneAmber
class node_search_indexing,node_search_service,node_search_ui toneMint
class node_database,node_sync_admin,node_notifications toneRose
class node_smtp toneIndigo
```

## Components

### Access and files

- [Web UI](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Components/Pages/Files/FileBrowser/FileBrowser.razor.cs): `src/Kaimo_File_Server.Web/Components/Pages/Files/FileBrowser/FileBrowser.razor.cs`
- [Browse API](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Controllers/Api/BrowseApiController.cs): `src/Kaimo_File_Server.Web/Controllers/Api/BrowseApiController.cs`
- [Authentication](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Security/ILoginService.cs): `src/Kaimo_File_Server.Core/Security/ILoginService.cs`
- [ACL service](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Security/AclService.cs): `src/Kaimo_File_Server.Core/Security/AclService.cs`
- [SMB authorization](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.SmbBridge/Services/AuthzGrpcService.cs): `src/Kaimo_File_Server.SmbBridge/Services/AuthzGrpcService.cs`
- [File service](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/File/FileService.cs): `src/Kaimo_File_Server.Core/Services/File/FileService.cs`
- [File versions](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/File/FileVersionService.cs): `src/Kaimo_File_Server.Core/Services/File/FileVersionService.cs`

### Storage and sync

- [Storage engine](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Storage/IStorageEngine.cs): `src/Kaimo_File_Server.Core/Storage/IStorageEngine.cs`
- [Filesystem storage](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Storage/FileSystemStorage.cs): `src/Kaimo_File_Server.Infrastructure/Storage/FileSystemStorage.cs`
- [Storage connections](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Repositories/StorageConnectionRepository.cs): `src/Kaimo_File_Server.Infrastructure/Repositories/StorageConnectionRepository.cs`
- [Provider catalog](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/ExternalStorage/StorageConnectionProviderCatalog.cs): `src/Kaimo_File_Server.Infrastructure/ExternalStorage/StorageConnectionProviderCatalog.cs`
- [Sync scheduler](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Clouds/CloudSyncSchedulerService.cs): `src/Kaimo_File_Server.Infrastructure/Clouds/CloudSyncSchedulerService.cs`
- [Sync execution](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Clouds/CloudSyncExecutionService.cs): `src/Kaimo_File_Server.Infrastructure/Clouds/CloudSyncExecutionService.cs`
- [Client sync API](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Controllers/Api/SyncApiController.cs): `src/Kaimo_File_Server.Web/Controllers/Api/SyncApiController.cs`
- [Sync enumeration](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Core/Services/Sync/SyncQueryService.cs): `src/Kaimo_File_Server.Core/Services/Sync/SyncQueryService.cs`

### Search

- [Search indexing](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Services/SearchIndexingService.cs): `src/Kaimo_File_Server.Infrastructure/Services/SearchIndexingService.cs`
- [Search service](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Search/ElasticSearchService.cs): `src/Kaimo_File_Server.Search/ElasticSearchService.cs`
- [Global search](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Components/Search/GlobalSearch.razor.cs): `src/Kaimo_File_Server.Web/Components/Search/GlobalSearch.razor.cs`

### Administration

- [Application database](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Persistence/ApplicationDbContext.cs): `src/Kaimo_File_Server.Infrastructure/Persistence/ApplicationDbContext.cs`
- [Sync configuration](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Web/Components/ViewModels/ExternalStorage/ExternalStorageSyncViewModel.cs): `src/Kaimo_File_Server.Web/Components/ViewModels/ExternalStorage/ExternalStorageSyncViewModel.cs`
- [Notifications](https://github.com/kaimosystemsolutions/kaimo_file_server/blob/master/src/Kaimo_File_Server.Infrastructure/Notifications/DbNotificationPublisher.cs): `src/Kaimo_File_Server.Infrastructure/Notifications/DbNotificationPublisher.cs`

### Other components

- **Web user**
- **SMB client**
- **External storage**
- **SMTP gateway**

## Connections

- Web user → Web UI: uses
- Web UI → Browse API: requests files
- Browse API → File service: handles browsing
- File service → ACL service: checks access
- File service → Storage engine: performs file I/O
- Storage engine → Filesystem storage: uses
- SMB client → SMB authorization: requests authorization
- SMB authorization → Authentication: resolves user
- SMB authorization → ACL service: checks permissions
- Sync configuration → Storage connections: loads connections
- Sync configuration → Sync scheduler: signals schedule
- Sync scheduler → Sync execution: dispatches jobs
- Sync execution → Provider catalog: selects provider
- Provider catalog → External storage: opens sessions
- Client sync API → Sync enumeration: requests enumeration
- Sync enumeration → File service: lists files
- Sync enumeration → Application database: reads sync state
- File service → File versions: version support
- Search indexing → Search service: updates index
- Global search → Search service: searches files
- Search service → ACL service: filters results
- Notifications → Application database: persists events
- Notifications → SMTP gateway: sends mail
