Get up and running with bit-dbt in 5 minutes!
# Check Python version (need 3.9+)
python --version
# Check AWS CLI
aws --version
# Check git
git --version# Navigate to project
cd /Users/vidagharavian/PycharmProjects/bit-dbt
# Run automated setup
./scripts/setup.sh
# This will:
# ✓ Create virtual environment
# ✓ Install all dependencies
# ✓ Create .env file
# ✓ Set up directories# Edit environment file
nano .env
# Required variables (minimum):
AWS_REGION=us-east-1
DBT_ATHENA_S3_STAGING_DIR=s3://bandsintown-dbt-analytics/dev/
DBT_ATHENA_DATABASE=bandsintown_analytics_dev
DBT_ATHENA_WORKGROUP=bandsintown-dbt-dev
RAW_DATA_DATABASE=bandsintown_rawOption A: Use AWS Profile
export AWS_PROFILE=your-profile-nameOption B: Use AWS Credentials
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret# Activate virtual environment
source .venv/bin/activate
# Test dbt connection to Athena
make debug
# Expected output:
# Connection test: [OK connection ok]If connection fails:
- Verify AWS credentials:
aws sts get-caller-identity - Check S3 access:
aws s3 ls s3://bandsintown-dbt-analytics/ - Verify Athena workgroup:
aws athena get-work-group --work-group bandsintown-dbt-dev
# Run staging model
make run-model MODEL=stg_events
# Expected output:
# Completed successfully
# Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1# Run dbt tests
make run-test
# Expected output:
# Tests passing confirmationYou now have:
- ✅ dbt project configured
- ✅ Connected to AWS Athena
- ✅ Staging model created:
stg_events - ✅ Tests passing
# Development
make debug # Test connection
make compile # Compile models
make run # Run all models
make run-test # Run all tests
make docs # Generate & view docs
# Specific operations
make run-model MODEL=stg_events # Run specific model
make run-tag TAG=staging # Run models by tag
make freshness # Check source freshness
make lint # Lint SQL files
# Deployment
make deploy-dev # Deploy to dev
make deploy-staging # Deploy to staging
make deploy-prod # Deploy to production-- Check your view was created
SHOW TABLES IN bandsintown_analytics_dev;
-- Query the staging model
SELECT * FROM bandsintown_analytics_dev.stg_events LIMIT 10;# Start query
aws athena start-query-execution \
--query-string "SELECT COUNT(*) FROM bandsintown_analytics_dev.stg_events" \
--query-execution-context Database=bandsintown_analytics_dev \
--result-configuration OutputLocation=s3://bandsintown-dbt-analytics/dev/# Generate and serve docs
make docs
# Opens browser at: http://localhost:8080
# Shows:
# - Data lineage diagram
# - Model documentation
# - Column descriptions
# - Test results# Check AWS credentials
aws sts get-caller-identity
# Check environment variables
env | grep DBT
env | grep AWS# Verify S3 bucket access
aws s3 ls s3://bandsintown-dbt-analytics/
# Check IAM permissions
aws iam get-user# List available workgroups
aws athena list-work-groups
# Get workgroup details
aws athena get-work-group --work-group bandsintown-dbt-dev# Clean and retry
make clean
make deps
make compile- Create new SQL file in
models/staging/ - Add schema definition in
.ymlfile - Run:
make run-model MODEL=your_model_name - Add tests in schema file
- Run:
make run-test
- Edit
dbt_project.ymlfor project settings - Edit
profiles.ymlfor connection settings - Add macros in
macros/directory - Add custom tests in
tests/directory
- Push code to GitHub
- Configure repository secrets (see GITHUB_SETUP.md)
- CI runs automatically on PRs
- Deploy workflow runs on merge to main
# Deploy to staging first
make deploy-staging
# After validation, deploy to prod
make deploy-prodDocumentation
- Full README:
README.md - Contributing guide:
CONTRIBUTING.md - GitHub setup:
GITHUB_SETUP.md - Project summary:
PROJECT_SUMMARY.md
Support
- Slack: #data-platform
- Email: data-platform@bandsintown.com
Resources
- dbt Docs: https://docs.getdbt.com/
- dbt-athena: https://github.com/dbt-athena/dbt-athena
- AWS Athena: https://docs.aws.amazon.com/athena/
Time to first model: ~5 minutes ⚡
Happy transforming! 🎸