Skip to content

Latest commit

 

History

History
130 lines (87 loc) · 5.22 KB

README.md

File metadata and controls

130 lines (87 loc) · 5.22 KB

Gift Card - demo application

A demo application written in TypeScript and NestJS, using Axon Synapse and Axon Server.

Additionally, the application is using fmodel-ts to implement CQRS and Event Sourcing patterns effectively.

It focuses around a simple giftcard domain, designed to show robust implementation of DDD/CQRS/ES concepts.

The structure of the application

A bit simplified, this architectural style is characterized by two key architectural attributes:

  • There is a core with the core business logic, and a shell that handles interactions with the outside world, such as persisting data in databases or providing UIs to interact with end users.

  • The shell can call the core, but the core cannot call the shell and the core is even unaware of the existence of the shell. This is also known as the Dependency Rule(s).

  • It is similar to Hexagonal Architecture, Ports and Adapters, Clean Architecture, Onion Architecture which have these two attributes in common.

In this demo we have categorized the code into three layers:

Additionally, the components are split per command and query side of the application. This is CQRS pattern influencing the structure of the application.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Running the app in Docker (development mode)

Set the correct :

docker-compose up -d

To shut it down:

docker-compose down -v

or, run Axon Server Enterprise Edition

Set the correct :

docker-compose -f docker-compose-ee.yml up -d

To shut it down:

docker-compose -f docker-compose-ee.yml down -v

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Play

Check the HTTP scratch file(s) that you can run and explore the application:

Infrastructure

Run Axon Server, Axon Synapse and Postgres

Axon Server

Axon Synapse

Postgres


Created with ❤️ by AxonIQ