# gtsteffaniak/filebrowser architecture

> Architecture diagram of the GitHub repository gtsteffaniak/filebrowser, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gtsteffaniak/filebrowser
- Repository: https://github.com/gtsteffaniak/filebrowser

## Overview

##### Project type and purpose
- This is a full-stack, self-hosted web-based file manager (“FileBrowser Quantum”).
- It provides a Vue.js single-page application (SPA) frontend, a Go-based REST API backend, file storage adapters, a BoltDB database, real-time indexing and preview services, pluggable authentication (OIDC, TOTP, proxy), and a CLI.

##### File structure
- Top-level “frontend/”: contains a Vite/Vue 3 SPA with components, router, store, assets, CSS, API client modules, and Playwright end-to-end tests.
- Top-level “backend/”: a Go module with subpackages for HTTP (router, middleware, Swagger), authentication, adapters (FS, cache), database (Bolt), indexing, preview engines, events, settings, and CLI commands.
- “_docker/”: Dockerfiles and compose configurations for different runtime modes (general, noauth, proxy) and for running Playwright tests.
- Configuration files: YAML for both backend and Docker.
- Test suites: Go unit tests, JavaScript unit tests, and Playwright E2E.

##### Extract additional insights from README
- Tech stack: Vue 3 + Vite + Playwright; Go 1.x; BoltDB; Docker.
- Architectural highlights: modular monolith in Go with clear adapter boundaries, real-time indexing, preview pipeline, Swagger API docs, multiple deployment modes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Tier
    subgraph "Presentation Tier"
        direction TB
        Browser["Browser"]:::external
        SPA["Vue SPA"]:::frontend
        Browser -->|"HTTP/HTTPS"| SPA
    end

    %% Application Tier
    subgraph "Application Tier"
        direction TB
        API["Go HTTP API"]:::backend
        subgraph "HTTP Layer"
            direction TB
            Router["HTTP Router"]:::backend
            Middleware["Middleware"]:::backend
            Router --> Middleware
        end
        subgraph "Authentication Module"
            direction TB
            AuthCore["Auth Core"]:::backend
            OIDCHandler["OIDC Handler"]:::backend
            TOTPHandler["TOTP Handler"]:::backend
            ProxyHandler["Proxy Handler"]:::backend
            AuthCore --> OIDCHandler
            AuthCore --> TOTPHandler
            AuthCore --> ProxyHandler
        end
        subgraph "Business Logic"
            direction TB
            Indexer["Indexing Service"]:::backend
            Preview["Preview Service"]:::backend
        end
        subgraph "Adapters"
            direction TB
            FSAdapters["File System Adapters"]:::backend
        end
        subgraph "Utilities"
            direction TB
            SwaggerUI["Swagger UI"]:::backend
            CLI["CLI Commands"]:::backend
        end
        SPA -->|"API Calls (HTTP/JSON)"| API
        API --> Router
        Router -->|"Auth Check"| AuthCore
        Router -->|"Route to Index/Preview"| Indexer
        Router -->|"Route to Preview"| Preview
        Router --> SwaggerUI
        Router --> CLI
        API --> FSAdapters
        API --> DB
        Indexer --> DB
        Preview --> FSAdapters
    end

    %% Data Tier
    subgraph "Data Tier"
        direction TB
        DB[(BoltDB)]:::storage
        FileStore[(File System Storage)]:::storage
        FSAdapters --> FileStore
    end

    %% External Services
    subgraph "External Services"
        direction TB
        OIDC["OIDC IdP"]:::external
        OnlyOffice["OnlyOffice Server"]:::external
        AuthCore --> OIDC
        Preview --> OnlyOffice
    end

    %% CLI and Tests
    CLI -->|uses modules| API
    SPA -->|E2E Tests| Playwright
    subgraph "End-to-End Tests"
        direction TB
        Playwright["Playwright Tests"]:::frontend
    end

    %% Click Events
    click SPA "https://github.com/gtsteffaniak/filebrowser/tree/main/frontend/"
    click Router "https://github.com/gtsteffaniak/filebrowser/blob/main/backend/http/httpRouter.go"
    click Middleware "https://github.com/gtsteffaniak/filebrowser/blob/main/backend/http/middleware.go"
    click AuthCore "https://github.com/gtsteffaniak/filebrowser/tree/main/backend/auth/"
    click OIDCHandler "https://github.com/gtsteffaniak/filebrowser/blob/main/backend/http/oidc.go"
    click FSAdapters "https://github.com/gtsteffaniak/filebrowser/tree/main/backend/adapters/fs/diskcache/"
    click DB "https://github.com/gtsteffaniak/filebrowser/tree/main/backend/database/storage/bolt/"
    click CLI "https://github.com/gtsteffaniak/filebrowser/tree/main/backend/cmd/"
    click SwaggerUI "https://github.com/gtsteffaniak/filebrowser/tree/main/backend/swagger/docs/"
    click Playwright "https://github.com/gtsteffaniak/filebrowser/tree/main/frontend/tests-playwright/"
    click Router "https://github.com/gtsteffaniak/filebrowser/blob/main/frontend/src/router/index.ts"
    click SPA "https://github.com/gtsteffaniak/filebrowser/tree/main/frontend/src/store/"
    click SPA "https://github.com/gtsteffaniak/filebrowser/tree/main/frontend/src/api/"
    click API "https://github.com/gtsteffaniak/filebrowser/blob/main/backend/main.go"
    click Config "https://github.com/gtsteffaniak/filebrowser/blob/main/backend/config.yaml"
    click Docker "https://github.com/gtsteffaniak/filebrowser/blob/main/ _docker/docker-compose.yaml"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#005cbf,color:#005cbf
    classDef backend fill:#d4edda,stroke:#155724,color:#155724
    classDef storage fill:#fff3cd,stroke:#856404,color:#856404
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d
```
