├── .commitlintrc.js ├── .eslintignore ├── .eslintrc.js ├── .firebaserc ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .huskyrc.js ├── .lintstagedrc.js ├── .prettierignore ├── .prettierrc.js ├── LICENSE.md ├── README.md ├── app └── package.json ├── example └── src │ ├── client.ts │ ├── config.ts │ ├── domain │ ├── cart │ │ ├── commands.ts │ │ ├── events.ts │ │ ├── index.ts │ │ └── state.ts │ └── index.ts │ ├── flows │ ├── every-night-send-report-email.ts │ ├── if-order-placed-then-send-email.ts │ └── index.ts │ ├── functions.ts │ ├── services │ ├── email.ts │ └── index.ts │ └── views │ ├── carts.ts │ ├── index.ts │ └── reports.ts ├── firebase.json ├── functions └── package.json ├── jest.config.js ├── package.json ├── scripts ├── build-example.js └── test.js ├── src ├── app.ts ├── client.ts ├── constants.ts ├── functions │ ├── firestore.ts │ ├── https │ │ ├── commands.test.ts │ │ ├── commands.ts │ │ ├── middlewares │ │ │ └── auth.ts │ │ └── utils │ │ │ └── parse-location-from-headers.ts │ ├── index.ts │ └── pubsub.ts ├── index.ts ├── services │ ├── aggregates.ts │ ├── flow.ts │ ├── logger.ts │ └── projections.ts ├── stores │ ├── event-store.test.ts │ └── event-store.ts ├── types │ ├── aggregate.ts │ ├── app.ts │ ├── command.ts │ ├── event.ts │ ├── flow.ts │ ├── misc.ts │ ├── service.ts │ └── view.ts └── utils │ ├── flatten.ts │ ├── generate-id.ts │ └── get-fully-qualified-event-name.ts ├── tsconfig.build.json ├── tsconfig.json ├── tsup.config.js └── yarn.lock /.commitlintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | } 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .cache 2 | dist 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/.eslintrc.js -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/.firebaserc -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/.gitignore -------------------------------------------------------------------------------- /.huskyrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/.huskyrc.js -------------------------------------------------------------------------------- /.lintstagedrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/.lintstagedrc.js -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .cache 2 | dist 3 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/.prettierrc.js -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/LICENSE.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/README.md -------------------------------------------------------------------------------- /app/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/app/package.json -------------------------------------------------------------------------------- /example/src/client.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/client.ts -------------------------------------------------------------------------------- /example/src/config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/config.ts -------------------------------------------------------------------------------- /example/src/domain/cart/commands.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/domain/cart/commands.ts -------------------------------------------------------------------------------- /example/src/domain/cart/events.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/domain/cart/events.ts -------------------------------------------------------------------------------- /example/src/domain/cart/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/domain/cart/index.ts -------------------------------------------------------------------------------- /example/src/domain/cart/state.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/domain/cart/state.ts -------------------------------------------------------------------------------- /example/src/domain/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/domain/index.ts -------------------------------------------------------------------------------- /example/src/flows/every-night-send-report-email.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/flows/every-night-send-report-email.ts -------------------------------------------------------------------------------- /example/src/flows/if-order-placed-then-send-email.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/flows/if-order-placed-then-send-email.ts -------------------------------------------------------------------------------- /example/src/flows/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/flows/index.ts -------------------------------------------------------------------------------- /example/src/functions.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/functions.ts -------------------------------------------------------------------------------- /example/src/services/email.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/services/email.ts -------------------------------------------------------------------------------- /example/src/services/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/services/index.ts -------------------------------------------------------------------------------- /example/src/views/carts.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/views/carts.ts -------------------------------------------------------------------------------- /example/src/views/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/views/index.ts -------------------------------------------------------------------------------- /example/src/views/reports.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/example/src/views/reports.ts -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/firebase.json -------------------------------------------------------------------------------- /functions/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/functions/package.json -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/jest.config.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/package.json -------------------------------------------------------------------------------- /scripts/build-example.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/scripts/build-example.js -------------------------------------------------------------------------------- /scripts/test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/scripts/test.js -------------------------------------------------------------------------------- /src/app.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/app.ts -------------------------------------------------------------------------------- /src/client.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/client.ts -------------------------------------------------------------------------------- /src/constants.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/constants.ts -------------------------------------------------------------------------------- /src/functions/firestore.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/functions/firestore.ts -------------------------------------------------------------------------------- /src/functions/https/commands.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/functions/https/commands.test.ts -------------------------------------------------------------------------------- /src/functions/https/commands.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/functions/https/commands.ts -------------------------------------------------------------------------------- /src/functions/https/middlewares/auth.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/functions/https/middlewares/auth.ts -------------------------------------------------------------------------------- /src/functions/https/utils/parse-location-from-headers.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/functions/https/utils/parse-location-from-headers.ts -------------------------------------------------------------------------------- /src/functions/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/functions/index.ts -------------------------------------------------------------------------------- /src/functions/pubsub.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/functions/pubsub.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/services/aggregates.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/services/aggregates.ts -------------------------------------------------------------------------------- /src/services/flow.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/services/flow.ts -------------------------------------------------------------------------------- /src/services/logger.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/services/logger.ts -------------------------------------------------------------------------------- /src/services/projections.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/services/projections.ts -------------------------------------------------------------------------------- /src/stores/event-store.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/stores/event-store.test.ts -------------------------------------------------------------------------------- /src/stores/event-store.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/stores/event-store.ts -------------------------------------------------------------------------------- /src/types/aggregate.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/aggregate.ts -------------------------------------------------------------------------------- /src/types/app.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/app.ts -------------------------------------------------------------------------------- /src/types/command.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/command.ts -------------------------------------------------------------------------------- /src/types/event.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/event.ts -------------------------------------------------------------------------------- /src/types/flow.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/flow.ts -------------------------------------------------------------------------------- /src/types/misc.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/misc.ts -------------------------------------------------------------------------------- /src/types/service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/service.ts -------------------------------------------------------------------------------- /src/types/view.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/types/view.ts -------------------------------------------------------------------------------- /src/utils/flatten.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/utils/flatten.ts -------------------------------------------------------------------------------- /src/utils/generate-id.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/utils/generate-id.ts -------------------------------------------------------------------------------- /src/utils/get-fully-qualified-event-name.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/src/utils/get-fully-qualified-event-name.ts -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/tsconfig.build.json -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/tsconfig.json -------------------------------------------------------------------------------- /tsup.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/tsup.config.js -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gustavopch/firebase-event-sourcing/HEAD/yarn.lock --------------------------------------------------------------------------------