Getting started
Learn how to build Privatefolio from source.
Prerequisites
Section titled “Prerequisites”To build & run the project, you need to have the following build dependencies installed:
node -v# v22.15.0npm -v# 11.3.0yarn -v# 1.22.22bun -v# 1.2.12Node.js
Section titled “Node.js”It’s recommended to install Node.js through NVM (Node Version Manager), and to install Yarn through NPM.
On Windows, get it from coreybutler/nvm-windows. On Linux, get it from nvm-sh/nvm.
Afterwards, upgrade NPM and install Yarn:
npm install -g npmnpm install -g yarnWindows
Section titled “Windows”Install the latest version of Python and add it to your PATH.
python --version# 3.13.3Afterwards, install Bun:
powershell -c "irm bun.sh/install.ps1|iex"Ubuntu
Section titled “Ubuntu”Ensure these development dependencies are installed:
sudo apt update && sudo apt -y upgradesudo apt install libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 -yAfterwards, install Bun:
curl -fsSL https://bun.sh/install | bashInstall
Section titled “Install”Before we can build the project from source, we also need to install the project dependencies:
yarnyarn buildOn Ubuntu, you need to install the set the permissions for the chrome-sandbox file:
sudo chown root:root packages/electron/node_modules/electron/dist/chrome-sandboxsudo chmod 4755 packages/electron/node_modules/electron/dist/chrome-sandboxDevelopment
Section titled “Development”Run the project in development mode, to see your code changes in real-time.
yarn devBuild native apps
Section titled “Build native apps”To build the native apps, run any of the following commands:
# desktop appsyarn bundle:winyarn bundle:linuxyarn bundle:macyarn bundle:mac-x64# mobile appsyarn bundle:androidyarn bundle:iosNow you can run the artifacts from these paths:
- Windows
./packages/electron/out/Privatefolio\ Setup\ 2.0.0-beta.44.exe - Linux
sudo dpkg -i ./packages/electron/out/privatefolio-electron_2.0.0-beta.44_amd64.deb - MacOS Arm64
./packages/electron/out/Privatefolio-2.0.0-beta.44-arm64.dmg - MacOS Intel
./packages/electron/out/Privatefolio-2.0.0-beta.44.dmg - iOS
./packages/expo/out/ios/Privatefolio.ipa - Android
./packages/expo/out/android/app-release.apk
Build docker image
Section titled “Build docker image”yarn docker:buildTesting
Section titled “Testing”After making changes to the code, you can run the tests to see if anything broke.
yarn testyarn test:bun # special test that has to run separately to ensure sqlite3 is compatible with bun:sqliteyarn test:ci # running all tests in CI modeTo run a single test file:
cd packages/backendyarn test <test-file>yarn test test/tags/tags-api.test.tsTips & Know-how
Section titled “Tips & Know-how”Add a package as a dependency to another
Section titled “Add a package as a dependency to another”Note: you need to specify a version due to this bug.
yarn workspace privatefolio-frontend remove privatefolio-backendyarn workspaces infoAdd a dependency to a package
Section titled “Add a dependency to a package”yarn workspace privatefolio-frontend add reactyarn workspace privatefolio-frontend remove reactNPM utils
Section titled “NPM utils”npm list ms # List all packages that depend on msYarn utils
Section titled “Yarn utils”yarn list ms # List all packages that depend on msyarn upgrade-interactive # Upgrade all packages to the latest versionyarn cache clean # Clean the cacheTroubleshooting
Section titled “Troubleshooting”Electron
Section titled “Electron”Data is persisted in the following directories:
-
Windows:
- Updater logs:
C:\Users\daniel\AppData\Local\privatefolio-electron-updater - Electron logs:
C:\Users\daniel\AppData\Roaming\Privatefolio\logs - User data:
C:\Users\daniel\AppData\Roaming\Privatefolio\data - App config:
C:\Users\daniel\AppData\Roaming\Privatefolio\config.json - App code:
C:\Users\daniel\AppData\Local\Programs\Privatefolio
- Updater logs:
-
Linux:
- Electron logs:
~/.config/Privatefolio/logs - User data:
~/.config/Privatefolio/data - App config:
~/.config/Privatefolio/config.json
- Electron logs:
You can also package the app without building the binaries:
cd packages/electronyarn packageAnd run the executable ./out/Privatefolio-win32-x64/Privatefolio.exe.