Skip to content
EventFabric CQRS Framework

Get Started

To get started with EventFabric you need to install the core package and other relevant EventFabric packages based on your needs.

All packages live under the @eventfabric-cqrs scope.

Depending on your package manager or runtime you can install EventFabric with the following command.

pnpm add @eventfabric-cqrs/core
  1. Clone the EventFabric repository:

    git clone https://github.com/devn-ch/EventFabric.git
  2. Switch to the node-demo directory:

    cd examples/node-demo
  3. Copy the .env.example template for local development (use environment variables in production)

    cp .env.example .env
  4. Start the ferretdb container as an Open Source licensed MongoDB alternative based on postgresql

    docker compose up -d
  5. Install packages (dependencies)

    pnpm install
  6. Starts the demo project

    pnpm dev
  7. Use curl or another tool to call the invite-user API:

    curl -d '{ "email": "test@user.ch", "firstName": "Agent", "lastName": "EventFabric", "group": "admin" }' -X POST http://localhost:3000/iam/users/invite-user

    outputs:

    {"_id":"6a307c03e711a873b225ed44","email":"test@user.ch","firstName":"Agent","lastName":"EventFabric","group":"admin","createdAt":"2026-06-15T20:26:11.755Z","updatedAt":"2026-06-15T20:26:11.755Z"}
  8. Use /iam/users/groups to receive all groups with the users:

    curl http://localhost:3000/iam/users/groups

    outputs:

    [{"_id":"6a307c03e711a873b225ed44","email":"test@user.ch","group":"admin","firstName":"Agent","lastName":"EventFabric","createdAt":"2026-06-15T20:26:11.755Z","updatedAt":"2026-06-15T20:26:11.755Z"}]}]
  9. Clean up and remove volumes

    docker compose down -v