# droffilc1/devops-stage-4 architecture

> Architecture diagram of the GitHub repository droffilc1/devops-stage-4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/droffilc1/devops-stage-4
- Repository: https://github.com/droffilc1/devops-stage-4

## Overview

##### Project type and purpose
- This is a microservice-based full-stack TODO application with user authentication.
- The root README describes five major components—Frontend (VueJS), Auth API (Go), TODOs API (NodeJS), Users API (Spring Boot/Java), and Log Message Processor (Python)—all wired together via Docker Compose.

##### File structure
- Top-level:
- docker-compose.yaml – orchestrates containers
- .env – environment variables (credentials, endpoints)
- frontend/ – VueJS single-page app
- auth-api/ – Go service issuing JWTs
- todos-api/ – NodeJS service for todo CRUD + Redis logging
- users-api/ – Spring Boot service exposing user profiles
- log-message-processor/ – Python worker reading from Redis
- Each service has its own Dockerfile and language-specific config (go.mod, pom.xml, package.json, requirements.txt).
- No shared code; services communicate over HTTP/REST and a Redis queue.

##### Extract insights from the README
- The README explicitly calls this “an example of microservice.”
- It outlines data flows:
- Frontend ↔ Auth API (login, JWT)
- Frontend ↔ Users API (fetch profiles)
- Frontend ↔ TODOs API (CRUD todos)
- TODOs API → Redis (queue “create”/“delete” events)
- Log Processor ← Redis (dequeues and logs to stdout)

##### Essential details
- Five services and their communication channels
- JWT token flow as the security backbone
- Redis-based logging pipeline
- Which services persist data and which rely on in-memory or runtime state

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and Frontend
    User((User))
    Browser["Browser"]:::frontend
    Frontend["Frontend (VueJS SPA)"]:::frontend

    User --> Browser
    Browser --> Frontend

    %% Backend Cluster
    subgraph "Backend Cluster"
        direction TB
        %% Microservices
        subgraph "Microservices"
            direction TB
            AuthAPI["Auth API (Go)"]:::service
            UsersAPI["Users API (Spring Boot)"]:::service
            TodosAPI["TODOs API (NodeJS)"]:::service
            LogProcessor["Log Message Processor (Python)"]:::service
        end

        %% Infrastructure
        subgraph "Infrastructure"
            direction TB
            Redis["Redis (Message Queue)"]:::infra
            UsersDB["Users DB (Relational)"]:::db
        end
    end

    %% Service Interactions
    Frontend -->|"POST /login"| AuthAPI
    AuthAPI -->|"JWT Token"| Frontend

    Frontend -->|"GET /profiles"| UsersAPI
    UsersAPI -->|"SELECT user(s)"| UsersDB

    Frontend -->|"GET/POST /todos"| TodosAPI
    TodosAPI -->|"LPUSH event"| Redis

    Redis -->|"BRPOP event"| LogProcessor

    %% Docker Compose Orchestration
    DockerCompose["Docker Compose"]:::infra
    DockerCompose --> AuthAPI
    DockerCompose --> UsersAPI
    DockerCompose --> TodosAPI
    DockerCompose --> LogProcessor
    DockerCompose --> Redis

    %% Click Events
    click Frontend "https://github.com/droffilc1/devops-stage-4/tree/main/frontend/"
    click AuthAPI "https://github.com/droffilc1/devops-stage-4/tree/main/auth-api/"
    click TodosAPI "https://github.com/droffilc1/devops-stage-4/tree/main/todos-api/"
    click UsersAPI "https://github.com/droffilc1/devops-stage-4/tree/main/users-api/"
    click LogProcessor "https://github.com/droffilc1/devops-stage-4/tree/main/log-message-processor/"
    click DockerCompose "https://github.com/droffilc1/devops-stage-4/blob/main/docker-compose.yaml"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#000,stroke-width:1px
    classDef service fill:#DFFFD0,stroke:#000,stroke-width:1px
    classDef infra fill:#FFE6B3,stroke:#000,stroke-width:1px
    classDef db fill:#DDDDDD,stroke:#000,stroke-width:1px
```
