File Browser
  • Welcome
  • Features
  • Installation
  • Upgrade from 1.x
  • Command Line Interface
    • filebrowser
    • filebrowser cmds
    • filebrowser cmds add
    • filebrowser cmds ls
    • filebrowser cmds rm
    • filebrowser config
    • filebrowser config cat
    • filebrowser config export
    • filebrowser config import
    • filebrowser config init
    • filebrowser config set
    • filebrowser hash
    • filebrowser rules
    • filebrowser rules add
    • filebrowser rules ls
    • filebrowser rules rm
    • filebrowser upgrade
    • filebrowser users
    • filebrowser users add
    • filebrowser users export
    • filebrowser users find
    • filebrowser users import
    • filebrowser users ls
    • filebrowser users rm
    • filebrowser users update
    • filebrowser version
  • Configuration
    • Custom Branding
    • Authentication Method
    • Command Runner
  • Contributing
    • Authentication Provider
    • Translations
    • CI and Releases
    • Code of Conduct
Powered by GitBook
On this page
  • Project Structure
  • Get the source code
  • Build
  • Frontend
  • Backend

Was this helpful?

Contributing

PreviousCommand RunnerNextAuthentication Provider

Last updated 1 year ago

Was this helpful?

If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our . Also, note that this project is open-source and licensed under .

Project Structure

The project is mainly composed by one , hosted on GitHub. The backend side of the application is written in , while the frontend (located on a subdirectory of the same name) is written in , a framework to produce , and .

Due to the tight coupling required by some features, basic knowledge of both Go and Vue.js is recommended.

  • Learn Go:

  • Learn Vue.js:

Get the source code

We encourage you to use git to manage your fork. To clone the main repository, just run:

git clone https://github.com/filebrowser/filebrowser

Build

Frontend

We are using on the frontend to manage the build process. The steps to build it are:

# From the root of the repo, go to frontend/
cd frontend
# Install the dependencies
npm install
# Build the frontend
npm run build

This will install the dependencies and build the frontend so you can then embed it into the Go app. Although, if you want to play with it, you'll get bored of building it after every change you do. So, you can run the command below to watch for changes:

npm run watch

Backend

First of all, you need to download the required dependencies. We are using the built-in go mod tool for dependency management. To get the modules, run:

go mod download

To build File Browser is just like any other Go program:

go build

To create a development build use the "dev" tag, this way the content inside the frontend folder will not be embedded in the binary but will be reloaded at every change:

go build -tags dev

The magic of File Browser is that the static assets are bundled into the final binary. For that, we use . The files from frontend/dist will be embedded during the build process.

Code of Conduct
Apache License 2.0
repository
Go
Vue.js
JavaScript
CSS
HTML
https://github.com/golang/go/wiki/Learn
https://vuejs.org/v2/guide/index.html
Node.js
Go embed.FS