├── .env.example ├── .gitignore ├── README.md ├── nest-cli.json ├── package.json ├── src ├── app.controller.ts ├── app.module.ts ├── auth │ ├── auth.controller.ts │ ├── auth.module.ts │ ├── commands │ │ ├── handlers │ │ │ ├── index.ts │ │ │ ├── login.handler.spec.ts │ │ │ └── login.handler.ts │ │ └── impl │ │ │ └── login.command.ts │ ├── dtos │ │ └── login.dto.ts │ ├── guards │ │ └── rest-auth.guard.ts │ ├── services │ │ ├── auth.payload.ts │ │ └── auth.service.ts │ └── strategies │ │ └── local.strategy.ts ├── common │ ├── common.module.ts │ ├── date.factory.ts │ └── uid-generator.ts ├── config.ts ├── main.ts ├── scripts │ ├── reconstruct-view-db.ts │ └── script.ts └── users │ ├── commands │ ├── handlers │ │ ├── create-user.handler.spec.ts │ │ ├── create-user.handler.ts │ │ └── index.ts │ └── impl │ │ └── create-user.command.ts │ ├── dtos │ └── create-user.dto.ts │ ├── entities │ └── user.entity.ts │ ├── events │ ├── handlers │ │ ├── index.ts │ │ └── user-created.handler.ts │ ├── impl │ │ └── user-created.event.ts │ └── updaters │ │ ├── index.ts │ │ ├── user-created.updater.spec.ts │ │ └── user-created.updater.ts │ ├── queries │ ├── handlers │ │ ├── get-user-by-email.handler.spec.ts │ │ ├── get-user-by-email.handler.ts │ │ ├── get-user-by-id.handler.spec.ts │ │ ├── get-user-by-id.handler.ts │ │ ├── get-users.handler.spec.ts │ │ ├── get-users.handler.ts │ │ └── index.ts │ └── impl │ │ ├── get-user-by-email.query.ts │ │ ├── get-user-by-id.query.ts │ │ ├── get-users.query.ts │ │ └── index.ts │ ├── users.controller.ts │ └── users.module.ts ├── test ├── app.e2e-spec.ts └── jest-e2e.json ├── tsconfig.build.json ├── tsconfig.json └── tslint.json /.env.example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/.env.example -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/.gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/README.md -------------------------------------------------------------------------------- /nest-cli.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/nest-cli.json -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/package.json -------------------------------------------------------------------------------- /src/app.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/app.controller.ts -------------------------------------------------------------------------------- /src/app.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/app.module.ts -------------------------------------------------------------------------------- /src/auth/auth.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/auth.controller.ts -------------------------------------------------------------------------------- /src/auth/auth.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/auth.module.ts -------------------------------------------------------------------------------- /src/auth/commands/handlers/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/commands/handlers/index.ts -------------------------------------------------------------------------------- /src/auth/commands/handlers/login.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/commands/handlers/login.handler.spec.ts -------------------------------------------------------------------------------- /src/auth/commands/handlers/login.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/commands/handlers/login.handler.ts -------------------------------------------------------------------------------- /src/auth/commands/impl/login.command.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/commands/impl/login.command.ts -------------------------------------------------------------------------------- /src/auth/dtos/login.dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/dtos/login.dto.ts -------------------------------------------------------------------------------- /src/auth/guards/rest-auth.guard.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/guards/rest-auth.guard.ts -------------------------------------------------------------------------------- /src/auth/services/auth.payload.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/services/auth.payload.ts -------------------------------------------------------------------------------- /src/auth/services/auth.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/services/auth.service.ts -------------------------------------------------------------------------------- /src/auth/strategies/local.strategy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/auth/strategies/local.strategy.ts -------------------------------------------------------------------------------- /src/common/common.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/common/common.module.ts -------------------------------------------------------------------------------- /src/common/date.factory.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/common/date.factory.ts -------------------------------------------------------------------------------- /src/common/uid-generator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/common/uid-generator.ts -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/config.ts -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/main.ts -------------------------------------------------------------------------------- /src/scripts/reconstruct-view-db.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/scripts/reconstruct-view-db.ts -------------------------------------------------------------------------------- /src/scripts/script.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/scripts/script.ts -------------------------------------------------------------------------------- /src/users/commands/handlers/create-user.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/commands/handlers/create-user.handler.spec.ts -------------------------------------------------------------------------------- /src/users/commands/handlers/create-user.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/commands/handlers/create-user.handler.ts -------------------------------------------------------------------------------- /src/users/commands/handlers/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/commands/handlers/index.ts -------------------------------------------------------------------------------- /src/users/commands/impl/create-user.command.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/commands/impl/create-user.command.ts -------------------------------------------------------------------------------- /src/users/dtos/create-user.dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/dtos/create-user.dto.ts -------------------------------------------------------------------------------- /src/users/entities/user.entity.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/entities/user.entity.ts -------------------------------------------------------------------------------- /src/users/events/handlers/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/events/handlers/index.ts -------------------------------------------------------------------------------- /src/users/events/handlers/user-created.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/events/handlers/user-created.handler.ts -------------------------------------------------------------------------------- /src/users/events/impl/user-created.event.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/events/impl/user-created.event.ts -------------------------------------------------------------------------------- /src/users/events/updaters/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/events/updaters/index.ts -------------------------------------------------------------------------------- /src/users/events/updaters/user-created.updater.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/events/updaters/user-created.updater.spec.ts -------------------------------------------------------------------------------- /src/users/events/updaters/user-created.updater.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/events/updaters/user-created.updater.ts -------------------------------------------------------------------------------- /src/users/queries/handlers/get-user-by-email.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/handlers/get-user-by-email.handler.spec.ts -------------------------------------------------------------------------------- /src/users/queries/handlers/get-user-by-email.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/handlers/get-user-by-email.handler.ts -------------------------------------------------------------------------------- /src/users/queries/handlers/get-user-by-id.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/handlers/get-user-by-id.handler.spec.ts -------------------------------------------------------------------------------- /src/users/queries/handlers/get-user-by-id.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/handlers/get-user-by-id.handler.ts -------------------------------------------------------------------------------- /src/users/queries/handlers/get-users.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/handlers/get-users.handler.spec.ts -------------------------------------------------------------------------------- /src/users/queries/handlers/get-users.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/handlers/get-users.handler.ts -------------------------------------------------------------------------------- /src/users/queries/handlers/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/handlers/index.ts -------------------------------------------------------------------------------- /src/users/queries/impl/get-user-by-email.query.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/impl/get-user-by-email.query.ts -------------------------------------------------------------------------------- /src/users/queries/impl/get-user-by-id.query.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/impl/get-user-by-id.query.ts -------------------------------------------------------------------------------- /src/users/queries/impl/get-users.query.ts: -------------------------------------------------------------------------------- 1 | export class GetUsersQuery { 2 | } 3 | -------------------------------------------------------------------------------- /src/users/queries/impl/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/queries/impl/index.ts -------------------------------------------------------------------------------- /src/users/users.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/users.controller.ts -------------------------------------------------------------------------------- /src/users/users.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/src/users/users.module.ts -------------------------------------------------------------------------------- /test/app.e2e-spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/test/app.e2e-spec.ts -------------------------------------------------------------------------------- /test/jest-e2e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/test/jest-e2e.json -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/tsconfig.build.json -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/tsconfig.json -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArkerLabs/event-sourcing-nestjs-example/HEAD/tslint.json --------------------------------------------------------------------------------