# anshita-bhasin/fullstack-testing architecture

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

- Interactive diagram: https://gitdiagram.com/anshita-bhasin/fullstack-testing
- Repository: https://github.com/anshita-bhasin/fullstack-testing

## Overview

- API Testing using Cypress (located in the API folder)
- Web Testing using Playwright (located in the Web folder)
- Performance Testing using k6 (located in the Performance folder)
Additionally, the project uses GitHub Actions (under the .github/workflows directory) to automate CICD processes.

##### Main Components
a. API Testing Module:
– Represent the API folder, which contains Cypress configuration (cypress.config.js), tests (e2e, fixtures, support), and package management files.
b. Web Testing Module:
– Represent the Web folder with its Playwright configuration (playwright.config.ts) and test scripts (both in tests and tests-examples).
c. Performance Testing Module:
– Represent the Performance folder, which includes the k6 performance-test script.
d. CICD Pipeline:
– Represent the GitHub Actions configuration located under .github/workflows, highlighting how all tests are triggered automatically.
e. (Optional) Shared/Utility Components:
– If any shared configurations or integration components exist (for example, common scripts, or environment setups), they should be indicated, although from the file tree it appears each testing module is independent.

##### Relationships and Interactions
a. Each testing module (API, Web, and Performance) functions as a separate test suite that targets different aspects of the full-stack application.
b. The CICD component (GitHub Actions) centrally triggers or coordinates when tests are run, ensuring that all three testing suites execute either sequentially or in parallel.
– GitHub Actions trigger API tests, Web tests, and Performance tests.
– Each test suite produces output (results, logs) that may be consumed for reporting and further automation.
– Optionally, if tests are reporting metrics to a central dashboard or result aggregator, include that data flow.

##### Architectural Patterns and Design Principles
a. Separation of Concerns: Each type of test (API, Web, Performance) is isolated in its own module with dedicated configurations.
b. Modularity and Reusability: By using industry-standard testing tools (Cypress, Playwright, and k6), it becomes easier to scale or replace components.
c. Automation & Integration: The GitHub Actions workflow emphasizes CICD automation.
d. Environment-Specific Configurations: Although not deeply shown, the inclusion of config files (like cypress.config.js and playwright.config.ts) is instrumental in managing environment-specific details.

##### Final Checklist for the Principal Software Engineer
– Ensure all components have clear labels (e.g., “API Testing (Cypress)”, “Web Testing (Playwright)”, “Performance Testing (k6)”, “CICD (GitHub Actions)”).
– Include notes or annotations on how configuration files and environments support each module.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Title
    Title["Full Stack Testing Architecture"]:::title

    %% CICD Component
    CICD["CICD (GitHub Actions)"]:::cicd

    %% API Testing Module (Cypress)
    subgraph "API Testing Module (Cypress)"
        API_Config["Cypress Config (cypress.config.js)"]:::api
        API_e2e["Test Suite: e2e"]:::api
        API_Fixtures["Test Suite: Fixtures"]:::api
        API_Support["Test Suite: Support"]:::api
    end

    %% Web Testing Module (Playwright)
    subgraph "Web Testing Module (Playwright)"
        Web_Config["Playwright Config (playwright.config.ts)"]:::web
        Web_Tests["Test Scripts: Tests"]:::web
        Web_Examples["Test Scripts: Tests-Examples"]:::web
    end

    %% Performance Testing Module (k6)
    subgraph "Performance Testing Module (k6)"
        Performance_Script["Performance Test Script (performance-test.js)"]:::performance
    end

    %% Connections from CICD to testing modules
    CICD -->|"triggers"| API_Config
    CICD -->|"triggers"| Web_Config
    CICD -->|"triggers"| Performance_Script

    %% Internal connections within API Testing Module
    API_Config -->|"configures"| API_e2e
    API_Config -->|"configures"| API_Fixtures
    API_Config -->|"configures"| API_Support

    %% Internal connections within Web Testing Module
    Web_Config -->|"configures"| Web_Tests
    Web_Config -->|"configures"| Web_Examples

    %% Click Events
    click CICD "https://github.com/anshita-bhasin/fullstack-testing/blob/main/.github/workflows/All_In_One_Test.yml"
    click API_Config "https://github.com/anshita-bhasin/fullstack-testing/blob/main/API/cypress.config.js"
    click API_e2e "https://github.com/anshita-bhasin/fullstack-testing/tree/main/API/cypress/e2e"
    click API_Fixtures "https://github.com/anshita-bhasin/fullstack-testing/tree/main/API/cypress/fixtures"
    click API_Support "https://github.com/anshita-bhasin/fullstack-testing/tree/main/API/cypress/support"
    click Web_Config "https://github.com/anshita-bhasin/fullstack-testing/blob/main/Web/playwright.config.ts"
    click Web_Tests "https://github.com/anshita-bhasin/fullstack-testing/tree/main/Web/tests"
    click Web_Examples "https://github.com/anshita-bhasin/fullstack-testing/tree/main/Web/tests-examples"
    click Performance_Script "https://github.com/anshita-bhasin/fullstack-testing/blob/main/Performance/performance-test.js"

    %% Styles
    classDef cicd fill:#FFFFE0,stroke:#333,stroke-width:2px;
    classDef api fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef web fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef performance fill:#F08080,stroke:#333,stroke-width:2px;
    classDef title fill:#D3D3D3,stroke:#333,stroke-width:2px,stroke-dasharray: 3 3;
    
    %% Position title at the top
    Title --- CICD
```
