Project structure
Your new EventCatalog project generated from the create eventcatalog CLI wizard already includes some files and folders. Others, you will create yourself and add to EventCatalog’s existing file structure.
Directories and Files
domains/*
- Your domains in your architecture (e.g. Orders, Payment, etc.)domains/services/*
- Your services in your architecture (e.g. OrdersService, PaymentService, etc.)domains/services/*/events/*
- Your events in your architecture (e.g. OrderPlaced, PaymentReceived, etc.)domains/services/*/commands/*
- Your commands in your architecture (e.g. AddOrder, UpdatePayment, etc.)domains/services/*/queries/*
- Your queries in your architecture (e.g. GetOrder, GetPayment, etc.)channels/*
- Your channels in your architecture (e.g. Kafka, RabbitMQ, etc.)teams/*
- Your teams in your organization, you can use these to assign ownership to resources in your catalogteams/*
- Users in your organization, you can use these to assign ownership to resources in your catalogcomponents/*
- Any custom components you want to create for your catalogpublic/*
- Your non-code, unprocessed assets (fonts, icons, etc.)package.json
- A project manifest.eventcatalog.config.js
- An EventCatalog configuration file. (recommended)
Project structure options
- Nested folder structures (default)
- You can group domains, services and messages together using folders (recommended)
- This can help you manage large catalogs with folders.
- Flat folder structures
- You can have all your resources (domains, services and messages) in the root of your project.
- This can be useful for simple catalogs.
Nested folder structure example (recommended)
/domains/
- Root folder called
domains
this folder contains information about your domain and the services that belong to that domain.- Example
/domains/Orders
- Example
- More details can be found in the domains guide
- Root folder called
/domains/{Domain Name}/services/
- Put your services inside your domain folder
- Example
/domains/Orders/services/OrdersService
- Example
- More details can be found in the services guide
- Put your services inside your domain folder
/domains/{Domain Name}/services/{Service Name}/events
- Put events inside your service
- Example
/domains/Orders/services/OrdersService/events
- Example
- More details can be found in the events guide
- Put events inside your service
/domains/{Domain Name}/services/{Service Name}/commands
- Put commands inside your service
- Example
/domains/Orders/services/OrdersService/commands
- Example
- More details can be found in the commands guide
- Put commands inside your service
/domains/{Domain Name}/services/{Service Name}/queries
- Put queries inside your service
- Example
/domains/Orders/services/OrdersService/queries
- Example
- More details can be found in the queries guide
- Put queries inside your service
/teams
- Document teams in EventCatalog
- Example
/teams/myteam.mdx
- Example
- More details can be found in the teams guide
- Document teams in EventCatalog
/users
- Document users in EventCatalog
- Example
/users/dboyne.mdx
- Example
- More details can be found in the users guide
- Document users in EventCatalog
/eventcatalog.config.js
- A config file containing the site configuration. Read the API docs/package.json
- File required for your application to work.
Flat folder structure example
/domains/
- Document domains in EventCatalog
- Example
/domains/Orders
- Example
- More details can be found in the domains guide
- Document domains in EventCatalog
/services/
- Document services in EventCatalog
- Example
/services/OrdersService
- Example
- More details can be found in the services guide
- Document services in EventCatalog
/events
- Document events in EventCatalog
- Example
/events/InventoryPlaced
- Example
- More details can be found in the events guide
- Document events in EventCatalog
/commands
- Document commands in EventCatalog
- Example
/commands/UpdateInventory
- Example
- More details can be found in the commands guide
- Document commands in EventCatalog
/queries
- Document queries in EventCatalog
- Example
/queries/GetInventory
- Example
- More details can be found in the queries guide
- Document queries in EventCatalog
/teams
- Document teams in EventCatalog
- Example
/teams/myteam.mdx
- Example
- More details can be found in the teams guide
- Document teams in EventCatalog
/users
- Document users in EventCatalog
- Example
/users/dboyne.mdx
- Example
- More details can be found in the users guide
- Document users in EventCatalog
/eventcatalog.config.js
- A config file containing the site configuration. Read the API docs/package.json
- File required for your application to work.