Skip to content
docs
DonateOperator Pass

APIGetting started

Edit on GitHub

Set up a development environment

The repository has a dev container with the tools and services you need to run Fluxer from source. Read Contributing before you start on a change.

  • Docker Engine or Docker Desktop.
  • An editor that supports dev containers, such as Visual Studio Code.
  • At least 4 CPU cores, 8 GB of memory and 32 GB of disk for the container.
  • Go 1.27 if you work on fluxer_native or fluxer_rexctl, or want to run the docs link check. The dev container doesn't include Go.
  1. Clone the repository.

    git clone https://github.com/fluxerapp/fluxer.git
  2. Open the folder in your editor. In Visual Studio Code, install the Dev Containers extension and run "Dev Containers: Reopen in Container" from the command palette.

The container has Node.js 26, pnpm, Rust, Erlang, Gleam and the libraries the media proxy needs. Next to it, Docker Compose starts PostgreSQL, Valkey, NATS, LiveKit, Meilisearch and Mailpit. The first build compiles FFmpeg and libheif from source and takes a while.

When the container is created, it runs cargo run -p fluxer-dev -- bootstrap. This installs the JavaScript dependencies, downloads the spellcheck dictionaries, writes the gateway's development config, waits for the services and starts SeaweedFS for file storage. Run pnpm dev:bootstrap to do it again, for example after the first start failed.

When .devcontainer/Dockerfile changes on main, rebuild the container with "Dev Containers: Rebuild Container". A container keeps the image it was built from until you rebuild it, and the Rust build can then fail with C errors from fluxer_media_proxy because a library it needs is missing or too old.

Open and rebuild the container from your editor. The Compose project is called fluxer-dev, and the node_modules, Cargo and database volumes belong to that project. If you start the stack by hand with docker compose up, your editor can't adopt the containers that command creates.

Start every part of the stack from the repository root inside the container.

pnpm dev

The tasks start one after another, and the first start takes a while because it compiles the Rust services. Then open http://localhost:8088, the one port everything goes through.

PathWhat it opens
/The web app
/apiThe API
/gatewayThe gateway
/mediaThe media proxy
/adminThe admin panel
/devmailMailpit, which catches every email the stack sends, such as sign-up verification

By default pnpm dev runs the proxy, services, media, push, admin, api, gateway-single, worker, app and app-proxy tasks. To run only some of these tasks, give their names after the command.

pnpm dev proxy api worker gateway-single app app-proxy

The gateway task runs a local gateway cluster and gateway-single runs one gateway. Pick one of the two, because pnpm dev won't start both.

The development settings are in config/env/development.env, and your own overrides go in config/env/local.env or .env.local, which Git ignores.

These commands manage the services Docker Compose runs next to the container.

CommandWhat it does
pnpm dev:infra:statusLists the services and their state
pnpm dev:infra:stopStops them
pnpm dev:infra:startStarts them again
pnpm dev:infra:restartStops and starts them

If uploads fail because file storage is down, cargo run -p fluxer-dev -- media-proxy doctor --repair starts SeaweedFS again. Its log is .fluxer/dev/logs/seaweedfs.log.

Pull requests run these checks in CI, among others. Run them inside the container, from the repository root. Before you change anything, run them once on an unchanged checkout of main to see which failures were already there.

CheckCommand
Formatting and lint for TypeScriptpnpm lint
Type checkspnpm typecheck
TypeScript testspnpm test
Unused files, exports and dependenciespnpm knip
Rust formattingcargo fmt --all -- --check
Rust lintcargo clippy --all-targets --all-features --locked -- -D warnings
Rust testscargo test --all-features --locked
Gateway formatting, lint, build and teststools/ci/run.sh gateway --step all_checks

pnpm typecheck and pnpm test run the code generators they need first. pnpm test runs the tests of every workspace package and then the API tests, which need NATS. Inside the container they use nats://nats:4222, and you can point them elsewhere with FLUXER_NATS_URL. To run one package's tests, filter on it, as in pnpm --filter fluxer_api test for the API package.

If you change text that gets translated, run pnpm i18n:compile and commit the catalog files it changes. CI fails when they are out of date.

For changes to these docs, pnpm docs:dev starts a preview and pnpm docs:build builds the site the way CI does. CI also checks every docs link with go run ./internal/lint/doclinks .. from the fluxer_rexctl folder.

FolderWhat's in it
fluxer_apiThe API and its background worker, in TypeScript
fluxer_appThe web app, which the desktop app also uses
fluxer_desktopThe Electron desktop app and its native modules
fluxer_gatewayThe real-time gateway, in Gleam on the Erlang VM, with Rust native code
fluxer_media_proxyServes and processes images and video, in Rust and C
fluxer_adminThe admin panel, in Rust
fluxer_app_proxyServes the web app's pages
fluxer_pushPush notification delivery
fluxer_users, fluxer_messages, fluxer_snowflakes, fluxer_unfurl, fluxer_gifsRust services for users, messages, IDs, link previews and GIF search
fluxer_serverOne binary that runs the Rust services together
fluxer_svc, fluxer_commonCode the Rust services share
fluxer_nativefluxerd, the Go supervisor a self-hosted instance runs
fluxer_rexctlrexctl, the Go command for installing and running an instance
fluxer_staticStatic files such as emoji, avatars and email assets
fluxer_docsThis site
packagesTypeScript packages the API, the web app and the desktop app share
toolsfluxer-dev for local development, fluxer-ci for CI and the release build scripts
deploy, packagingThe Docker Compose file, the Helm chart, the container image and the systemd service
config/envDevelopment settings
.devcontainerThe dev container

Architecture shows how these parts run together on an instance, and Building from source shows how to build a release tarball or image.