vandor.

Guides

Quick reference and practical how-to guides for common Vandor workflows

Quick Reference

This page covers the most common workflows you will use day-to-day with Vandor. Each section gives you the commands at a glance, then links to a detailed guide if you want to go deeper.


Creating a Project

Every project starts with vandor new. This scaffolds a clean, minimal Go project with domain structure, logger, config, and nothing else.

# Create a new project
vandor new --module github.com/acme/myapp --tidy auto

# With interactive mode if you prefer prompts
vandor new -it

The project comes with your domain layer ready to go. No HTTP server, no database, no queue -- just your business logic foundation.

Vandor is non-interactive by default. Pass your options as flags directly. Use the -it flag when you want the guided, interactive experience.


Adding a Context

Contexts represent business capabilities -- not database tables. Think "identity", "catalog", or "billing" rather than "user" or "product".

# Add one or more contexts
vandor add context catalog identity order

# Add use cases to a context
vandor add usecase catalog create_product list_products

# Add a domain service
vandor add service identity auth_service

Installing Packages

Infrastructure arrives through VPKG. Install only what you need, when you need it.

# Search for available packages
vandor vpkg search http

# Get details about a specific package
vandor vpkg info @official/http-humachi

# Install a package
vandor vpkg add @official/http-humachi

# Install multiple packages
vandor vpkg add @official/entgo @official/atlas

Running Your Application

Vandor provides built-in commands for development and production. No external task runner needed.

# Development mode with hot reload
vandor dev:app

# Production mode
vandor run:app

# Build the Go binary directly
go build -o bin/app ./cmd/app

Health Check

When something feels off, the doctor command diagnoses issues with your installed packages and project structure.

# Check for problems
vandor vpkg doctor

# Automatically fix what can be fixed
vandor vpkg doctor --fix

Syncing Generated Code

Vandor uses your filesystem as the source of truth. When you add or remove contexts, use cases, or services, sync regenerates the wiring code (*_gen.go files).

# Sync everything
vandor sync all

# Check what would change without applying
vandor sync --check

Detailed Guides

By Topic

Domain Design

Development

Infrastructure

Best Practices

  1. Start with contexts -- Design your business capabilities before writing code.
  2. Install infrastructure late -- Add packages only when your domain actually needs them.
  3. Sync after structural changes -- Run vandor sync all whenever you add or remove components.
  4. Test your core first -- Your domain layer is testable without any infrastructure. Use that to your advantage.
  5. Use the doctor -- Run vandor vpkg doctor when things go wrong before debugging manually.