Skip to main content

Decentralized Service Ecosystem Orchestrator - Build interconnected microservices from Markdown using markpact

Project description

img.png

Pactown ๐Ÿ˜๏ธ

Decentralized Service Ecosystem Orchestrator โ€“ Build interconnected microservices from Markdown using markpact.

Python 3.10+ License

Overview

Pactown enables you to compose multiple independent markpact projects into a unified, decentralized service ecosystem. Each service is defined in its own README.md, runs in its own sandbox, and communicates with other services through well-defined interfaces.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Pactown Ecosystem                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚   Web    โ”‚โ”€โ”€โ”€โ–ถโ”‚   API    โ”‚โ”€โ”€โ”€โ–ถโ”‚ Database โ”‚    โ”‚   CLI    โ”‚   โ”‚
โ”‚  โ”‚ :8002    โ”‚    โ”‚  :8001   โ”‚    โ”‚  :8003   โ”‚    โ”‚  shell   โ”‚   โ”‚
โ”‚  โ”‚ React    โ”‚    โ”‚ FastAPI  โ”‚    โ”‚ Postgres โ”‚    โ”‚  Python  โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚       โ”‚               โ”‚               โ”‚               โ”‚         โ”‚
โ”‚       โ–ผ               โ–ผ               โ–ผ               โ–ผ         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚              markpact sandboxes (isolated)               โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Features

  • ๐Ÿ”— Service Composition โ€“ Combine multiple markpact READMEs into one ecosystem
  • ๐Ÿ“ฆ Local Registry โ€“ Store and share markpact artifacts across projects
  • ๐Ÿ”„ Dependency Resolution โ€“ Automatic startup order based on service dependencies
  • ๐Ÿฅ Health Checks โ€“ Monitor service health with configurable endpoints
  • ๐ŸŒ Multi-Language โ€“ Mix Python, Node.js, Go, Rust in one ecosystem
  • ๐Ÿ”’ Isolated Sandboxes โ€“ Each service runs in its own environment
  • ๐Ÿ”Œ Dynamic Ports โ€“ Automatic port allocation when preferred ports are busy
  • ๐Ÿ” Service Discovery โ€“ Name-based service lookup, no hardcoded URLs
  • โšก Config Generator โ€“ Auto-generate config from folder of READMEs

Documentation

Document Description
Specification Architecture and design
Configuration YAML config reference
Network Dynamic ports & service discovery
Generator Auto-generate configs

Source Code Reference

Module Description
config.py Configuration models
orchestrator.py Service lifecycle management
resolver.py Dependency resolution
network.py Port allocation & discovery
generator.py Config file generator
registry/ Local artifact registry

Installation

pip install pactown

Or install from source:

git clone https://github.com/wronai/pactown
cd pactown
make install

Quick Start

1. Create ecosystem configuration

# saas.pactown.yaml
name: my-saas
version: 0.1.0

services:
  api:
    readme: services/api/README.md
    port: 8001
    health_check: /health

  web:
    readme: services/web/README.md
    port: 8002
    depends_on:
      - name: api
        endpoint: http://localhost:8001

2. Create service READMEs

Each service is a standard markpact README:

# API Service

REST API for the application.

---

