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.
Nested resources (recommended)β
Added in
eventcatalog@2.9.1
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}
- /services/{My Service}
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.