Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joeltadeu committed Jan 16, 2022
0 parents commit b59e337
Show file tree
Hide file tree
Showing 111 changed files with 5,439 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/google-java-format.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jpa-buddy.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/saveactions_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Bank account using CQRS, Event Sourcing, Kafka

Learn to build distributed Event-driven Microservices, CQRS, Event Sourcing using Kafka, MySQL and MongoDB

## There are two microservices:

- **Account Query** : This microservice is responsible for read information about the accounts using the read database.
- **Account Command** : This microservice is responsible for managing accounts. A user can open an account, deposit funds and withdraw funds.

### Concepts used ###
- Event-Driven Microservices
- CQRS Design Pattern
- Event Based Messages
- Kafka
- NoSQL database with MongoDB

### EndPoints ###

| Service | EndPoint | Method | Description |
|-----------------|-------------------------------------|:------:|-----------------------|
| Account Command | /api/v1/accounts | POST | Open an account |
| Account Command | /api/v1/accounts/{id}/deposit | PUT | Deposit funds |
| Account Command | /api/v1/accounts/{id}/withdraw | PUT | Withdraw funds |
| Account Command | /api/v1/accounts/{id} | DELETE | Close an account |
| Account Command | /api/v1/operations/database/restore | POST | Restore read database |
| Account Query | /api/v1/accounts | GET | List of accounts |
| Account Query | /api/v1/accounts/{id} | GET | LIst of accounts |

### Documentation and examples ###

###Postman collection

![Alt text](assets/postman-collection-folder.png?raw=true "Postman collection folder")

## Build & Run

- *>mvn clean package* : to build
- *>docker-compose up* --build : build docker images and containers and run containers
- *>docker-compose stop* : stop the dockerized services
- Each maven module has a Dockerfile.

In docker-compose.yml file:

- Account Command : **__5000__** port is mapped to **__5000__** port of host
- Account Query : **__5001__** port is mapped to **__5001__** port of host

## VERSIONS

### 1.0.0

- MongoDB
- MySQL
- Spring-Boot 2.6.2.RELEASE
- Java 16
33 changes: 33 additions & 0 deletions account-cmd-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Loading

0 comments on commit b59e337

Please sign in to comment.