Setup Guide
Complete deployment of Konsolidat: ClickHouse, Airbyte, dbt, Frappe/Konsol, and Excel VBA.
Prerequisites
| Component | Version | Purpose |
|---|---|---|
| Docker Desktop | 24+ | ClickHouse container |
| Python | 3.10+ | dbt Core, Frappe Bench |
| Node.js | 18+ | Frappe assets |
| Excel | 2016+ | VBA reporting |
| D365 F&O | Any | Source ERP (optional for demo) |
1. Clone the Repository
git clone https://github.com/your-org/konsolidat.git
cd konsolidat
cp .env.example .env
Edit .env to set your ClickHouse password:
CLICKHOUSE_PASSWORD=your_secure_password
2. Start ClickHouse
Tip:
./deploy.shis the primary one-click entrypoint — it provisions ClickHouse and the rest of the stack in one step. The manual steps below are useful when you want to bring up services individually.
docker compose up -d
This starts a single ClickHouse container with:
- HTTP API on port 8123
- Native protocol on port 9000
- PostgreSQL wire protocol on port 15432
- Init SQL creates databases:
epm_bronze,epm_staging,epm_silver,epm_gold
Verify:
curl "http://localhost:8123/?query=SHOW+DATABASES"
3. Set Up Airbyte (D365 Extraction)
Skip this section if using seed data only (demo mode).
3.1 Install Airbyte
curl -fsSL https://get.airbyte.com | bash # Installs abctl
abctl local install
Airbyte UI will be available at http://localhost:8000.
3.2 Register a D365 App in Azure AD
- Go to Azure Portal → App Registrations
- New registration → name:
Konsolidat Airbyte - Under API permissions → Add:
Dynamics 365 Finance and Operations → Ax.FullAccess - Under Certificates & secrets → New client secret → copy the value
- Note:
Tenant ID,Client ID,Client Secret,D365 Environment URL
3.3 Configure Airbyte Connection
Source: Dynamics 365 Finance & Operations (OData)
- Tenant ID, Client ID, Client Secret, Environment URL from step 3.2
- Enable
cross_company=trueon all streams
Destination: ClickHouse
- Host:
host.docker.internal(Docker-to-host), Port:8123 - Database:
epm_bronze, User:default, Password: from.env
Streams (15 entities):
| OData Entity | Bronze Table |
|---|---|
GeneralJournalAccountEntries | bronze_general_journal_account_entries |
GeneralJournalEntries | bronze_general_journal_entries |
MainAccounts | bronze_main_accounts |
MainAccountCategories | bronze_main_account_categories |
LegalEntities | bronze_legal_entities |
FiscalCalendars | bronze_fiscal_calendars |
FiscalCalendarYears | bronze_fiscal_calendar_years |
FinancialDimensions | bronze_financial_dimensions |
FinancialDimensionValues | bronze_financial_dimension_values |
ExchangeRateCurrencyPairs | bronze_exchange_rate_currency_pairs |
ExchangeRateTypes | bronze_exchange_rate_types |
BudgetRegisterEntries | bronze_budget_register_entries |
BudgetTransactionLines | bronze_budget_transaction_lines |
ConsolidationAccountGroups | bronze_consolidation_account_groups |
LedgerTrialBalanceFiscalYearSnapshotDataEntity | bronze_trial_balance_snapshot |
3.4 Run Initial Sync
Trigger a full sync from the Airbyte UI or CLI. This populates epm_bronze tables.
4. Install and Run dbt
cd dbt_project
pip install dbt-core dbt-clickhouse
Create ~/.dbt/profiles.yml (if not present):
open_epm:
target: dev
outputs:
dev:
type: clickhouse
host: localhost
port: 8123
user: default
password: "your_password"
schema: epm
secure: false
Build:
dbt deps # Install dbt packages
dbt seed # Load 13 CSV seeds into epm_gold schema
dbt build # Build all models + run 150+ tests
Seed Files (13)
| Seed | Purpose |
|---|---|
allocation_rules.csv | Multi-step allocation rules |
allocation_drivers_headcount.csv | Headcount driver values |
allocation_drivers_sqm.csv | Square meter driver values |
allocation_drivers_revenue.csv | Revenue driver values |
budget_annual_input.csv | Annual budget line items |
spread_profiles.csv | Monthly spread weights (EVEN, SEASONAL_RETAIL) |
consolidation_groups.csv | Entity → group mapping with ownership % |
consolidation_adjustments.csv | Top-side journal entries |
ic_elimination_rules.csv | Intercompany elimination rules |
scenario_definitions.csv | Scenario metadata (actuals, budget, forecast) |
entity_fiscal_calendars.csv | Entity → fiscal calendar mapping |
dimension_mappings.csv | Canonical dimension value harmonization (macro-consumed) |
test_consolidation_hierarchy.csv | Fixture for the consolidation hierarchy tests |