# alexieve/marketing-real-time-games-vou architecture

> Architecture diagram of the GitHub repository alexieve/marketing-real-time-games-vou, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alexieve/marketing-real-time-games-vou
- Repository: https://github.com/alexieve/marketing-real-time-games-vou

## Overview

##### Project Overview & Components
- VOU is a full-stack, microservices-driven application that powers promotional campaigns with interactive, real-time games (e.g., Realtime Quiz, Shake-to-Win). It targets multiple audiences via an Admin Web Platform, a Brand Web Platform, and a Player Mobile Platform.
- The project contains distinct microservices (each in its own directory under the backend folder) for authentication, event management (command and query), game logic (including WebSocket integrations for real-time gameplay), image handling, notifications, and user management.
- On the frontend, there are two separate codebases – one for mobile (built likely with React Native) and one for the web (React based, with configuration files such as Docker and Nginx).
- The infrastructure (in the infra directory) defines Kubernetes deployments, horizontal pod autoscalers (HPA), persistent volumes (PVC), and configurations for external services (like RabbitMQ, Redis, PostgreSQL, MongoDB).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Mobile["Player Mobile Platform"]:::frontend
        Web["Admin & Brand Web Platform"]:::frontend
    end

    %% Backend Microservices
    subgraph "Backend Microservices"
        Auth["Auth Service"]:::backend
        EC["Event Command Service"]:::backend
        EQ["Event Query Service"]:::backend
        Game["Game Service"]:::backend
        Image["Image Service"]:::backend
        Notification["Notification Service"]:::backend
        User["User Service"]:::backend
    end

    %% Data & Integration
    subgraph "Data & Integration"
        PostgreSQL["PostgreSQL (Relational DB)"]:::database
        MongoDB["MongoDB (NoSQL DB)"]:::database
        Redis["Redis (Cache)"]:::database
        Firebase["Firebase (Notifications)"]:::database
        RabbitMQ["RabbitMQ (Message Broker)"]:::integration
    end

    %% Infrastructure & Deployments
    subgraph "Infrastructure & Deployments"
        K8s["Kubernetes & Docker (Infra)"]:::infra
    end

    %% Client to Backend connections (REST API)
    Mobile -->|"HTTP"| Auth
    Mobile -->|"HTTP"| EC
    Mobile -->|"HTTP"| EQ
    Mobile -->|"HTTP"| Game

    Web -->|"HTTP"| Auth
    Web -->|"HTTP"| EC
    Web -->|"HTTP"| EQ
    Web -->|"HTTP"| Game

    %% Inter-service communications
    Auth -->|"User_Data"| User
    EC -->|"Commands"| RabbitMQ
    EQ -->|"Queries"| RabbitMQ
    Game -->|"WebSocket"| RabbitMQ
    Notification -->|"Subscribes"| RabbitMQ

    %% Services to Databases / External integrations
    Auth -->|"Sessions"| PostgreSQL
    User -->|"User Records"| PostgreSQL
    Image -->|"Media_Management"| PostgreSQL
    EC -->|"Event_Write"| MongoDB
    EQ -->|"Event_Read"| MongoDB
    Game -->|"Cache"| Redis
    Auth -->|"Cache"| Redis
    User -->|"Cache"| Redis
    Notification -->|"Push"| Firebase
    Game -->|"Data_Store"| PostgreSQL

    %% Click Events for Component Mapping
    click Mobile "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/frontend/mobile-app"
    click Web "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/frontend/web-app"
    click Auth "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/backend/auth-service"
    click EC "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/backend/event-command-service"
    click EQ "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/backend/event-query-service"
    click Game "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/backend/game-service"
    click Image "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/backend/image-service"
    click Notification "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/backend/notification-service"
    click User "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/backend/user-service"
    click K8s "https://github.com/alexieve/marketing-real-time-games-vou/tree/main/infra"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d6d8db,stroke:#343a40,stroke-width:2px;
    classDef database fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef integration fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef infra fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
```
