Installation
Requirementsβ
- Node.js version >= 20.x.x or above (which can be checked by running
node -v
). You can use nvm for managing multiple Node versions on a single machine installed
Scaffold project catalogβ
The easiest way to install EventCatalog is to use the command line tool that helps you scaffold a skeleton EventCatalog. You can run this command anywhere in a new empty repository or within an existing repository, it will create a new directory containing the scaffolded files.
- Install (with a default catalog)
- Install (with empty catalog)
npx @eventcatalog/create-eventcatalog@latest my-catalog
npx @eventcatalog/create-eventcatalog@latest my-catalog --empty
Project structureβ
Assuming you named your site my-catalog
, you will see the following files generated under a new directory my-catalog/
:
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
Project structure rundownβ
/domains/
- Contains the domain Markdown files. These are optional but recommended. With domains you can group services. More details can be found in the domains guide/services/
- Contains the service Markdown files. Services belong to a domain, and can send or receive messages (commands or events). These are optional but recommended. More details can be found in the services guide/commands/
- Contains commands (message). These are optional. Learn more in the commands guide/events/
- Contains events (message). These are optional. More details can be found in the events guide/eventcatalog.config.js
- A config file containing the site configuration. Read the API docs/package.json
- File required for your application to work.
Running the development serverβ
To preview your changes as you edit the files, you can run a local development server that will serve your website and reflect the latest changes.
cd my-catalog
npm run dev
You will be able to see your EventCatalog at http://localhost:3000/docs
Congratulations! You have just created your first EventCatalog site!
Buildβ
EventCatalog uses Astro under the hood. To build the catalog run the following command:
npm run build
All contents will be generated within the /dist
directory.
EventCatalog is currently a static website so you can host this folder anywhere you like.
Check out the docs on hosting for more details.