Skip to content

jesperancinha/buy-odd-yucca-concert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buy Odd Yucca Concert


Generic badge

GitHub License

CircleCI Build, Test, Coverage and Report Build and Chain Test Build status e2e-buy-odd-yucca-concert

Codacy Badge Known Vulnerabilities

Codacy Badge codecov Coverage Status

GitHub language count GitHub top language GitHub top language


Technologies used

Please check the TechStack.md file for details.

1. Introduction

1.1. - Stable releases


2. - Installing NVM 🌴

You don't need to install NVM per se. This may only be need if you are running a non LTS version of nodejs. In that case, just run:

nvm-install.sh
node -v

3. - How to run

3.1 - Run docker

3.1.1. - Optional Intallation (Mostly if something is not quite correctly configured)

sudo usermod -a -G docker $(whoami)

Restart and:

newgrp docker

3.1.2. - Start Application

make docker-clean-build-start

3.2 - Load Kong Settings

Wait for containers to start (usually no more than 10 seconds).

make kong-setup

3.3 - Settings

This project is built upon node v16.13.1

3.4 - Docker Usage

3.4.1. - Using Containers

docker exec -it buy-oyc-nginx /bin/bash
docker exec -it kong /bin/bash
docker exec -it buy-oyc-parking /bin/bash
docker exec -it buy-oyc-ticket /bin/bash

3.4.2. - Endpoints from inside Docker

curl http://buy-oyc-ticket:8000/api/yucca-ticket

3.4.3. - Endpoints open to the outside

API

Routes

3.4.4. - Swagger UI Tests

Although this project is meant to be used with Locust and for benchmark testing and rate-limiting, it may be interesting to understand the data model first. Swagger UI helps with that.

Please run make docker-clean-build-start before anything. If you are running the services outside Docker, please make sure to have these environment variables assigned: POSTGRESQL_HOST=localhost;REDIS_HOST=localhost

Here are the endpoints for the services with the open port:

Via Kong Gateway for swagger.yml

Via Kong Gateway for Swagger UI

Make sure to check the e2e tests in order to see how Swagger is implemented. The Explorer textbox needs to be manually configured at the moment.

3.4.5 Cypress tests

In order to run cypress tests, please run

make dcup-full

Then go to the e2e folder and run:

make cypress-open

The cypress test management window should open and you should be able to perform your tests manually.

3.5. - Security Report
mvn clean install -Powasp

Read report after running:



4. Run chain tests


make build-integration


5. Coffee sessions




6. Sequence Diagram

sequenceDiagram
    participant Customer Service Client
    participant API
    participant Ticket API
    participant Concert API
    participant Catering API
    participant Parking API
    participant Redis
    participant Database
    
    rect rgb(1,40,25)
        Customer Service Client -->> API: Request Ticket Reservation (POST)
        API -->> Database: Persists Reservation
        Database -->> API: Delivers record with Reference ID
        API -->> Redis: Publishes TicketDto Payload
        API -->> Customer Service Client: Response with reservation number
        Redis --x API: Listens to TicketDto
        API -->> Ticket API: Posts ticket dto payload
        Ticket API -->> Redis: Publish Ticket Dto to Redis
        Ticket API --x API: Async ACK
        Redis --x Ticket API: Listen to Ticket Dto
        Ticket API -->> Concert API: Post Concert Fragment
        Concert API --x Redis: Publish Concert
        Concert API --x Ticket API: Async ACK
        Ticket API -->> Catering API: Send Drink(s)
        Catering API --x Redis: Publish Drink(s)
        Catering API --x Ticket API: Drink Async ACK
        Ticket API -->> Catering API: Send Meal(s)
        Catering API --x Redis: Publish Meal(s)
        Catering API --x Ticket API: Meal Async ACK
        Ticket API -->> Parking API: Send Parking Reservation
        Parking API --x Ticket API: Parking Reservation ACK
        Parking API --x Redis: Publish Parking Reservation
        Redis --x Concert API: Listen to concert data
        Concert API --x Database: Persist concert data
        Redis --x Catering API: Listen to drink data
        Catering API --x Database: Persist drinks data
        Redis --x Catering API: Listen to meal data
        Catering API --x Database: Persist meals data
        Redis --x Parking API: Listen to parking data
        Parking API --x Database: Persist parking data
    end
Loading

7 References

7.1. Online


7.2. Online Videos

About me

GitHub followers