Files
filebrowser/CONTRIBUTING.md
T

8.3 KiB

Contributing to FileBrowser Quantum

Thank you for your interest in contributing to FileBrowser Quantum! This guide will help you get started with development.

Prerequisites

  • Go 1.27+ (see backend/go.mod)
  • Node.js 26+ and npm 11.20.0+ (see frontend/package.json)
  • Docker (optional, for containerized development)
  • Git especially important on Windows -- needed for bash support.

Optional Tools

  • ffmpeg/ffprobe: For media features (subtitles, thumbnails, heic)
    • Ubuntu/Debian: sudo apt-get install ffmpeg
    • macOS: brew install ffmpeg
    • Windows: Download from ffmpeg.org

Document thumbnails (PDF, EPUB, Office Open XML, and similar) are generated in-process via folio. An optional office integration is used as a fallback for formats folio does not handle and for in-browser editing.

Quick Start

# 1. Clone the repository
git clone https://github.com/gtsteffaniak/filebrowser.git
cd filebrowser

# 2. Initial setup - installs dependencies and creates test config
make setup

# 3. Run in development mode with hot-reloading
make dev

make setup installs all dependencies and creates a test configuration file. make dev runs the development server and Air together, so frontend and backend changes reload automatically. make run builds the frontend and starts the server once. Note: changes require ctrl+c and re-run.

Project Architecture

Backend (Go)

  • Entry Point: backend/main.go → backend/cmd/
  • HTTP Server: backend/internal/web/ - API routes, middleware, auth
  • Storage: SQLite via backend/internal/database/
  • Authentication: Multiple providers in backend/internal/auth/
  • Indexing: Real-time search in backend/pkg/indexing/
  • Previews: Image/video/document generation in backend/internal/preview/
  • Activity: Query, recording, and export logic in backend/internal/activity/
  • Settings: Configuration handling in backend/pkg/settings/
  • API docs: Swagger docs in backend/swagger/, generated by make generate-docs

Frontend (Vue.js + TypeScript)

  • Framework: Vue 3 + Vite + TypeScript
  • State: Custom store in frontend/src/store/
  • API Client: Axios-based in frontend/src/api/
  • Views and components: frontend/src/views/ (pages) and frontend/src/components/ (feature-based), with shared logic in frontend/src/composables/
  • i18n: 25+ languages with English as the source locale, typed with generated types (see Translations).

Development Commands

Essential Commands

make dev             # Start development server with hot-reloading
make test            # Run all tests
make lint            # Check code quality
make check-all       # Lint + tests
make build-frontend  # Build frontend only
make build-backend   # Build backend only (embeds the frontend build)
make build           # Build frontend and backend
make build-docker    # Build Docker image
make generate-docs   # Regenerate swagger docs

Frontend Development

Note: consider using make commands above instead.

cd frontend
npm run lint       # Biome
npm run i18n:check # i18n checks
npm run lint:fix   # Auto-fix Biome issues
npm run typecheck  # vue-tsc
npm run test       # Vitest
npm run i18n:types # Regenerate i18n types

Testing

Running Tests

make test              # All tests
make test-backend      # Go tests with race detection
make test-frontend     # Frontend unit tests
make test-playwright   # E2E tests in Docker

E2E tests are split into projects (for example general, settings, sharing, noauth, jwt, proxy, oidc and previews). make test-playwright runs all of them, and PROJECT=<name> runs only one.

Code Standards

Backend (Go)

  • Linting: backend/.golangci.yml with 30+ checks
  • Format: Use gofmt (automated in CI)
  • Testing: Maintain 80%+ coverage
  • Errors: Handle all errors explicitly

Frontend (Vue.js)

  • Linting: Biome (frontend/biome.json) and vue-tsc for type checking. make lint-frontend runs both plus the i18n checks.
  • Components: New components should use <script setup lang="ts">. We are currently migrating from the Options API.
  • Types: Use TypeScript for new code. Existent .js files are being migrated too.
  • i18n: All user-facing text goes through the typed t(), see below.
  • Fix: Run npm run lint:fix before committing.

Translations

This only covers the basics, visit the documentation page for more details.

frontend/src/i18n/locales/en.json is the master language. Types are generated from it into frontend/src/i18n/messages.generated.ts, so keys and {placeholders} are checked at compile time.

import { useI18n } from "@/i18n/index.ts";

const { t } = useI18n();
t("general.all");
  • Import useI18n from @/i18n/index.ts. In templates of <script setup> in vue files, use the same t.
  • Every key in en.json must be used somewhere in src/.
  • Use Strings literals and avoid using dynamic keys.

When changing a key in en.json:

make generate-translation-types  # regenerate messages.generated.ts
make sync-translations           # translates new keys in the other locales (needs DEEPL_API_KEY)
make check-translations          # run the i18n checks

Contributing new translations

Language files are located at frontend/src/i18n/locales. The master language is en.json -- all other languages derive from this one.

To add a new language is very simple:

  1. Create frontend/src/i18n/locales/<your-locale>.json, for example es.json. Start from a copy of en.json.
  2. Register it in frontend/src/i18n/locales.ts, in alphabetical order.
// 'name': What to display in UI
// 'file': The filename without extension
// 'tag': BCP 47 matching navigator.language
  es: { name: 'Español', file: 'es', tag: 'es' }

Build & Deployment

Single Binary Build

The project builds into a single binary with embedded frontend:

make build-frontend  # Build Vue.js app
make build-backend   # Build Go binary with embedded assets

Docker

make build-docker        # Image with ffmpeg
make build-docker-slim   # Slim image
make build-docker-gpu  # GPU image (amd64, ffmpeg-gpu base)

Configuration

  • Test Config: backend/test_config.yaml Auto-generated after running make setup

Contributing

All changes go into dev/vX.X.X branches, so PRs must target one of them. For how dev branches are promoted to beta and stable releases, see the Release Strategy.

The version in the name decides what the branch is for:

  • Higher version (e.g. dev/v2.2.0): new features and big changes.
  • Lower version (e.g. dev/v2.1.6): bug fixes only.

Older dev branches may still exist but are no longer in use. Make sure you target the right one: the highest version for features, the newest lower version for bug fixes. Check the releases page to see the current beta version.

Always verify if the change you're about to submit exists already in one of the dev/vX.X.X branches to avoid duplicates.

Pull Request Process

  1. Fork and create a feature branch from the matching dev/vX.X.X branch.
  2. Make your changes following the code standards.
  3. Run make setup and make dev to build and run with your changes. Supports hot-reloading frontend and backend changes.
  4. When ready, run make check-all to verify linting, tests, translations and icons. You can also run the Playwright tests locally with make test-playwright.
  5. Submit PR against the matching dev/vX.X.X branch with a clear description.

PR Requirements

  • Clear description of changes.
  • All tests must pass.
  • Follow existing code patterns.
  • Update documentation if needed (see our documentation and it's repository).
  • Regenerate generated files you affect (swagger docs, translation types, icons).

PRs are also reviewed automatically by CodeRabbit.

Commit Format

type(scope): description

Types: feat, fix, docs, refactor, test, chore