Course overview/Frame the work2 of 3

Set up a local analytics project

Back to course

Frame the work - Step 2 of 15

Set up a local analytics project

Install Git and Bruin, initialize the project folder, and configure local DuckDB.

Keep the course work isolated

Analytics engineers make changes in a development environment before touching shared data. For this course, your development environment is a local Git repository with a local DuckDB database. Nothing needs access to a production warehouse.

Bruin is the implementation tool in the exercises. The same project boundary exists in other tools: code and configuration live in version control, while credentials and environment-specific values stay outside model files.

Install and initialize Git

For this course, you only need Git installed and initialized inside the project folder. You do not need a GitHub account, a remote repository, a branch, or a commit to get started.

Install Git if git --version does not print a version. After you create analytics-engineering-course/ and move into it, run git init. That is all the Git setup required at this point. The later Git lesson explains commits, pull requests, and publishing the finished project to GitHub.

Ask your coding agent about Git

AI Prompt

Check whether Git is installed. When the analytics-engineering-course/ project folder exists, run git init inside that folder.

Explain each command before running it. Do not run any other Git commands.

Install and verify the CLI

Install Bruin on macOS, Linux, or Windows through Git Bash or WSL:

curl -LsSf https://getbruin.com/install/cli | sh

Then verify both tools used in the course:

bruin version
git --version

Both commands should print a version. If bruin is not found, add ~/.local/bin to your PATH and open a new terminal.

Create the project

Run these commands from the directory where you keep development projects:

mkdir analytics-engineering-course
cd analytics-engineering-course
git init
bruin init empty commerce

git init turns the new folder into a repository. bruin init empty commerce then creates the pipeline inside that repository, so Git can track the Bruin files alongside the rest of the project.

The empty template includes a commerce/assets/placeholder file. Inspect it, then remove only that generated file before continuing:

rm commerce/assets/placeholder

Keep local files out of Git

The empty template creates the pipeline folder, but it does not create .gitignore or .bruin.yml. Create .gitignore before you add the local connection:

.bruin.yml
*.duckdb
*.duckdb.wal
logs/

Bruin writes local run and query logs to logs/. Ignore those files and the local DuckDB database with the connection settings from the start.

After the next configuration step, your project should look like this:

analytics-engineering-course/
├─ .bruin.yml
├─ .gitignore
└─ commerce/
   ├─ assets/
   └─ pipeline.yml

The repository is the project. commerce/ is one pipeline inside it. Bruin calls each dataset or task an asset, and stores them in commerce/assets/.

Configure the local connection

Create .bruin.yml in the repository root and add this DuckDB connection:

environments:
  default:
    connections:
      duckdb:
        - name: "duckdb-default"
          path: "./commerce/commerce.duckdb"

This course connection has no password, but real projects often keep credentials in .bruin.yml. The .gitignore rule keeps that boundary intact.

Update commerce/pipeline.yml:

name: commerce
schedule: daily
start_date: "2026-01-01"
default_connections:
  duckdb: duckdb-default

The schedule will matter when the reporting table starts updating only selected dates. The default connection keeps individual DuckDB assets from repeating the same connection name.

Validate the local project

Run this command from the repository root, beside .bruin.yml:

bruin validate commerce/pipeline.yml

The bruin connections test command is not supported for this DuckDB connection type. Validation confirms that Bruin can read the project and its connection settings. A later pipeline run will confirm that DuckDB can create and query the local database file.

Ask your coding agent

The agent can perform the same setup while you review each change:

AI Prompt

Set up the analytics engineering course project in my current workspace.

  1. Verify bruin version and git --version. If Git is missing, show me the official install option for my operating system and wait for me to install it.
  2. Create analytics-engineering-course/ as a Git repository and initialize an empty Bruin project named commerce.
  3. Configure the local DuckDB connection and commerce/pipeline.yml exactly as described in this lesson.
  4. Run bruin validate commerce/pipeline.yml.

Explain git init before running it. Work only inside analytics-engineering-course/. Do not overwrite an existing file without showing me the current content and asking first. At the end, show the project tree and validation result. Do not run any other Git commands.

Checkpoint

Before continuing, confirm:

  • bruin version succeeds.
  • You ran git init inside analytics-engineering-course/.
  • bruin validate commerce/pipeline.yml succeeds.
  • commerce/pipeline.yml validates as YAML in your editor.

Explore example project

This explorer shows the completed SQL project from the modeling lessons. For now, compare the root files and folder names. Return here as you add each file, or ask your coding agent to compare your project with this reference.

analytics-engineering-course/
.bruin.yml
.gitignore
README.md
commerce
pipeline.yml
assets
analytics
customer_daily_revenue.sql
dim_customers.sql
fct_orders.sql
raw
customers.csv
orders.csv
raw_customers.asset.yml
raw_orders.asset.yml
staging
stg_customers.sql
stg_orders.sql
.bruin.yml
environments:
  default:
    connections:
      duckdb:
        - name: "duckdb-default"
          path: "./commerce/commerce.duckdb"

Resources

Sign up to our newsletter

Practical updates on open-source data pipelines, AI analysts, governance, and what we are shipping at Bruin.

The signup form is hosted by Brevo. Accept cookies to load it.