Configuration & Environment
βοΈ Configuration & Environment
Section titled ββοΈ Configuration & EnvironmentβKryptofolio is configured primarily via environment files (.env for development, .env.production for production). Because it is a local-first application, configuration controls file system locations, analytical parameters, and security policies.
π Complete Environment Variables Reference
Section titled βπ Complete Environment Variables ReferenceβBackend Variables (apps/backend or root .env)
Section titled βBackend Variables (apps/backend or root .env)β| Variable | Type | Default | Description |
|---|---|---|---|
PORT |
number |
3001 |
The HTTP port where the Hono backend server listens. |
KRYPTOFOLIO_DATA_DIR |
string |
Workspace Root | Base directory holding every database file. When set, relative paths anchor to this folder. |
LEDGER_DB_PATH |
string |
kryptofolio_ledger.db |
Path to the SQLite transactional ledger containing spot/futures transactions and audit logs. |
VAULT_DB_PATH |
string |
kryptofolio.db |
Path to the encrypted SQLite database storing AES-256-GCM API credentials. |
DUCKDB_PATH |
string |
fiscal.duckdb |
Path to the DuckDB OLAP database used for vectorized tax and risk calculations. |
DUCKDB_POOL_SIZE |
number |
4 |
Number of pooled read-side DuckDB connections over the single instance. |
PARQUET_DATA_PATH |
string |
data/historical/prices |
Directory path containing Hive-partitioned .parquet historical price time-series. |
MOCK_MODE |
boolean |
false |
When true, DuckDB and SQLite run :memory:, ignoring disk files for fast testing. |
KRYPTO_MASTER_KEY |
string |
undefined |
Optional 32-byte Base64 key for headless/Docker deployments where OS keyring is unavailable. |
Frontend Variables (apps/frontend/.env)
Section titled βFrontend Variables (apps/frontend/.env)β| Variable | Type | Default | Description |
|---|---|---|---|
VITE_API_URL |
string |
http://localhost:3001 |
Base URL used by the Hono RPC client (BffClient.ts). |
VITE_APP_LANG |
string |
en |
Initial interface language. Supported values: en, es. |
π Internationalization (i18n)
Section titled βπ Internationalization (i18n)βKryptofolio features a zero-dependency, environment-driven dictionary system located in apps/frontend/src/i18n/.
Setting the Active Language
Section titled βSetting the Active LanguageβChange VITE_APP_LANG in your .env file and restart the development server:
VITE_APP_LANG=es # Spanish# orVITE_APP_LANG=en # EnglishAdding a New Language (e.g., German de)
Section titled βAdding a New Language (e.g., German de)β- Create a new dictionary file
apps/frontend/src/i18n/dictionaries/de.ts. - Implement the
I18nDictionaryinterface by translating keys fromen.ts. - Register the new dictionary in
apps/frontend/src/core/infrastructure/i18n/EnvI18nAdapter.ts:import { en } from '@/i18n/dictionaries/en';import { es } from '@/i18n/dictionaries/es';import { de } from '@/i18n/dictionaries/de';const dictionaries: Record<string, I18nDictionary> = { en, es, de }; - Set
VITE_APP_LANG=deinapps/frontend/.env.
π Storage Hierarchy
Section titled βπ Storage HierarchyβWhen running with default settings, the database files are structured as follows:
kryptofolio/βββ kryptofolio_ledger.db # Primary SQLite OLTP ledger (Transactions, Accounts)βββ kryptofolio_ledger.db-wal # SQLite Write-Ahead Logβββ kryptofolio.db # Encrypted API credentials vaultβββ fiscal.duckdb # DuckDB OLAP database (Materialized FIFO chain)βββ fiscal.duckdb.wal # DuckDB WAL fileβββ data/ βββ historical/ βββ prices/ # Hive-partitioned Parquet time-series βββ year=2024/ βββ year=2025/ βββ year=2026/ βββ month=01/ βββ btc_eur.parquet