{"id":27842364,"url":"https://github.com/johnkrzywanek/ghostbudget","last_synced_at":"2025-09-13T14:40:51.000Z","repository":{"id":288903799,"uuid":"969068654","full_name":"johnkrzywanek/ghostbudget","owner":"johnkrzywanek","description":"Sync Actual Budget accounts with Ghostfolio","archived":false,"fork":false,"pushed_at":"2025-07-29T13:38:49.000Z","size":295,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T15:59:38.759Z","etag":null,"topics":["budgeting","ghostfolio","personal-finance","portfolio"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnkrzywanek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-19T10:08:22.000Z","updated_at":"2025-07-29T13:38:53.000Z","dependencies_parsed_at":"2025-05-03T05:24:30.719Z","dependency_job_id":"fc3d7bb7-9a30-4466-b547-770028cde44b","html_url":"https://github.com/johnkrzywanek/ghostbudget","commit_stats":null,"previous_names":["johnkrzywanek/ghostbudget"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnkrzywanek/ghostbudget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkrzywanek%2Fghostbudget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkrzywanek%2Fghostbudget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkrzywanek%2Fghostbudget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkrzywanek%2Fghostbudget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnkrzywanek","download_url":"https://codeload.github.com/johnkrzywanek/ghostbudget/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkrzywanek%2Fghostbudget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272116033,"owners_count":24876263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["budgeting","ghostfolio","personal-finance","portfolio"],"created_at":"2025-05-03T05:19:02.833Z","updated_at":"2025-08-25T18:39:03.102Z","avatar_url":"https://github.com/johnkrzywanek.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GhostBudget\n\nGhostBudget is a Node.js application that synchronizes account balances between [Actual Budget](https://github.com/actualbudget/actual) and [Ghostfolio](https://github.com/ghostfolio/ghostfolio). It automatically fetches your account balances from Actual Budget and updates the corresponding accounts in Ghostfolio. Big thanks to authors and contributors from both projects! \n\n## Features\n\n- Automatic authentication with both Actual Budget and Ghostfolio\n- Configurable account mapping between the two systems\n- Automatic balance conversion from Actual Budget's format to Ghostfolio's format\n- Detailed logging for monitoring and troubleshooting\n- Error handling with helpful messages\n\n## Prerequisites\n\n- Node.js (v14 or higher recommended)\n- An Actual Budget server instance\n- A Ghostfolio instance\n- Access tokens/credentials for both services\n\nThe script will:\n1. Fetch account balances from Actual Budget\n2. Authenticate with Ghostfolio\n3. Get the current account list from Ghostfolio\n4. Map accounts between the two systems\n5. Update balances in Ghostfolio\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/johnkrzywanek/ghostbudget.git\ncd ghostbudget\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Create configuration files:\n```bash\ncp .env.example .env\ncp config.json.example config.json\n```\n\n4. Edit the `.env` file with your credentials and settings\n5. Edit the `config.json` file with your account mappings\n\n## Configuration\n\n### Environment Variables (.env)\n\n- `ACTUAL_BUDGET_URL`: URL of your Actual Budget server\n- `ACTUAL_BUDGET_PASS`: Your Actual Budget server password\n- `ACTUAL_BUDGET_SYNC_ID`: Your budget's sync ID\n- `ACTUAL_BUDGET_DATA_DIR`: Directory for Actual Budget data\n- `GHOSTFOLIO_URL`: URL of your Ghostfolio instance\n- `GHOSTFOLIO_TOKEN`: Your Ghostfolio access token\n\n### Account Mapping (config.json)\n\nThe `config.json` file maps accounts between Actual Budget and Ghostfolio. Example structure:\n\n```json\n{\n  \"accounts\": [\n    {\n      \"ghostfolioName\": \"Exact name of account in Ghostfolio\",\n      \"actualBudgetName\": \"Exact name of account in Actual Budget\"\n    }\n  ]\n}\n```\n\n**Note**: Account names must match exactly with the names in both systems.\n\n## Usage\n\n### Running the Sync\n\nYou can run the synchronization with different log levels:\n\n```bash\n# Normal operation (info level logs)\nnpm run sync\n\n# With debug information\nLOG_LEVEL=debug npm run sync\n\n# Only show errors\nLOG_LEVEL=error npm run sync\n```\n\n### Log Levels\n\n- `error`: Only logs errors\n- `warn`: Logs errors and warnings\n- `info`: Normal operational messages (default)\n- `debug`: Detailed debugging information\n\n### Log Files\n\nLogs are written to:\n- `logs/combined.log`: Contains all logs\n- `logs/error.log`: Contains only error logs\n- Console: Shows colored output for development\n\n## Automated Execution\n\n### Using Cron\n\nAdd this to your crontab to run it automatically:\n\n```bash\n# Run every hour\n0 * * * * cd /path/to/ghostbudget \u0026\u0026 LOG_LEVEL=info /usr/local/bin/npm run sync\n```\n\n### Using Systemd\n\nCreate a service file (`/etc/systemd/system/ghostbudget-sync.service`):\n\n```ini\n[Unit]\nDescription=Sync Actual Budget with Ghostfolio\nAfter=network.target\n\n[Service]\nType=oneshot\nWorkingDirectory=/path/to/ghostbudget\nEnvironment=LOG_LEVEL=info\nExecStart=/usr/local/bin/npm run sync\nUser=youruser\n\n[Install]\nWantedBy=multi-user.target\n```\n\nCreate a timer file (`/etc/systemd/system/ghostbudget-sync.timer`):\n\n```ini\n[Unit]\nDescription=Run Ghostbudget sync every hour\n\n[Timer]\nOnBootSec=5min\nOnUnitActiveSec=1h\nUnit=ghostbudget-sync.service\n\n[Install]\nWantedBy=timers.target\n```\n\nEnable and start the timer:\n```bash\nsudo systemctl enable ghostbudget-sync.timer\nsudo systemctl start ghostbudget-sync.timer\n```\n\n\n### Balance Conversion\n\nThe application automatically handles balance conversion between the two systems:\n- Actual Budget stores balances as integers (e.g., 100012 for $1,000.12)\n- GhostBudget converts these to decimal format before sending to Ghostfolio (e.g., 1000.12)\n\n## Error Handling\n\nThe application includes comprehensive error handling:\n- Validates required environment variables\n- Verifies account mappings exist in both systems\n- Provides detailed error messages for troubleshooting\n- Logs all operations for debugging\n\n## Development\n\n\n### Adding New Features\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Submit a pull request\n\n## Troubleshooting\n\nCommon issues and solutions:\n\n1. **Connection Issues**\n   - Verify your Actual Budget and Ghostfolio servers are running\n   - Check URLs in `.env` file\n   - Verify network connectivity\n\n2. **Authentication Errors**\n   - Verify your access tokens/credentials\n   - Check if tokens have expired\n   - Ensure proper permissions are set\n\n3. **Account Mapping Issues**\n   - Verify account names match exactly\n   - Check for typos in config.json\n   - Ensure accounts exist in both systems\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Support\n\nIf you encounter any issues or need support, please create an issue in the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnkrzywanek%2Fghostbudget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnkrzywanek%2Fghostbudget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnkrzywanek%2Fghostbudget/lists"}