Project Structure
How files and folders are organized in an Anfra project
Running anfra init (or create-anfra-project) scaffolds a project with
the following layout:
my-project/
├── datasets/ # Global datasets
├── models/ # Global data models
├── dashboards/ # Dashboard pages
│ └── revenue.page.aml
├── settings/ # Workspace config
│ └── connections.aml
└── .anfra/ # Platform config
└── config.json # Project root anchormodels/
Each .aml file describes one data model —
the mapping between a table (or SQL query) and how Anfra should interpret
its columns and relationships.
datasets/
Each .aml file describes one dataset — one or
more data models joined together, with metrics
and dimensions defined on top.
dashboards/
Dashboard pages built on top of your datasets.
settings/connections.aml
Your warehouse connection details (Postgres, BigQuery, Snowflake, Redshift, or a bundled local DuckDB for sample data).
.anfra/config.json
Marks the project root. Required when Anfra is installed inside an existing folder or monorepo, so it knows where the project boundary is.
Keep it flat for now
Larger projects often nest models/ and datasets/ by business domain
(e.g. marketing/models/). Anfra doesn't require a specific layout beyond
file extensions — this is just the default starting point.