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 -itThe 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_serviceInstalling 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/atlasRunning 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/appHealth 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 --fixSyncing 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 --checkDetailed Guides
By Topic
Domain Design
Creating Domains
Design and implement business capability domains
Domain Boundaries
Advanced strategies for defining domain boundaries
Cross-Domain Dependencies
Managing dependencies between domains safely
Development
Adding HTTP Endpoints
Create RESTful API endpoints with the HTTP package
Database Setup
Configure and manage databases with Ent.go and Atlas
Testing Strategies
Test your core domain without transport or infrastructure
Infrastructure
Background Jobs
Set up async job processing with Asynq
Deployment
Deploy Vandor applications to production
Best Practices
- Start with contexts -- Design your business capabilities before writing code.
- Install infrastructure late -- Add packages only when your domain actually needs them.
- Sync after structural changes -- Run
vandor sync allwhenever you add or remove components. - Test your core first -- Your domain layer is testable without any infrastructure. Use that to your advantage.
- Use the doctor -- Run
vandor vpkg doctorwhen things go wrong before debugging manually.