### Install go-swagger and openapi-generator Source: https://github.com/mattermost-community/focalboard/blob/main/server/swagger/README.md Instructions for installing the necessary tools, go-swagger and openapi-generator, using Homebrew. These tools are required for generating Swagger API files. ```bash brew tap go-swagger/go-swagger brew install go-swagger brew install openapi-generator ``` -------------------------------- ### Install NGINX Web Server Source: https://github.com/mattermost-community/focalboard/blob/main/website/site/content/docs/personal-edition/ubuntu.md Updates the package repository and installs the NGINX web server to act as a proxy for the Focalboard application. ```bash sudo apt update sudo apt install nginx ``` -------------------------------- ### Start Focalboard Website Development Server Source: https://github.com/mattermost-community/focalboard/blob/main/website/README.md This command starts the Hugo development server for the Focalboard website. It allows you to preview changes locally before deploying. Access the site at http://localhost:1313. ```bash make run ``` -------------------------------- ### Install Dependencies for Nextcloud Deck Importer Source: https://github.com/mattermost-community/focalboard/blob/main/import/nextcloud-deck/README.md Installs the necessary Node.js dependencies for the Focalboard webapp and the Nextcloud Deck importer script. This is a prerequisite for running the import process. ```bash npm install ``` ```bash npm install ``` -------------------------------- ### Install Focalboard Server Source: https://github.com/mattermost-community/focalboard/blob/main/website/site/content/docs/personal-edition/ubuntu.md Downloads the Focalboard server archive from GitHub, extracts the contents, and moves the binary to the /opt directory for execution. ```bash wget https://github.com/mattermost/focalboard/releases/download/v0.15.0/focalboard-server-linux-amd64.tar.gz tar -xvzf focalboard-server-linux-amd64.tar.gz sudo mv focalboard /opt ``` -------------------------------- ### Build and Run Focalboard Server Source: https://github.com/mattermost-community/focalboard/blob/main/docs/dev-tips.md Commands to prepare the environment, compile the server, and execute the binary. This process assumes all prerequisites are installed. ```bash make prebuild make ./bin/focalboard-server ``` -------------------------------- ### Get Board Details Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves the full configuration and properties of a specific board by its ID. ```bash curl -X GET http://localhost:8000/api/v2/boards/board123 \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Focalboard Server Configuration Source: https://context7.com/mattermost-community/focalboard/llms.txt Example configuration file for Focalboard, detailing server settings like port, database connection, file storage, and authentication modes. ```json { "serverRoot": "http://localhost:8000", "port": 8000, "dbtype": "sqlite3", "dbconfig": "./focalboard.db?_busy_timeout=5000", "postgres_dbconfig": "dbname=focalboard sslmode=disable", "useSSL": false, "webpath": "./webapp/pack", "filesdriver": "local", "filespath": "./files", "telemetry": true, "session_expire_time": 2592000, "session_refresh_time": 18000, "localOnly": false, "enableLocalMode": true, "localModeSocketLocation": "/var/tmp/focalboard_local.socket", "authMode": "native", "enablePublicSharedBoards": false } ``` -------------------------------- ### Get Team Templates (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Returns all available board templates within a specific team. This GET request requires team ID and authentication. ```bash curl -X GET http://localhost:8000/api/v2/teams/team123/templates \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Install Hugo using Homebrew (macOS) Source: https://github.com/mattermost-community/focalboard/blob/main/website/README.md This snippet shows how to install the Hugo static site generator on macOS using the Homebrew package manager. Hugo is a dependency for building the Focalboard website locally. ```bash # Eg. for Mac OS X brew install hugo ``` -------------------------------- ### Get Board Sharing Settings (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves the public sharing settings for a specific board. This GET request requires authentication and returns details about sharing status and token. ```bash curl -X GET http://localhost:8000/api/v2/boards/board123/sharing \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Orchestrate Focalboard with Docker Compose Source: https://github.com/mattermost-community/focalboard/blob/main/docker/README.md Uses Docker Compose to automate the build and execution process. Includes options for simple setups and complex configurations with Nginx and Postgres. ```bash cd focalboard/docker docker-compose up docker-compose -f docker-compose-db-nginx.yml up ``` -------------------------------- ### Build Focalboard Standalone Desktop App (Linux) Source: https://github.com/mattermost-community/focalboard/blob/main/README.md Builds a standalone Linux desktop application for Focalboard. Tested on Ubuntu 18.04. Requires `webgtk` dependencies. The `prebuild` step is necessary for installing npm dependencies. ```bash sudo apt-get install libgtk-3-dev sudo apt-get install libwebkit2gtk-4.0-dev make prebuild make linux-app tar -xzf linux/dist/focalboard-linux.tar.gz -C /path/to/your/chosen/directory /path/to/your/chosen/directory/focalboard-app ``` -------------------------------- ### Run Todoist to Focalboard Import Script Source: https://github.com/mattermost-community/focalboard/blob/main/import/todoist/README.md Executes the TypeScript importer to convert a Todoist JSON export into a Focalboard archive file. Requires dependencies to be installed via npm in the project directories. ```bash npm install cd import/todoist npm install npx ts-node importTodoist.ts -i -o archive.boardarchive ``` -------------------------------- ### Get Server Metadata using cURL Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves detailed server metadata, including version, build information, and database type. ```bash # Detailed server metadata curl -X GET http://localhost:8000/api/v2/ping ``` -------------------------------- ### Get Client Configuration using cURL Source: https://context7.com/mattermost-community/focalboard/llms.txt Fetches client-side configuration settings for Focalboard, such as telemetry and feature flag status. ```bash # Get client config curl -X GET http://localhost:8000/api/v2/clientConfig ``` -------------------------------- ### Build Focalboard Standalone Desktop App (Windows) Source: https://github.com/mattermost-community/focalboard/blob/main/README.md Builds a standalone Windows desktop application for Focalboard. Requires Windows 10, Windows 10 SDK, and .NET 4.8 developer pack. The `prebuild` step is necessary for installing npm dependencies. ```bash make prebuild make win-wpf-app cd win-wpf/msix && focalboard.exe ``` -------------------------------- ### Launch Focalboard Single-User Server via Terminal Source: https://github.com/mattermost-community/focalboard/blob/main/mac/README.md Starts the Focalboard server in single-user mode using a specific authentication token. This command is intended for local development and testing purposes. ```bash FOCALBOARD_SINGLE_USER_TOKEN=testtest make watch-single-user ``` -------------------------------- ### Build Focalboard Standalone Desktop App (macOS) Source: https://github.com/mattermost-community/focalboard/blob/main/README.md Builds a standalone macOS desktop application for Focalboard. Requires macOS 11.3+ and Xcode 13.2.1+. The `prebuild` step is necessary for installing npm dependencies. ```bash make prebuild make mac-app open mac/dist/Focalboard.app ``` -------------------------------- ### Export Single Board Archive (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Exports a single board and its associated blocks as an archive file. This GET request requires board ID and authentication. The output is saved to a file. ```bash curl -X GET http://localhost:8000/api/v2/boards/board123/archive/export \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" \ --output board-backup.focalboard ``` -------------------------------- ### Export Team Archive (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Exports all boards and blocks from a team as a downloadable archive file. This GET request requires team ID and authentication. The output is saved to a file. ```bash curl -X GET http://localhost:8000/api/v2/teams/team123/archive/export \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" \ --output team-backup.focalboard ``` -------------------------------- ### Get Cards for a Board via API Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves all cards belonging to a board. Supports pagination via page and per_page query parameters. ```bash curl -X GET "http://localhost:8000/api/v2/boards/board123/cards?page=0&per_page=50" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Get All Teams (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves a list of all teams that the current user has access to. This GET request requires authentication. ```bash curl -X GET http://localhost:8000/api/v2/teams \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Render Intro Items and Video via Hugo Templates Source: https://github.com/mattermost-community/focalboard/blob/main/website/site/themes/layouts/partials/intro.html This snippet demonstrates how to iterate over site parameters to generate intro items with titles, descriptions, and buttons. It also includes a conditional check to render a video link if enabled in the site configuration. ```go-template {{ range .Site.Params.intro.item }} {{ .title }} ------------ {{ .description }} [{{ .button}}]({{ .url }}) {{ end }} {{ if .Site.Params.intro.video.enable }} {{.Site.Params.intro.video.title | markdownify }}[]({{ .Site.Params.intro.video.url }}) {{ end }} ``` -------------------------------- ### Get User Categories (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves the user's board categories, which are used for sidebar organization. This GET request requires team ID and authentication. ```bash curl -X GET http://localhost:8000/api/v2/teams/team123/categories \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Enable NGINX Site Configuration Source: https://github.com/mattermost-community/focalboard/blob/main/website/site/content/docs/personal-edition/ubuntu.md Removes the default NGINX site, creates a symbolic link for the Focalboard configuration, tests the syntax, and reloads the service. ```bash sudo rm /etc/nginx/sites-enabled/default sudo ln -s /etc/nginx/sites-available/focalboard /etc/nginx/sites-enabled/focalboard sudo nginx -t sudo /etc/init.d/nginx reload ``` -------------------------------- ### Build and Run Focalboard with Docker Source: https://github.com/mattermost-community/focalboard/blob/main/docker/README.md Builds the Focalboard image from the project root and runs it with a persistent volume mapped to the local port 80. ```bash docker build -f docker/Dockerfile -t focalboard . docker run -it -v "fbdata:/opt/focalboard/data" -p 80:8000 focalboard ``` -------------------------------- ### GET /api/v2/boards/:boardId/members Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieve all members of a board. ```APIDOC ## GET /api/v2/boards/:boardId/members ### Description Returns all members of a board with their roles and permissions. ### Method GET ### Endpoint /api/v2/boards/:boardId/members ### Parameters #### Path Parameters - **boardId** (string) - Required - The board ID. ### Response #### Success Response (200) - **members** (array) - List of member objects including role flags. ``` -------------------------------- ### Run CI and Unit Tests Source: https://github.com/mattermost-community/focalboard/blob/main/docs/dev-tips.md Commands to execute the full suite of server and webapp tests, including linting and UI testing. ```bash make ci make server-test cd webapp && npm run check make webapp-test cd webapp && npm run cypress:ci ``` -------------------------------- ### GET /api/v2/boards/{boardId}/blocks Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves all blocks associated with a specific board. ```APIDOC ## GET /api/v2/boards/{boardId}/blocks ### Description Retrieves blocks from a board with optional filtering by parent ID and block type. ### Method GET ### Endpoint /api/v2/boards/{boardId}/blocks ### Parameters #### Path Parameters - **boardId** (string) - Required - The ID of the board. #### Query Parameters - **all** (boolean) - Optional - Set to true to retrieve all blocks. ### Response #### Success Response (200) - **blocks** (array) - List of block objects. #### Response Example [ {"id": "block1", "type": "text"} ] ``` -------------------------------- ### GET /api/v2/boards/:boardId/blocks Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieve blocks from a board, filtered by type or parent ID. ```APIDOC ## GET /api/v2/boards/:boardId/blocks ### Description Retrieves a list of blocks associated with a specific board, optionally filtered by block type or parent ID. ### Method GET ### Endpoint /api/v2/boards/:boardId/blocks ### Parameters #### Path Parameters - **boardId** (string) - Required - The unique identifier of the board. #### Query Parameters - **type** (string) - Optional - Filter blocks by type (e.g., view, card, text). - **parent_id** (string) - Optional - Filter blocks by parent identifier. ### Request Example GET /api/v2/boards/board123/blocks?type=view ### Response #### Success Response (200) - **blocks** (array) - List of block objects. #### Response Example [ { "id": "block123", "boardId": "board123", "type": "text", "title": "Description" } ] ``` -------------------------------- ### Get a Single Card via API Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves the full details of a specific card by its unique ID. ```bash curl -X GET http://localhost:8000/api/v2/cards/card123 \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### GET /api/v2/teams/{teamID}/boards Source: https://github.com/mattermost-community/focalboard/blob/main/server/swagger/README.md Retrieves a list of boards for a specific team using a bearer token. ```APIDOC ## GET /api/v2/teams/{teamID}/boards ### Description Fetches all boards associated with the specified team ID. ### Method GET ### Endpoint /api/v2/teams/{teamID}/boards ### Parameters #### Path Parameters - **teamID** (string) - Required - The unique identifier of the team. ### Request Headers - **Authorization** (string) - Required - Bearer - **X-Requested-With** (string) - Required - Must be "XMLHttpRequest" to pass CSRF check. ### Request Example curl -X GET -H "Authorization: Bearer " -H "X-Requested-With: XMLHttpRequest" http://localhost:8000/api/v2/teams/0/boards ``` -------------------------------- ### Build Focalboard for ARM64 Architecture Source: https://github.com/mattermost-community/focalboard/blob/main/docker/README.md Builds the Focalboard Docker image specifically for the linux/arm64 architecture. ```bash docker build -f docker/Dockerfile --platform linux/arm64 -t focalboard . docker run -it -v "fbdata:/opt/focalboard/data" -p 80:8000 focalboard ``` -------------------------------- ### Get Blocks via API Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves blocks from a board. Supports optional filtering by parent ID and block type. ```bash curl -X GET "http://localhost:8000/api/v2/boards/board123/blocks?all=true" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Register a New User Source: https://context7.com/mattermost-community/focalboard/llms.txt Registers a new user account with the Focalboard server. If users already exist, a signup token is required. ```bash curl -X POST http://localhost:8000/api/v2/register \ -H "Content-Type: application/json" \ -H "X-Requested-With: XMLHttpRequest" \ -d '{ "username": "admin", "email": "admin@example.com", "password": "SecureP@ssw0rd!" }' ``` -------------------------------- ### Get File using cURL Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves an uploaded file from a specific board and team. The response contains the binary content of the file. ```bash # Get uploaded file curl -X GET http://localhost:8000/api/v2/files/teams/team123/board123/file123.png \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" \ --output downloaded-file.png ``` -------------------------------- ### Create a Card via API Source: https://context7.com/mattermost-community/focalboard/llms.txt Creates a new card on a specified board. Cards represent tasks or items with custom properties. ```bash curl -X POST http://localhost:8000/api/v2/boards/board123/cards \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -H "X-Requested-With: XMLHttpRequest" \ -d '{ "title": "Implement user authentication", "icon": "🔐", "properties": { "status": "opt1", "priority": "high" }, "contentOrder": [] }' ``` -------------------------------- ### Create a New Board Source: https://context7.com/mattermost-community/focalboard/llms.txt Creates a new project board within a specific team. Supports defining board type, title, and custom card properties. ```bash curl -X POST http://localhost:8000/api/v2/boards \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -H "X-Requested-With: XMLHttpRequest" \ -d '{ "teamId": "team123", "type": "O", "title": "Project Alpha", "description": "Main project tracking board", "icon": "🚀", "showDescription": true, "cardProperties": [ { "id": "status", "name": "Status", "type": "select", "options": [ {"id": "opt1", "value": "To Do", "color": "propColorGray"}, {"id": "opt2", "value": "In Progress", "color": "propColorYellow"}, {"id": "opt3", "value": "Done", "color": "propColorGreen"} ] } ] }' ``` -------------------------------- ### Run Focalboard Locally with Docker Source: https://github.com/mattermost-community/focalboard/blob/main/README.md Provides commands to run Focalboard locally using Docker. This includes running from an official image or building the image for the current or a custom architecture. ```docker docker run -it -p 80:8000 mattermost/focalboard ``` ```docker docker build -f docker/Dockerfile . ``` ```docker docker build -f docker/Dockerfile --platform linux/arm64 . ``` -------------------------------- ### Run Nextcloud Deck Importer Script Source: https://github.com/mattermost-community/focalboard/blob/main/import/nextcloud-deck/README.md Executes the TypeScript script to convert Nextcloud Deck data into a Focalboard archive. The script requires the output file name and can accept URL and credentials via CLI arguments or interactive prompts. It imports cards, stacks, labels, descriptions, due dates, and comments from a specified board. ```bash npx ts-node importDeck.ts -o archive.boardarchive ``` -------------------------------- ### Get Team Users (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Retrieves users belonging to a specific team. Supports optional search filtering and exclusion of bots. Requires team ID and authentication. ```bash curl -X GET "http://localhost:8000/api/v2/teams/team123/users?search=john&exclude_bots=true" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" ``` -------------------------------- ### Authenticate with Focalboard Personal Server API Source: https://github.com/mattermost-community/focalboard/blob/main/server/swagger/README.md Demonstrates how to authenticate with the Focalboard Personal Server API by first calling the login endpoint with credentials to obtain a bearer token. This token is then used for subsequent API requests. ```bash curl -X POST \ -H "Accept: application/json" \ -H "X-Requested-With: XMLHttpRequest" \ -H "Content-Type: application/json" \ "http://localhost:8000/api/v2/login" \ -d '{ "type" : "normal", "username" : "testuser", "password" : "testpass" }' ``` ```bash curl -X GET \ -H "Accept: application/json" \ -H "Authorization: Bearer abcdefghijklmnopqrstuvwxyz1" \ -H "X-Requested-With: XMLHttpRequest" \ -H "Content-Type: application/json" \ "http://localhost:8000/api/v2/teams/0/boards" ``` -------------------------------- ### Import Archive using cURL Source: https://context7.com/mattermost-community/focalboard/llms.txt Imports a Focalboard archive into a specified team. Requires a Bearer token for authentication and the archive file is sent as form data. ```bash curl -X POST http://localhost:8000/api/v2/teams/team123/archive/import \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" \ -F "file=@board-backup.focalboard" ``` -------------------------------- ### Update Asset Version in Hugo Layout Source: https://github.com/mattermost-community/focalboard/blob/main/website/README.md This example demonstrates how to update the version query parameter in the `head.html` partial of a Hugo website. This is crucial for cache busting when assets like stylesheets change. ```html ``` -------------------------------- ### Generating Navigation Links in Go Templates Source: https://github.com/mattermost-community/focalboard/blob/main/website/site/layouts/partials/nav.html This snippet shows how to dynamically generate navigation links from a site menu configuration using Go's templating engine. It iterates over menu items and creates list entries with links. ```go-template {{ range .Site.Menus.postpend }}* [{{ .Name }}]({{ .URL }}) {{ end }}* [Get started](https://github.com/mattermost/focalboard) ``` -------------------------------- ### Redirect to Focalboard WebSocket Guide Source: https://github.com/mattermost-community/focalboard/blob/main/website/site/content/fwlink/websocket-connect-error.html This JavaScript snippet performs a client-side redirect to the official Focalboard documentation page for WebSocket errors. It uses the window.location.replace method to ensure the user is moved to the new URL. ```javascript window.location.replace("https://www.focalboard.com/guide/websocket-errors/"); ``` -------------------------------- ### Import Archive (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Imports a Focalboard archive file into a team. This endpoint is used to restore or transfer board data. Specific details on the request body and method are not provided in the snippet. ```bash # Import archive # POST /api/v2/teams/{teamId}/archive/import # Requires authentication and a file upload. ``` -------------------------------- ### Hugo Templating for Page Structure Source: https://github.com/mattermost-community/focalboard/blob/main/website/site/layouts/_default/taxonomy.html This snippet demonstrates Hugo's templating system for including partials like head and navigation, and for iterating over pages within a category. It's used to build the overall page structure and content listing. ```gohtml {{ partial "head.html" .}} {{ partial "nav.html" .}} Items in category `{{ .Title | lower }}` ---------------------------------------- {{ range .Data.Pages }} {{ .Render "li" }} {{ end}} {{ partial "footer.html" .}} ``` -------------------------------- ### Create Category (API) Source: https://context7.com/mattermost-community/focalboard/llms.txt Creates a new category for organizing boards in the sidebar. This POST request requires a category name and team ID, along with authentication. ```bash curl -X POST http://localhost:8000/api/v2/teams/team123/categories \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -H "X-Requested-With: XMLHttpRequest" \ -d '{ "name": "Personal Projects", "teamID": "team123" }' ```