Code Monkey home page Code Monkey logo

trail-race-cqrs-ed-api's Introduction

Trail Race CQRS Event Driven API

Instructions

  1. Clone the repo

git clone https://github.com/stjepanmamusa/trail-race-cqrs-ed-api

  1. Once inside the repo you will find two modules

    • race_application_command_service
    • race_application_query_service
  2. Open up two terminals, one in each and run

mvn clean install -DskipTests

  1. After you're finished with building both projects go into the main directory and run

docker compose up -d

This will startup PostgresDB on localhost:5432, pgAdmin4 on localhost:8888, and RabbitMQ management UI on localhost:15672.

USING RABBITMQ OR PGADMIN EXTENSIONS FOR DOCKER WILL CONFLICT WITH DEFAULT PORTS SO EITHER REMOVE THOSE EXTENSIONS OR MODIFY DOCKER COMPOSE FILE TO USE DIFFERENT PORTS (NOT 15672, AND NOT 8888)

Endpoint list

There is no Swagger-UI available so these request have to be sent with curl, Postman or some other Http Client.

Command Service running on localhost:9001

These endpoints are authenticated so you need to get a JWT first by calling the auth endpoint with default user. This user is predefined in PostgresDB => Database(users) => Table (user_info)

  • /auth/generate-token

{ "username":"admin", "password":"admin" }

  • /races/create-race

{ "firstName" : "John", "lastName" : "Doe", "distance" : "half-marathon", "club": "Multisport Club" }

  • races/update-race

{ "firstName": "John", "lastName": "Doe", "club": "Multisport Club", "distance": "half-marathon", "id": "4670e1f5-c7ba-4277-8c7d-21799175b060" }

  • /races/delete-race/{id}

localhost:9001/races/delete-race/da2dffe7-707b-418f-9d64-07f6b9de9b0e

These endpoints will send an event to RabbitMq which will be consumed by the query service running on localhost:/9002

Query Service running on localhost:9002

  • races/{id}

races/4670e1f5-c7ba-4277-8c7d-21799175b060

Gets one race.

  • /races/all

Gets all races

trail-race-cqrs-ed-api's People

Contributors

stjepanmamusa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.