Development

Working with Miniflux’s codebase is straightforward:

Requirements

Check Out the Source Code

Fork the project and clone the repository locally.

Miniflux uses Go Modules to manage dependencies.

Compilation

Build the application for the current platform:

make miniflux

To specify a version number:

make miniflux VERSION=2.0.29

Cross-compilation:

# Build binaries for all supported platforms
make build

# Build Linux binary for amd64 architecture
make linux-amd64

# ARM 64-bit (arm64v8)
make linux-arm64

# ARM 32-bit variant 7 (arm32v7)
make linux-armv7

# ARM 32-bit variant 6 (arm32v6)
make linux-armv6

# ARM 32-bit variant 5 (arm32v5)
make linux-armv5

# RISC-V 64-bit
make linux-riscv64

# macOS (amd64)
make darwin-amd64

# macOS (arm64 / Apple Silicon)
make darwin-arm64

# FreeBSD (amd64)
make freebsd-amd64

# FreeBSD (arm64)
make freebsd-arm64

# OpenBSD (amd64)
make openbsd-amd64

Remove Precompiled Binaries

make clean

Run the Software Locally

make run

This command runs the software in debug mode. If needed, you can run a local PostgreSQL database with Docker.

Linter

make lint

Unit Tests

make test

Integration Tests

Integration tests validate the storage layer, the REST API, the Google Reader API, and the Fever API with a real database.

You need to have PostgreSQL installed locally, preconfigured with the user “postgres” and the password “postgres”. Alternatively, you can run a local PostgreSQL database with Docker.

To run integration tests, execute the following command:

make integration-test ; make clean-integration-test

The tests create a miniflux_test database and run against an in-process server, so you don’t need to start Miniflux. make clean-integration-test drops the test database.

Build Docker Image

Miniflux supports different architectures for Docker images: amd64, arm64, arm/v7, arm/v6, and riscv64.

Build an image for the current platform:

make docker-image

Build a distroless image for the current platform:

make docker-image-distroless

The local images are tagged with the version when the current commit has a release tag, and dev otherwise. The distroless image gets a -distroless suffix, for example miniflux/miniflux:dev-distroless.

Override the image name:

make docker-image DOCKER_IMAGE=your-namespace/miniflux

Build the images for all architectures and push them to a registry:

make docker-images DOCKER_IMAGE=your-namespace/miniflux VERSION=42

VERSION is required with make docker-images. Multi-platform images are built with buildx.

Build RPM Package

You can build your own RPM package using this command:

make rpm

Note that Docker is required to generate the RPM package. All build operations are performed inside a container.

Build Debian Package

You can build your own Debian package using this command:

make debian

Use the following command to build packages for all supported architectures (amd64, arm64, armhf, and riscv64):

make debian-packages

Note that Docker is required to generate the Debian packages. All build operations are performed inside a container.

GitHub Codespaces

The Miniflux development environment is preconfigured for GitHub Codespaces. It is useful for small contributions.

Click the “Create codespace” button in the GitHub web UI to create a new development environment in the cloud. Once it’s ready, you can use Visual Studio Code to edit the source code.

Run a Local PostgreSQL Database with Docker

Based on the PostgreSQL Docker image.

You can create a local PostgreSQL database for testing easily with the following command:

docker run --rm --name local-miniflux2-db -p 5432:5432 -e POSTGRES_DB=miniflux2 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres

To persist data:

docker volume create local-miniflux2-data
docker run --rm --name local-miniflux2-db -p 5432:5432 -v local-miniflux2-data:/var/lib/postgresql -e POSTGRES_DB=miniflux2 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres

To delete data:

docker volume rm local-miniflux2-data