# lolawin3/lolawin_github_actions_practice architecture

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

- Interactive diagram: https://gitdiagram.com/lolawin3/lolawin_github_actions_practice
- Repository: https://github.com/lolawin3/lolawin_github_actions_practice

## Overview

- GitHub Actions Automation: Represent the central hub of CI/CD automation.
- A module for “Workflow Configurations” (all files under .github/workflows).
- “Reusable Custom Actions” (e.g., the custom actions in solar-system/.github/custom-actions).
- Optionally, note the “Notes/Documentation” component (the kode-kloud-notes folder with PDFs) that supports best practices and guidance.
- Solar-System Application: This is the core full-stack application.
- Frontend: Mark the HTML files (index.html, images) that provide the user interface.
- Backend: Identify the NodeJS components (app.js, app-controller.js, app-test.js) and associated package files (package.json, package-lock.json).
- Database: Although not many specifics are exposed for MongoDB in the file tree, annotate the assumption of MongoDB integration (as mentioned in the README) for storing/displaying planetary data.
- Containerization & Orchestration: Highlight infrastructure for deployment.
- Docker: Include the Dockerfile (in the solar-system folder) as part of the build pipeline.
- Kubernetes: Split the Kubernetes folder into separate nodes for “development” and “production”. Each should have its own set of deployment, service, and ingress configurations.

##### Relationships and Data Flow
- For the Kubernetes component, highlight the flow from the Docker container to the deployment on a cluster, separating the development and production configurations.
- (likely) request flow: a client’s request hits the front-end (static HTML + assets), which then calls back-end APIs (managed by NodeJS processes), with eventual read/write operations to the MongoDB database.

##### Architectural Patterns
- Full-Stack Separation: Clearly delineate a separation between the frontend and backend components along with the role of Docker and Kubernetes in managing environments.
- DevOps Best Practices: Note that GitHub Actions is used to enforce testing, continuous integration, and continuous delivery/deployment practices.

- Within the DevOps section, map out how different GitHub Actions workflows (stored in .github/workflows) are triggered and what modules they interact with (such as code testing and deployment).
- For the application section, create layers: a presentation layer (index.html, images), an application logic layer (app.js, app-controller.js), and an infrastructure layer (Dockerfile and Kubernetes manifests).

This detailed yet clear breakdown will aid in communicating the architecture to team members and stakeholders, ensuring that every critical component and its interactions are represented accurately.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% DevOps Automation Section
    subgraph "DevOps Automation (GitHub Actions)"
        A1[".github/workflows"]
        A2["solar-system/.github/workflows"]
        subgraph "Reusable Custom Actions"
            A3["solar-system/.github/custom-actions"]
        end
        A4["kode-kloud-notes"]
    end

    %% Solar-System Application Section
    subgraph "Solar-System Application"
        subgraph "Frontend Layer"
            FE1["solar-system/index.html"]
            FE2["solar-system/images"]
        end
        subgraph "Backend Layer"
            BE1["solar-system/app.js"]
            BE2["solar-system/app-controller.js"]
            BE3["solar-system/app-test.js"]
            BE4["solar-system/package.json"]
            BE5["solar-system/package-lock.json"]
        end
        DB["MongoDB Database"]
        subgraph "Containerization & Orchestration"
            D1["Dockerfile"]
            subgraph "Kubernetes"
                KDEV["Development Configurations"]
                KPROD["Production Configurations"]
            end
        end
    end

    %% Connections for DevOps Workflow
    A3 -->|"customizes"| A1
    A4 -->|"guides"| A1
    A1 -->|"triggers"| BE3
    A2 -->|"triggers"| BE3
    A1 -->|"CI-build"| D1
    BE3 -->|"testsPass"| D1

    %% Connections within the Solar-System Application
    FE1 -->|"calls"| BE1
    BE1 -->|"accesses"| DB
    BE1 -->|"supports"| BE3

    %% Deployment pathway
    D1 -->|"deploys"| KDEV
    D1 -->|"deploys"| KPROD

    %% Styling
    classDef devops fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef app fill:#A3E4D7,stroke:#145A32,stroke-width:2px;
    classDef docker fill:#F9E79F,stroke:#7D6608,stroke-width:2px;
    classDef k8s fill:#F5CBA7,stroke:#7D6608,stroke-width:2px;
    classDef db fill:#D2B4DE,stroke:#512E5F,stroke-width:2px;

    class A1,A2,A3,A4 devops;
    class FE1,FE2,BE1,BE2,BE3,BE4,BE5 app;
    class D1 docker;
    class KDEV,KPROD k8s;
    class DB db;

    %% Click Events
    click A1 "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/.github/workflows"
    click A2 "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/solar-system/.github/workflows"
    click A3 "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/solar-system/.github/custom-actions"
    click A4 "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/kode-kloud-notes"
    click FE1 "https://github.com/lolawin3/lolawin_github_actions_practice/blob/main/solar-system/index.html"
    click FE2 "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/solar-system/images"
    click BE1 "https://github.com/lolawin3/lolawin_github_actions_practice/blob/main/solar-system/app.js"
    click BE2 "https://github.com/lolawin3/lolawin_github_actions_practice/blob/main/solar-system/app-controller.js"
    click BE3 "https://github.com/lolawin3/lolawin_github_actions_practice/blob/main/solar-system/app-test.js"
    click BE4 "https://github.com/lolawin3/lolawin_github_actions_practice/blob/main/solar-system/package.json"
    click BE5 "https://github.com/lolawin3/lolawin_github_actions_practice/blob/main/solar-system/package-lock.json"
    click D1 "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/solar-system/Dockerfile"
    click KDEV "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/solar-system/kubernetes/development"
    click KPROD "https://github.com/lolawin3/lolawin_github_actions_practice/tree/main/solar-system/kubernetes/production"
```
