- Go 64.8%
- Vue 28.9%
- Shell 2.9%
- JavaScript 1.4%
- TypeScript 0.8%
- Other 1.2%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| charts/aibacus | ||
| cmd/server | ||
| internal/app | ||
| scripts | ||
| web | ||
| .dockerignore | ||
| .gitignore | ||
| Architecture.md | ||
| compose.yaml | ||
| Design.md | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| Project.md | ||
| README.md | ||
Aibacus
A self-hosted, early-stage household finance application: Go API, Vue 3 frontend, PostgreSQL, SimpleFIN Bridge imports, and an OpenAI-compatible bring-your-own inference endpoint. The interface takes visual inspiration from Open WebUI; reference-firefly-iii/ is a separate shallow clone of Firefly III for reference, not a dependency. Firefly III has its own license; consult it before reusing its code.
Documentation: Project overview · Design guide · Technical architecture.
Run with Docker and PostgreSQL
-
Create
.envcontaining a strong, URL-safe password (letters and numbers avoid URL escaping issues):POSTGRES_PASSWORD=replace_with_a_long_random_password # Optional: load illustrative demo data into an empty database DEMO_DATA=false -
docker compose up --build -d -
Open http://localhost:8080. Database data is persisted in the
postgres_dataDocker volume. Back it up before changing or deleting volumes.
PostgreSQL schema files in internal/app/migrations/ are embedded and applied at startup. The initial schema is idempotent; subsequent numbered migrations are recorded in schema_migrations and applied transactionally. SQLite is available for local development with DATABASE_PATH; Docker Compose uses PostgreSQL via DATABASE_URL.
Forgejo container build
.forgejo/workflows/container-build.yml builds and publishes the image on pushes to main and manual dispatches of main. Each job starts an ephemeral rootless BuildKit service; buildctl builds the production Dockerfile, whose final stage smoke-checks the server and bundled frontend before export. BuildKit pushes git.home-net.work/sjenkins/aibacus:sha-<full-commit-sha> and also :latest only when the Forgejo job token verifies that the commit is the current main tip. The daemon and its build cache disappear with the job. Rebuilding a commit can produce a different image if upstream base images or dependencies change; deploy a verified image digest for reproducibility.
Configure repository Actions secrets REGISTRY_USERNAME and REGISTRY_TOKEN. For the personal sjenkins package namespace, use the sjenkins account and a personal access token with write:package permission. The workflow writes registry credentials to a temporary Docker config for BuildKit's registry auth provider and removes it on exit. Registry access and, for latest, authenticated read access to the main-branch API must work from the runner. Trust the Forgejo server's TLS certificate in both BuildKit and Node; set NODE_EXTRA_CA_CERTS on the runner if necessary. After a successful build, configure Helm with image.repository=git.home-net.work/sjenkins/aibacus and the desired image tag. The project does not deploy the image automatically.
The workflow requires a trusted Forgejo runner with the docker and trusted labels, Node.js 20+, and network access to the per-job buildkitd service, Forgejo, GitHub, Docker registries, and Go/npm package registries. Docker remains the runner's container executor, but the workflow no longer uses the Docker CLI or daemon to build or push. The BuildKit service runs rootless; its actual isolation still depends on the runner's container security configuration. Only trusted code should run on this runner. The workflow intentionally excludes pull requests and non-main branches. See Forgejo's Docker access guidance and BuildKit's rootless Kubernetes guidance.
Run on Kubernetes
A Helm chart is available at charts/aibacus. It deploys the application against an existing PostgreSQL database and requires a pre-created Secret containing the database URL. Publish your image and configure access before installing. The app has no authentication; the default ClusterIP is reachable inside the cluster, and any ingress needs appropriate authentication, TLS, and network restrictions. See the chart README for setup, backups, and security details.
API and Swagger
The existing versioned JSON endpoints are documented at http://localhost:8080/swagger; the OpenAPI 3.0 document is available at http://localhost:8080/openapi.json. Swagger UI is bundled locally in the production frontend build. For local Go development, run cd web && npm ci && npm run build first and use STATIC_DIR=web/dist so the Swagger assets are available. The API is experimental and does not yet implement complete REST CRUD for every resource; the OpenAPI document describes what is currently implemented. Mutating requests, including bodyless DELETEs and syncs, require Content-Type: application/json. The API and Swagger UI have no authentication; keep both on a trusted host.
Connect accounts
In Settings, create a SimpleFIN Bridge setup token, paste it, and connect; then click Sync. The application claims the token and fetches accounts and transactions read-only. Institution availability and history depend on SimpleFIN Bridge and the institution; American Express and BlueCurrent support has not been verified here. Only bridge.simplefin.org and beta-bridge.simplefin.org tokens are accepted. Imported transaction IDs are deduplicated per account, and existing categories are preserved when resyncing. SimpleFIN warnings appear after syncing. Sync is manual; pending/posted duplicates may require reconciliation. Under Settings → SimpleFIN Bridge, Import past activity requests an inclusive UTC date range (up to 730 days) in windows of at most 45 days, newest first, to respect Bridge's recommended range. Each window consumes a Bridge request; SimpleFIN recommends at most 24 requests per day, and older history is not guaranteed. Results report new posted transactions, completed windows, provider warnings, and any partial failure; completed windows are saved even if a later window fails. Retrying is safe for stable account and transaction IDs: existing transactions, their categories and current account balances are not overwritten by the historical import. Previously deleted SimpleFIN accounts and transactions may be reimported. Keep the page open during the import; if interrupted, some windows may already be saved. For newly imported accounts, Aibacus attempts to classify the type from recognized SimpleFIN extra type/subtype fields, then unambiguous account-name keywords. SimpleFIN does not standardize these fields, and name-based guesses can be wrong; review account types. Unrecognized or conflicting evidence defaults to other. Existing account types are never automatically reclassified, including accounts imported before this feature; edit them manually. Set mortgages and auto loans to their separate account types to see them individually on Overview and in the Accounts filter. The breakdown counts negative balances by type; positive loan balances are not treated as debt and should be checked against the source. Other negative balances are shown separately. Monthly income is the net signed sum of posted transactions in the Income category across all accounts (case-insensitive, ignoring surrounding spaces); uncategorized transactions do not count, and negative income adjustments reduce the total. Monthly expenses sum negative posted transactions across all account types, excluding those categorized Transfer (case-insensitive, ignoring surrounding spaces); negative income adjustments still count as expenses. Previous-month totals cover the previous complete UTC calendar month, and current-month totals cover the first day of the UTC month through now. Pending transactions are excluded; categories are applied retroactively to calculated totals when changed. The account card menu can edit or delete accounts. Deletion also deletes associated transactions; SimpleFIN accounts and transactions may reappear on the next sync. SimpleFIN controls imported balances and may overwrite edited names and institutions on sync, while edited account types are retained.
Encrypted backup and restore
Settings can create a downloadable encrypted archive of Aibacus application data, including settings and credentials, using a password you supply. Archives are limited to 512 MiB. Store that password securely: it cannot be recovered, and without it the backup is unusable. This is an application-data backup, not a PostgreSQL volume or cluster backup; retain your normal database/storage backups too.
Restore requires the backup file and its password, then replaces current application data transactionally. The UI asks for confirmation before submitting. PostgreSQL schema_migrations is not part of the archive; the running code's migrations remain authoritative. Test restores carefully and keep the app on a trusted host: it has no authentication, and backups contain sensitive information even though the archive is encrypted.
The versioned API provides POST /api/v1/backup with JSON {"password":"..."} to download the encrypted archive and POST /api/v1/backup/restore as multipart form fields password and file to restore it.
Activity search
The Activity tab searches descriptions, categories, vendors/people, account names, and notes. Combine it with one or more accounts, an exact category, inclusive UTC dates, signed amount bounds, inflow/outflow, and posted/pending status; sort by date, amount, description, category, or account. Expense amounts are negative. Filters and sorting run on the server before pagination; Load more fetches the next 100 matches. Text matching and ordering depend on the database's case-folding behavior.
Transaction rules
Use Rules to create, edit, enable, prioritize, and delete categorization rules. Conditions may include up to 20 description regex alternatives (Go RE2 syntax; use (?i) for case-insensitive matching), inclusive signed amount bounds, specific accounts, and account types. Any one regex can match; all account, account-type, and amount conditions apply to every alternative. Expense amounts are negative. All configured conditions must match; an empty account or type selection means all, and selecting both requires both to match. At least one condition is required. Lower priority numbers run first, with rule ID breaking ties; the first enabled matching rule that sets each field wins independently, so one rule can set a category while another sets a vendor/person.
Select a transaction description in Activity, account activity, or Overview to create a rule from it or choose an existing rule to edit. A new rule is prefilled with an exact case-insensitive, escaped description match and the selected account; review its category and conditions before saving. Add more alternatives in the rule editor; use a different rule if each description needs different account or amount conditions. When editing an existing rule, selected-transaction details can be inserted explicitly; transactions are not automatically linked to a particular rule. Actions can set a transaction category (for example Food, Gas, Credit card payment, or Loan payment), an optional vendor/person, or both. Rules run when manual, SimpleFIN sync, or historical transactions are first inserted. Re-syncing never overwrites existing assignments. To apply rules to older transactions, preview matches and explicitly apply; this fills only missing vendor/person assignments and categories labeled Uncategorized, independently. Preview and apply can differ if data changes between them. Deleting rules never reverts prior assignments. Selected account IDs remain in a rule even if an account is deleted, so the rule does not silently expand to every account; a recreated account has a new ID and must be selected again.
Manage vendors and people under Accounts (distinct from Financial accounts); select a transaction to assign or clear its optional vendor/person manually. A transfer need not have one. Deleting a vendor/person clears its transaction assignments but is blocked while rules refer to it; update or delete those rules first. Clearing an assignment leaves it eligible for future rule application. Vendor names are unique with case-sensitive comparison. Transactions categorized Transfer are excluded from expense totals, spending breakdowns, and budget spending; they remain visible in Activity and raw outflow filters. No transfer linking or automatic detection occurs, and categories such as Credit Card Payment or Loan Payment are not automatically treated as transfers. Review classifications and financial reports.
Custom reports
Use Reports to compare Income-category transactions with gross purchase outflows. Choose inclusive UTC dates, financial accounts, income categories, optional purchase-category inclusions and exclusions, and whether to include pending transactions. Transfer is always excluded. By default, Credit Card Payment, Loan Payment, and Mortgage Payment are excluded; review or adjust the exclusion list. Category matching is case-insensitive and ignores surrounding whitespace. Blank account selections mean all financial accounts; deleted IDs in saved filters are retained and never silently expanded. Reports can be saved with fixed dates and filters and are included in encrypted backups; results are recalculated when run.
Results show totals, income minus purchases, monthly and purchase-category breakdowns, and paginated matching transactions. Each currency is reported separately with no exchange-rate conversion. Income is the signed sum of the selected income categories; purchases are negative transactions outside those categories and exclusions. Positive refunds are not netted against purchases. Uncategorized outflows may include transfers or payments and are flagged; classify transactions and review exclusions before relying on results. Amounts use floating-point arithmetic and are not suitable for accounting-grade reporting.
AI
Configure an OpenAI-compatible base URL ending in /v1, model name, and optional API key in Settings. The advisor sends only the prompt you type; it does not automatically send your financial records or take bookkeeping actions. An endpoint at localhost inside Docker means the container itself; use a reachable hostname such as a Compose service name. Model output is informational, not professional financial advice.
Development
go test ./...
# terminal 1: Go API with local SQLite
STATIC_DIR=web/dist go run ./cmd/server
# terminal 2: Vite development server and API proxy
cd web && npm ci && npm run dev
Use DEMO_DATA=true on the first run for sample accounts, transactions, assets and budgets. Demo data is clearly marked on accounts but is real stored data, not automatically removed on connecting a bank. Don't combine demo data with a real household.
Important limitations and security
This is a prototype, not production-ready financial software. It has no user authentication or authorization; Compose binds the UI to loopback only. Do not expose it to the internet or an untrusted network. SimpleFIN access URLs and AI API keys are stored unencrypted in the database, and the database contains sensitive financial information; protect and encrypt backups and storage. The UI's account and asset totals assume USD and do not convert currencies or prevent double-counting; avoid entering assets already represented by account balances. Values currently use floating-point arithmetic rather than exact decimal money, so do not rely on the results for accounting, taxes, or financial decisions. Manual transactions do not update account balances. No transfers, reconciliation, scheduled sync, complete transaction/budget editing and deletion workflows, and asset deletion, historical net worth, AI-driven categorization, or multi-user isolation are implemented yet.