Coder Social home page Coder Social logo

jesperancinha / vma-archiver Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 3.0 12.31 MB

Video Media Archiver

License: Apache License 2.0

Shell 6.90% Kotlin 51.48% Makefile 5.82% Dockerfile 1.81% JavaScript 1.35% TypeScript 25.26% HTML 2.53% Less 0.97% Python 3.88%

vma-archiver's Introduction

vma-archiver


Twitter URL Generic badge GitHub release

CircleCI Build status

vma-archiver e2e-vma-archiver-app

Codacy Badge Known Vulnerabilities

Coverage Status codecov Codacy Badge

GitHub language count GitHub top language GitHub top language


Technologies used

Please check the TechStack.md file for details.

Introduction

We are going to make a VMA archiver. VMA in this case does not stand for Video Media Archive anymore. That was version 0.0.0. It now stands for Video Music Awards. So we are going to make a service to register nominees and winners of a VMA show. In this case, we'll use a fake MTV Awards Show. Instead of using contemporary music, we'll make an MTV awards with music and artists from the 1920's.

Our application will be built around the Reactive CoRoutine Paradigms. We'll be using five important elements: Hazelcast, SpringWebFlux, Flow, Kotlin Co-Routines and a nice architecture.

Stable Releases

This repo is also the official support repo to my article on medium:

- Stable releases


Walk Through

Knowledge Cloud
Knowledge Cloud

BuildersKt.class, Builders.common, withContext, ifEmpty, tailrec, suspend, runBlocking, shuffled , sortedBy, async , await, launch, delay, runBlocking, coroutineScope, Channel, consumeEach, produce, produceSquares , produceNumbers, yield, @Volatile, withContext, Dispatchers.Default, Mutex, CoroutineScope , counterActor, override val massiveRun,


Knowledge for Integration Tests Cloud

@Mockk, @Test, @SpringBootTest


Project Layout

  • VMA Demo Generation - Generates The Demo Awards - It is customizable in terms of categories, music and artists.
  • VMA Common - A Common Library to support Spring Boot Startup Services.
  • VMA Play - A way to play with co-routines separated from the project. It has examples on the main and test directories.
  • VMA Spring CoRoutine Reactive Service - The reactive service facing the front-end - It posts votes in Kafka, registers a new award show directly and reads voting results from the database.
  • VMA Service Event Listener - Listens to incoming votes sent in a massive load fashion.
  • Locust - The location of locust service. It creates workers in kotlin that simulate random massive voters.

Sequence diagram

To visualize this diagram you may need the mermaid-diagrams plugin installation.

To visualize it in Intellij, please install the mermaid plugin.

    sequenceDiagram
        participant VMA Voting Client 1
        participant VMA Voting Client 2
        participant VMA Voting Client n
        participant VMA BE NGINX LB
        participant VMA Services Backend
        participant VMA Kafka Streams
        participant VMA Services Event Listeners
        participant VMA BE HA LB
        participant VMA PostgreSQL
        
        rect rgba(0, 0, 255, .1)
        par
        VMA Voting Client 1-->> VMA BE NGINX LB: Cast vote
        and
        VMA Voting Client 2-->> VMA BE NGINX LB: Cast vote
        and
        VMA Voting Client n-->> VMA BE NGINX LB: Cast vote
        end
        end
        VMA BE NGINX LB-->>VMA Services Backend: Distribute Votes
        VMA Services Backend-->>VMA Kafka Streams: Register Votes
        par
        VMA Kafka Streams-->>VMA Services Backend: Vote registered!
        and
        VMA Kafka Streams-->>VMA Services Event Listeners: Send Register Vote event
        end
        VMA Services Backend-->>VMA BE NGINX LB: Vote registered!
        VMA BE NGINX LB-->>VMA Voting Client 1: Vote registered!
        VMA BE NGINX LB-->>VMA Voting Client 2: Vote registered!
        VMA BE NGINX LB-->>VMA Voting Client n: Vote registered!
        VMA Services Event Listeners-->>VMA PostgreSQL: Create Vote database record
        rect rgba(0, 0, 255, .1)
        par
        VMA Voting Client 1-->> VMA BE NGINX LB: Read votes
        and
        VMA Voting Client 2-->> VMA BE NGINX LB: Read votes
        and
        VMA Voting Client n-->> VMA BE NGINX LB: Read votes
        end
        end
        VMA BE NGINX LB-->>VMA Services Backend: Distribute read votes request
        VMA Services Backend-->>VMA BE HA LB: Request Database Votes
        VMA BE HA LB-->>VMA PostgreSQL: Read Votes
        VMA PostgreSQL-->>VMA BE HA LB: Response with Votes
        VMA BE HA LB-->>VMA Services Backend: Response With Votes
        VMA Services Backend-->>VMA BE NGINX LB: Response With Votes
        VMA BE NGINX LB-->>VMA Voting Client 1: Response With Votes
        VMA BE NGINX LB-->>VMA Voting Client 2: Response With Votes
        VMA BE NGINX LB-->>VMA Voting Client n: Response With Votes

How to run

In general:

make docker-clean-build-start
Start all containers
make dcup-full

If it fails, you can always try make dcup.


Start Locust
make locust

Cast your vote

Wait for locust to stop and check the result

Swagger tests
You can make tests for this application using the Swagger UI at

Endpoints

Install essential libraries and commands
make install

Serving Spring Boot (LOCAL)

In order to let Kafka know where to get to locally you need to define locally that jofisaes-vma-broker is also in 127.0.0.1.

This is done in MAC-OS and Linux machines on /etc/hosts:

127.0.0.1   jofisaes-vma-broker

Java setup
sdk install java 17-open
sdk use java 17-open


References

About me

GitHub followers

vma-archiver's People

Contributors

jesperancinha avatar dependabot[bot] avatar github-actions[bot] avatar snyk-bot avatar

Stargazers

L Duncan avatar Roman avatar Sayan Maity avatar Indrit Qoku avatar Nick avatar  avatar Leonardo Silveira avatar

Watchers

 avatar  avatar

vma-archiver's Issues

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.