pactown

Running Pactown Examples

SaaS Platform Example

  1. Navigate to the example folder:
    cd examples/saas-platform
    
  2. Clean any old sandboxes:
    rm -rf .pactown-sandboxes
    

// turbo

  1. Start the ecosystem:
    pactown up saas.pactown.yaml
    
  2. Access the services:
    • Web Dashboard: http://localhost:10002 (or check actual port in output)
    • API Docs: http://localhost:10001/docs
    • Gateway Health: http://localhost:10004/gateway/health
  3. Stop with Ctrl+C

Microservices Example (Polyglot)

  1. Navigate:
    cd examples/microservices
    

// turbo

  1. Start:
    pactown up saas.pactown.yaml
    

Generate Config from Folder

  1. Scan a folder to see detected services:
    pactown scan ./examples/saas-platform/services
    

// turbo

  1. Generate configuration:
    pactown generate ./examples/saas-platform/services -o generated.pactown.yaml
    
  2. Review and customize the generated file, then run:
    pactown up generated.pactown.yaml
    

Using markpact Examples

You can use existing markpact examples directly:

# From pactown root
pactown generate ../markpact/examples -o markpact-examples.pactown.yaml
pactown up markpact-examples.pactown.yaml

Troubleshooting

Port Already in Use

Pactown automatically finds free ports. If you see “Port X busy, using Y”, this is normal.

Service Won’t Start

Check sandbox logs:

cat .pactown-sandboxes/<service-name>/app.log

Validation Errors

pactown validate saas.pactown.yaml