\`\`\`markpact:deps python
fastapi
uvicorn
\`\`\`

\`\`\`markpact:file python path=main.py
from fastapi import FastAPI
app = FastAPI()

@app.get("/health")
def health():
    return {"status": "ok"}
\`\`\`

\`\`\`markpact:run python
uvicorn main:app --port ${MARKPACT_PORT:-8001}
\`\`\`

3. Start the ecosystem

pactown up saas.pactown.yaml
INFO:     127.0.0.1:57432 - "GET /health HTTP/1.1" 200 OK
INFO:     127.0.0.1:59272 - "GET /health HTTP/1.1" 200 OK
127.0.0.1 - - [15/Jan/2026 14:15:17] "GET /health HTTP/1.1" 200 -
INFO:     127.0.0.1:59300 - "GET /health HTTP/1.1" 200 OK
                Ecosystem: saas-platform                 
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Service  โ”ƒ Port  โ”ƒ Status     โ”ƒ PID    โ”ƒ Health       โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ database โ”‚ 10000 โ”‚ ๐ŸŸข Running โ”‚ 534102 โ”‚ โœ“ 22ms       โ”‚
โ”‚ api      โ”‚ 10001 โ”‚ ๐ŸŸข Running โ”‚ 534419 โ”‚ โœ“ 23ms       โ”‚
โ”‚ web      โ”‚ 10002 โ”‚ ๐ŸŸข Running โ”‚ 534424 โ”‚ โœ“ 29ms       โ”‚
โ”‚ cli      โ”‚ 10003 โ”‚ ๐Ÿ”ด Stopped โ”‚ 534734 โ”‚ Process died โ”‚
โ”‚ gateway  โ”‚ 10004 โ”‚ ๐ŸŸข Running โ”‚ 535242 โ”‚ โœ“ 23ms       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Press Ctrl+C to stop all services

127.0.0.1 - - [15/Jan/2026 14:15:29] "GET / HTTP/1.1" 200 -
INFO:     127.0.0.1:42964 - "GET / HTTP/1.1" 200 OK
INFO:     127.0.0.1:53998 - "GET /health HTTP/1.1" 200 OK
INFO:     127.0.0.1:54008 - "GET /api/stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:36100 - "GET /records/users HTTP/1.1" 200 OK
INFO:     127.0.0.1:54012 - "GET /api/users HTTP/1.1" 200 OK

Commands

Command Description
pactown up <config> Start all services
pactown down <config> Stop all services
pactown status <config> Show service status
pactown validate <config> Validate configuration
pactown graph <config> Show dependency graph
pactown init Initialize new ecosystem
pactown publish <config> Publish to registry
pactown pull <config> Pull dependencies

Registry

Pactown includes a local registry for sharing markpact artifacts:

# Start registry
pactown-registry --port 8800

# Publish artifact
pactown publish saas.pactown.yaml --registry http://localhost:8800

# Pull dependencies
pactown pull saas.pactown.yaml --registry http://localhost:8800

Registry API

Endpoint Method Description
/v1/artifacts GET List artifacts
/v1/artifacts/{ns}/{name} GET Get artifact info
/v1/artifacts/{ns}/{name}/{version}/readme GET Get README content
/v1/publish POST Publish artifact

Configuration Reference

name: ecosystem-name        # Required: ecosystem name
version: 0.1.0              # Semantic version
description: ""             # Optional description
base_port: 8000             # Starting port for auto-assignment
sandbox_root: ./.pactown-sandboxes  # Sandbox directory

registry:
  url: http://localhost:8800
  namespace: default

services:
  service-name:
    readme: path/to/README.md   # Path to markpact README
    port: 8001                  # Service port
    health_check: /health       # Health check endpoint
    timeout: 60                 # Startup timeout (seconds)
    replicas: 1                 # Number of instances
    auto_restart: true          # Restart on failure
    env:                        # Environment variables
      KEY: value
    depends_on:                 # Dependencies
      - name: other-service
        endpoint: http://localhost:8000
        env_var: OTHER_SERVICE_URL

Examples

See the examples/ directory for complete ecosystem examples:

  • SaaS Platform โ€“ Web + API + Database + CLI
  • Microservices โ€“ Multiple language services
  • Event-Driven โ€“ Services with message queues

Architecture

pactown/
โ”œโ”€โ”€ src/pactown/
โ”‚   โ”œโ”€โ”€ __init__.py          # Package exports
โ”‚   โ”œโ”€โ”€ cli.py               # CLI commands
โ”‚   โ”œโ”€โ”€ config.py            # Configuration models
โ”‚   โ”œโ”€โ”€ orchestrator.py      # Service orchestration
โ”‚   โ”œโ”€โ”€ resolver.py          # Dependency resolution
โ”‚   โ”œโ”€โ”€ sandbox_manager.py   # Sandbox management
โ”‚   โ””โ”€โ”€ registry/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ server.py        # Registry API server
โ”‚       โ”œโ”€โ”€ client.py        # Registry client
โ”‚       โ””โ”€โ”€ models.py        # Data models
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ saas-platform/       # Complete SaaS example
โ”‚   โ””โ”€โ”€ microservices/       # Microservices example
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ Makefile
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

License

Apache License 2.0 โ€“ see LICENSE for details.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pactown-0.1.4.tar.gz (96.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pactown-0.1.4-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

Details for the file pactown-0.1.4.tar.gz.

File metadata

  • Download URL: pactown-0.1.4.tar.gz
  • Upload date:
  • Size: 96.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pactown-0.1.4.tar.gz
Algorithm Hash digest
SHA256 264d0473931e4d4fe612aed477eefb366b9c949e429cc12603ad9f122bf4655b
MD5 4bfd8582c5dc1a0e14472071c6c68ab7
BLAKE2b-256 3be273f32b9e80442ea2f8749211290c5452ae294b1aee51f512723b5f8c6869

See more details on using hashes here.

File details

Details for the file pactown-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pactown-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 48.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pactown-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9bea278ec4003f53a4dd55a6f32759d9a408e63d3a03fdc9d087742ade6df00b
MD5 4ee195b14baf2261f3d94f2794736d26
BLAKE2b-256 443d6f767224b23aa4e09cd6a2f4bcb522afbfc3418bf1375e82c42b39dcdaae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page