Skip to content

CQRS, event sourced, load balanced microservices with Koa ⚗️

License

Notifications You must be signed in to change notification settings

alexandrelam/ilog

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

ILOG: Koa Project

A CQRS and event sourcing based microservice architecture with Koa
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Seeder
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgments

About The Project

Product Name Screen Shot

The goal of this project is to learn how to write a backend app using Koa. This app should be a RESTful API that can handle books, authors and genre in a MongoDB database.

To spice up this project a little bit, we decided to extend the scope of the project and base it on microservices. We tried to follow a CQRS and event sourcing ideology. We used Koa for our query and write service, Kafka as our event store and MongoDB for our database. We also added KafkaDrop and OpenApi documentation.

(back to top)

Built With

This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

(back to top)

Getting Started

In this section you will learn how to get the project up and running.

Prerequisites

You need a few softwares before things works properly.

  • npm with node

    npm install npm@latest -g
  • docker (and don't forget docker-compose if you are on linux)

Installation

Below is an example of how you can install the dependancies and set up the app.

  1. Clone the repo

    git clone https://github.com/alexandrelam/ilog
  2. Install npm dependancies for the whole repo

    npm install
  3. Install npm dependancies for the different services

    cd api && npm install
    cd .. && cd write-service && npm install
    cd .. && cd shared && npm install
  4. docker-compose up!

    docker-compose up

    Make sure no other app are running on port 4000, 4001, 4002, 9000, 2181, 27017, 29092. If the app is not starting because of kafka not initiating fast enough just shutdown the servers and docker-compose back up again.

(back to top)

Usage

Use Postman to test the api! (https://www.postman.com/)

For more examples, please refer to the OpenAPI documentation

Seeder

To seed the db don't forget to execute the command in the container.

docker exec -it fc7e74e0993d npm run seed

(back to top)

Roadmap

  • Write a cool readme
  • Convert whole app to cqrs
  • Await group 1 to contact us and build something cool
  • Make a better seeder for wordle
  • Create a banking service for CQRS because it's a better example than authors!

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Alexandre LAM - alexandrelam@outlook.com

Thomas BERNARD - thomas.bernard@etu.imt-nord-europe.fr

Project Link: https://github.com/alexandrelam/ilog

(back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)