docs/dev-tips.md
These tips and tricks apply to developing the standalone Personal Server of Focalboard. For most features, this is the easiest way to get started working against code that ships across editions.
For working with the Focalboard plugin, refer to the Focalboard Plugin Developer's Guide.
Check that you have recent versions of the basic dependencies installed:
On Windows:
On macOS, to build the Mac app:
xcode-select --installOn Linux, to build the Linux app:
sudo apt-get install libgtk-3-devsudo apt-get install libwebkit2gtk-4.0-devsudo apt-get install autoconf dh-autoreconfFork the Focalboard GitHub repo, and clone it locally.
Follow the steps in the main readme file. In summary, to build and run the server:
make prebuild
make
./bin/focalboard-server
Then open a browser to http://localhost:8000 to access it. The port is configured in config.json.
Once the server is running, you can rebuild just the webapp with make webapp (in a separate terminal window), then reload the browser.
Here's a recommended dev-test loop using VSCode:
make prebuild to npm install
webapp/package.jsoncd webapp && npm run watchdev
Go: Launch Server
Cmd+P and type debug <space> and pick the optionhttp://localhost:8000
config.jsonYou can now edit the webapp code and refresh the browser to see your changes.
You can use your favorite browser to debug the webapp code. With Chrome, open the dev tools with Cmd+Alt+I (Ctrl+Alt+I in Windows).
npm run watchdev builds the dev package, which includes source maps from js to typescriptCmd+P to jump to a source fileAs a starting point, add a breakpoint to the render() function in BoardPage.tsx, then refresh the browser to walk through page rendering.
Debug the Go code in VSCode. This is set up automatically when you launch the server from there.
To start, add a breakpoint to handleGetBlocks() in server/api/api.go, then refresh the browser to see how data is retrieved.
We use i18n to localize the web app. Localized string generally use intl.formatMessage. When adding or modifying localized strings, run npm run i18n-extract in webapp to rebuild webapp/i18n/en.json.
Translated strings are stored in other json files under webapp/i18n, e.g. es.json for Spanish.
By default, data is stored in a sqlite database focalboard.db. You can view and edit this directly using sqlite3 focalboard.db from bash.
Before checking-in commits, run: make ci, which is simlar to the ci.yml workflow and includes:
make server-testcd webapp; npm run checkmake webapp-testcd webapp; npm run cypress:ciIf you run into any issues with the steps here, or have any general questions, please don't hesitate to reach out either on GitHub or our Mattermost community channel.
We welcome everyone, and appreciate any feedback.
glhf! :)