# thecoolqateam/online-inspection-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/thecoolqateam/online-inspection-tracker
- Repository: https://github.com/thecoolqateam/online-inspection-tracker

## Overview

##### Project Type and Purpose
- This project is a full-stack application built to perform automated UI inspections for web applications. The goal is to detect UI anomalies (such as page white screens and pixel deviations) and provide real‐time feedback with alert notifications via tools like DingTalk, Feishu, and WeChat.
- The README outlines features, deployment instructions, use cases, and an overall architecture that supports scheduled inspection tasks.

##### File Structure
- Notice the clear separation between the frontend and backend:
- The “online-client” directory contains a Vue3-based client (notice the presence of Vite config, App.vue, components, router, and stores). This handles the user interface, including dashboards for inspection records and data visualization.
- The “online-server” directory is a Spring Boot application written in Java, following an MVC-like structure (with controllers, services, mappers, entities, and configurations) to provide REST APIs and schedule test jobs.
- The “db” folder and Docker configurations (in the “docker” directory) indicate that a MySQL database is used, and the system is designed for containerized deployment.
- The repository also includes Dockerfiles for “mysql”, “server”, and “web”, making it clear that the system runs in containers for consistency with production deployments.

##### README for Additional Insights
- The README confirms that the frontend uses Vue3, while the backend uses Spring Boot along with testing tools like Playwright and TestNG.
- It also explains the scheduling (every 5 minutes) of the UI inspection tasks, the reporting of test results (visual and textual feedback), and supports integrations to messaging platforms for alerts.
- There are detailed deployment steps for local installation and Docker-based deployment, emphasizing distinct responsibilities across client, server, and database.

a. Main Components:
- Frontend (online-client): Vue3 application that provides the UI (inspection dashboards, test case management, data visualizations).
- Backend (online-server): Spring Boot application that exposes APIs, handles business logic, processes scheduled inspection tasks, and coordinates with test automation tools.
- Database: MySQL (setup using db/ddl.sql and containerized under docker/mysql) to persist test case information, test results, and configurations.
- Docker Containers: Three containerized services are evident from the “docker” directory — one each for the frontend web server, backend server (with the onlineInspect.jar), and the MySQL database.

b. Relationships and Interactions:
- The Vue3 frontend makes REST API calls to the Spring Boot backend.
- The backend communicates with the MySQL database for CRUD operations.
- The backend also integrates with third-party notification services, as indicated by utilities like DingUtil, FeishuUtil, and WechatUtil, to alert users about inspection results.
- Scheduled inspection tasks (triggered within the backend using jobs like TriggerUrlJob) may call Playwright for automated UI tests and interact with external sites (inspection targets).

c. Architectural Patterns and Design Principles:
- Separation of Concerns: The frontend and backend are completely decoupled.
- Containerization: Docker is used for consistent deployment across environments.
- MVC Structure: The backend’s directory structure (controllers, services, mappers, entities) points to an MVC pattern.
- Automated Scheduling and Real-time Feedback: The backend runs periodic inspection tasks and updates a UI dashboard on the frontend.

d. Relevant Technologies:
- Technologies such as Vue3, Vite, and related tooling for the frontend.
- Spring Boot, Java, Maven, MyBatis, TestNG, and Playwright in the backend.
- MySQL for data persistence.
- Docker for container orchestration, including separate Dockerfiles for each major component.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FC["Online Client (Vue3)"]:::frontend
        API["API & Data Communication"]:::api
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["Backend Service (Spring Boot)"]:::backend
        subgraph "Backend Components"
            CT["MVC Controllers"]:::backend
            JOB["Scheduled Inspection Tasks"]:::job
            subgraph "Notification Services"
                DING["DingTalk"]:::notif
                FEIS["Feishu"]:::notif
                WECHAT["WeChat"]:::notif
            end
            subgraph "Data Persistence"
                MAPP["MyBatis Mappers"]:::database
                RES["Mapping Resources"]:::database
            end
        end
    end

    %% Database Layer
    subgraph "Database Layer"
        DB["MySQL Database"]:::database
    end

    %% Docker Containers
    subgraph "Docker Containers"
        WEB["Web Container"]:::docker
        SERV["Server Container"]:::docker
        MYSQL["MySQL Container"]:::docker
    end

    %% Connections between Frontend and Backend
    FC -->|"REST_API"| API
    API -->|"calls"| BE

    %% Backend internal connections
    BE -->|"routes"| CT
    BE -->|"triggers"| JOB
    BE -->|"sends_alerts_to"| DING
    BE -->|"sends_alerts_to"| FEIS
    BE -->|"sends_alerts_to"| WECHAT
    CT -->|"CRUD"| MAPP
    CT -->|"CRUD"| RES
    MAPP -->|"access"| DB
    RES -->|"access"| DB

    %% Docker Containerization links
    WEB -->|"contains"| FC
    WEB -->|"contains"| API
    SERV -->|"contains"| BE
    MYSQL -->|"contains"| DB

    %% Click Events
    click FC "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/online-client/"
    click API "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/online-client/src/api/"
    click BE "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/online-server/"
    click CT "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/online-server/src/main/java/com/onlines/controller/"
    click JOB "https://github.com/thecoolqateam/online-inspection-tracker/blob/main/online-server/src/main/java/com/onlines/job/TriggerUrlJob.java"
    click DING "https://github.com/thecoolqateam/online-inspection-tracker/blob/main/online-server/src/main/java/com/onlines/utils/DingUtil.java"
    click FEIS "https://github.com/thecoolqateam/online-inspection-tracker/blob/main/online-server/src/main/java/com/onlines/utils/FeishuUtil.java"
    click WECHAT "https://github.com/thecoolqateam/online-inspection-tracker/blob/main/online-server/src/main/java/com/onlines/utils/WechatUtil.java"
    click MAPP "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/online-server/src/main/java/com/onlines/mapper/"
    click RES "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/online-server/src/main/resources/mapping/"
    click DB "https://github.com/thecoolqateam/online-inspection-tracker/blob/main/db/ddl.sql"
    click WEB "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/docker/web"
    click SERV "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/docker/server"
    click MYSQL "https://github.com/thecoolqateam/online-inspection-tracker/tree/main/docker/mysql/"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef api fill:#E0FFFF,stroke:#000,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef job fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef notif fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef database fill:#FAD7A0,stroke:#000,stroke-width:2px;
    classDef docker fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
