accountsplus documentation
Choose a version
Version 1.x
Technical overview #
This document describes the architecture and internal design of AccountsPlus.
Architecture layers #
AccountsPlus follows a layered architecture:
┌─────────────────────────────────────────────┐
│ UI Layer │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ PySide6 GUI │ │ CLI │ │
│ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────┤
│ Application Layer │
│ ┌─────────────────────────────────────┐ │
│ │ AccountsService │ │
│ │ (facade for all operations) │ │
│ └─────────────────────────────────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Sync │ │ Sync │ │ Sync │ │
│ │ Service │ │ Client │ │ Queue │ │
│ └──────────┘ └──────────┘ └──────────┘ │
├─────────────────────────────────────────────┤
│ Storage Layer │
│ ┌─────────────────────────────────────┐ │
│ │ SQLite Repository │ │
│ │ (CRUD + sync tracking) │ │
│ └─────────────────────────────────────┘ │
│ ┌─────────────────────────────────────┐ │
│ │ PDF Generator │ │
│ │ (reportlab) │ │
│ └─────────────────────────────────────┘ │
└─────────────────────────────────────────────┘
Data model #
Core entities #
| Entity | Description | Key Fields |
|---|---|---|
| Business | Your business profile | name, abn, currency |
| Customer | Client records | name, email, address |
| Supplier | Vendor records | name, email, address |
| Product | Goods/services offered | name, price, unit |
| Invoice | Sales documents | number, date, total |
| InvoiceLineItem | Invoice details | description, quantity, price |
| Expense | Business spending | date, amount, category |
Sync entities #
| Entity | Description |
|---|---|
| SyncMetadata | Database version, instance ID |
| SyncChangelog | Change history per record |
| SyncTombstones | Deleted record markers |
| PendingPull | Staged remote changes |
Relationships #
Business ─┬── Customer ──── Invoice ──── InvoiceLineItem
├── Supplier
├── Product
└── Expense
Storage #
Desktop (SQLite) #
Default locations:
- Linux:
~/.local/share/accountsplus/accountsplus.db - macOS:
~/Library/Application Support/accountsplus/accountsplus.db - Windows:
%APPDATA%\accountsplus\accountsplus.db
Database schema #
Version 1: Core tables (10 tables) Version 2: Search indexes (17 indexes) Version 3: UUID columns + sync tables (17 tables total)
Sync system #
How sync works #
- Each change is recorded in
sync_changelog - Deleted records create entries in
sync_tombstones - On push, client sends changes since last sync
- Server merges changes using git-like branching
- Conflicts are flagged when the same record changes on both sides
Conflict resolution #
- Git-like branching: Conflicts detected at field level
- Last-write-wins: For non-conflicting changes
- Manual resolution: For true conflicts
Server replication #
The sync server maintains a full replica of your data. This enables:
- Multi-device access
- Data recovery if a device is lost
- Historical version tracking
PDF generation #
AccountsPlus uses reportlab to generate PDF invoices:
- Professional layout with your business details
- Automatic GST/tax calculations
- Customizable templates
- Line item summaries
Security considerations #
- Data stored locally on your device
- Sync uses TLS encryption in transit
- Passwords hashed with bcrypt
- Field-level encryption for sensitive data
For detailed security information, see the security documentation.