Skip to main content

Project structure

How you document your domains, services and messages is up to you, but to make it easier for you, you can nest resources within each other.

By default all resources in EventCatalog have a flat folder structure (e.g. /domains, /services, /events, /commands).

my-catalog
β”œβ”€β”€ /domains
β”‚ β”œβ”€β”€ /Orders
β”‚ β”‚ └──index.md
β”‚ β”‚ └──/versioned
β”‚ β”‚ └──0.0.1
β”‚ β”‚ └──index.md
β”‚ └── /Payment
β”‚ └──index.md
β”œβ”€β”€ /services
β”‚ β”œβ”€β”€ /InventoryService
β”‚ β”‚ └──index.md
β”‚ β”œβ”€β”€ /NotificationService
β”‚ β”‚ └──index.md
β”‚ β”œβ”€β”€ /OrdersService
β”‚ β”‚ └──index.md
β”‚ β”‚ └──openapi.yml
β”‚ └── /PaymentService
β”‚ └──index.md
β”œβ”€β”€ /commands
β”‚ β”œβ”€β”€ /AddInventory
β”‚ β”‚ └──index.md
β”‚ β”œβ”€β”€ /UpdateInventory
β”‚ β”‚ └──index.md
β”œβ”€β”€ /events
β”‚ β”œβ”€β”€ /Inventory
β”‚ β”‚ β”œβ”€β”€ /InventoryAdjusted
β”‚ β”‚ β”‚ └──index.md
β”‚ β”‚ β”‚ └──schema.json
β”‚ β”‚ β”‚ └──/versioned
β”‚ β”‚ β”‚ └──0.0.1
β”‚ β”‚ β”‚ └──index.md
β”‚ β”‚ β”‚ └──schema.json
β”‚ β”œβ”€β”€ OutOfStock
β”‚ β”‚ └──index.md
β”œβ”€β”€ teams
β”‚ └──full-stack.md
β”‚ └──mobile-devs.md
β”œβ”€β”€ users
β”‚ └──aSmith.md
β”‚ └──dboyne.md
β”‚ └──mSmith.md
β”œβ”€β”€ eventcatalog.config.js
β”œβ”€β”€ package.json
└── README.md

You can also nest resources making it easier to maintain and manage your catalogs as they grow in size.

EventCatalog hierarchy of resources is as following: domains > services > messages.

Using this hierarchy you can nest resources within each other using folder structures

  • /domains/{Domain Name}
    • /services/{My Service}
      • /events/{My Event}
      • /commands/{My Command}

Example with nested resources

my-catalog
β”œβ”€β”€ /domains
β”‚ β”œβ”€β”€ /Orders
β”‚ β”‚ └──index.md
β”‚ β”‚ └──openapi.yml
β”‚ β”‚ └──index.md
β”‚ β”‚ └──/versioned
β”‚ β”‚ └──0.0.1
β”‚ β”‚ └──index.md
β”‚ β”‚ └──/services
β”‚ β”‚ └── /OrdersService
β”‚ β”‚ └──index.md
β”‚ β”‚ └──openapi.yml
β”‚ β”‚ └── /events
β”‚ β”‚ └──OrderPlaced
β”‚ β”‚ └──index.md
β”‚ β”‚ └── /OrderCancelled
β”‚ β”‚ └──index.md
β”‚ └── /Payment
β”‚ β”‚ └──index.md
β”‚ β”‚ └──/services
β”‚ β”‚ └──/PaymentService
β”‚ β”‚ └── index.md
β”‚ β”‚ └── asyncapi.yml
β”‚ β”‚ └── /events
β”‚ β”‚ └── /PaymentReceived
β”‚ β”‚ └── /index.md
β”‚ β”‚ └── /schema.json
β”‚ β”‚ └── /PaymentCancelled
β”‚ β”‚ └── /index.md
β”‚ β”‚ └── /schema.avro
β”‚ β”‚ └── /commands
β”‚ β”‚ └── /VerifyPayment
β”‚ β”‚ └── /index.md
β”‚ β”‚ └── /schema.json
β”‚ β”‚ └── /CancelPayment
β”‚ β”‚ └── /index.md
β”‚ β”‚ └── /schema.json
β”œβ”€β”€ teams
β”‚ └──full-stack.md
β”‚ └──mobile-devs.md
β”œβ”€β”€ users
β”‚ └──aSmith.md
β”‚ └──dboyne.md
β”‚ └──mSmith.md
β”œβ”€β”€ eventcatalog.config.js
β”œβ”€β”€ package.json
└── README.md

If you want to see an example you can look at the EventCatalog repo example.

Nesting your resources within folders can help you manage your catalog as it grows over time.