ποΈ Database Schema
The LibreFolio database is designed using SQLAlchemy with SQLModel. The schema is stored in a single SQLite file (app.db).
π‘ Tip: To explore the live database schema interactively (including all constraints and indexes), we recommend using a tool like DBeaver or DB Browser for SQLite connected to your local
backend/data/sqlite/app.dbfile.
π Logical Data Flow
This diagram illustrates how data flows from the User down to the financial records.
graph TD
User[User] -->|Owns| Broker[Broker Account]
User -->|Has| Settings[User Settings]
Broker -->|Contains| Tx[Transactions]
Tx -->|References| Asset[Global Asset]
Asset -->|Has| Prices[Price History]
subgraph "Global Data"
Asset
Prices
FX[FX Rates]
end
subgraph "User Data"
User
Settings
Broker
Tx
end
π Subsystems
The database is organized into four logical subsystems. Each has its own detailed page:
- π€ Users & Access β Authentication, user settings, and broker sharing (RBAC)
- π¦ Brokers & Transactions β The core financial data structure
- π Assets & Pricing β Global financial instruments and provider assignments
- π± FX Rates & Routes β Currency exchange rates and routing configuration
ποΈ Design Philosophy
- π Normalization: Assets are global; Transactions are broker-specific.
- β
Strict Constraints:
CHECKconstraints ensure logical consistency.- Foreign Keys are enforced (
PRAGMA foreign_keys=ON).
- π¦ JSON for Flexibility: Used for
classification_paramsandprovider_paramsto allow schema-less extension.