# kiranmahanthesh/naukriprofileautomation architecture

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

- Interactive diagram: https://gitdiagram.com/kiranmahanthesh/naukriprofileautomation
- Repository: https://github.com/kiranmahanthesh/naukriprofileautomation

## Overview

##### Project type and purpose
- This is a **test‐automation pipeline** for **updating a Naukri profile**. It uses **Cypress** (with Cucumber BDD) for end‑to‑end testing and **Jenkins** for CI/CD. The pipeline can be triggered manually or via cron.

##### File structure
- Top‐level files:
- `Jenkinsfile` defines the CI steps.
- `.github/workflows/cypress.yml` shows GitHub Actions CI as an alternative.
- `cypress.config.js` configures Cypress.
- `cypress/` directory:
- `e2e/*.feature` – Cucumber feature files (BDD).
- `fixtures/` – test data (PDF, credentials).
- `support/commands.js`, `step_definitions/` – custom commands and step definitions.
- `package.json`/`package-lock.json` show NodeJS dependencies.

##### README for additional insights
- CI pipeline steps: checkout → npm install → verify Cypress → run tests → capture artifacts → archive results.
- Uses Jenkins (or GitHub Actions) and supports secure credentials via GitHub Secrets or Jenkins Credentials Manager.
- Future plans include cloud execution and notifications.

a. Main components
1. **Source Control**: GitHub repository
2. **CI/CD Server**: Jenkins (or GitHub Actions)
3. **Build & Test Agent**: NodeJS environment running Cypress + Cucumber
4. **Test Runner**: Cypress binary + feature files + step definitions + fixtures
5. **External System Under Test**: Naukri web application
6. **Artifact Store**: Jenkins workspace or cloud storage (screenshots, videos)
7. **Scheduler/Trigger**: Manual trigger or cron job in Jenkins/GitHub Actions
8. **Secrets Store**: GitHub Secrets / Jenkins Credentials

b. Relationships & interactions
- Developer pushes code → triggers GitHub Action or Jenkins pipeline.
- CI server clones repo → provisions NodeJS agent → injects credentials.
- Agent installs dependencies (`npm install`).
- Agent starts Cypress tests (reads `.feature` files, step definitions).
- Cypress executes against Naukri UI over HTTP.
- On failures, Cypress captures screenshots/videos → archives to Jenkins.
- CI server publishes test report and artifacts.
- Scheduler (cron) can auto‐trigger this pipeline.

c. Architectural patterns & principles
- **Pipeline-as-Code**: Jenkinsfile / GitHub workflows.
- **BDD**: Cucumber feature files separate behavior spec from code.
- **Separation of Concerns**:
- CI orchestration (Jenkins)
- Test implementation (Cypress + Cucumber)
- Test data (fixtures)
- Environment configuration (cypress.config.js, secrets)

d. Key technologies/frameworks
- **NodeJS**: runtime for Cypress
- **Cypress** + **Cucumber** plugin: test automation framework
- **Jenkins** / **GitHub Actions**: CI/CD
- **GitHub**: source control & optionally CI trigger
- **Cron**: scheduling

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Scheduler/Triggers
    subgraph "Scheduler / Triggers"
        Manual["Manual Trigger"]:::jenkins
        Cron["Cron Trigger"]:::jenkins
        Push["GitHub Push"]:::github
    end

    %% Source Control
    Repo["GitHub Repository"]:::github

    %% CI/CD Servers
    subgraph "CI/CD Servers"
        Jenkins["Jenkins Master"]:::jenkins
        GitHubActions["GitHub Actions"]:::github
    end

    %% Build & Test Agent
    Agent["Build & Test Agent\n(Node.js)"]:::agent
    CypressConfig["Cypress Config"]:::agent

    %% Pipeline Stages
    subgraph "Pipeline Stages"
        Checkout["Checkout Code"]:::agent
        Install["npm install"]:::agent
        Inject["Inject Credentials"]:::secret
        subgraph "Test Runner"
            FR["Feature Files"]:::testrunner
            SD["Step Definitions"]:::testrunner
            CMD["Custom Commands"]:::testrunner
            SUPP["Support Bootstrap"]:::testrunner
            FIX["Fixtures"]:::testrunner
        end
        Artifacts["Archive Artifacts"]:::storage
        Reports["Publish Test Reports"]:::agent
    end

    %% External System
    NaukriUI["Naukri UI"]:::external

    %% Secrets Store
    Secrets["Secrets Store\n(GitHub Secrets / Jenkins Credentials)"]:::secret

    %% Connections
    Manual -->|trigger| Jenkins
    Cron -->|trigger| Jenkins
    Push -->|trigger| GitHubActions

    Jenkins -->|git clone| Repo
    GitHubActions -->|git clone| Repo

    Jenkins -->|provision agent| Agent
    GitHubActions -->|provision agent| Agent

    Agent --> Checkout
    Checkout --> Install
    Install --> Inject
    Inject --> FR
    FR --> SD
    SD --> CMD
    CMD --> SUPP
    SUPP --> FIX
    FIX -->|HTTP requests| NaukriUI
    FIX --> Artifacts
    Artifacts -->|store| Reports
    Reports --> Jenkins
    Reports --> GitHubActions

    Secrets --> Inject
    Repo -->|configuration| CypressConfig

    %% Click Events
    click Repo "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//.github/workflows/cypress.yml"
    click Jenkins "https://github.com/kiranmahanthesh/naukriprofileautomation/tree/main//Jenkinsfile"
    click GitHubActions "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//.github/workflows/cypress.yml"
    click Agent "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//package.json"
    click Agent "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//package-lock.json"
    click CypressConfig "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//cypress.config.js"
    click FR "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//cypress/e2e/updateProfile.feature"
    click SD "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//cypress/support/step_definitions/updateProfile.js"
    click CMD "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//cypress/support/commands.js"
    click SUPP "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//cypress/support/e2e.js"
    click FIX "https://github.com/kiranmahanthesh/naukriprofileautomation/blob/main//cypress/fixtures/credentials.json"

    %% Styles
    classDef github fill:#0075ca,stroke:#000,color:#fff
    classDef jenkins fill:#d24939,stroke:#000,color:#fff
    classDef agent fill:#6f9f6f,stroke:#000,color:#fff
    classDef testrunner fill:#2ecc71,stroke:#000,color:#fff
    classDef external fill:#95a5a6,stroke:#000,color:#000
    classDef storage fill:#f39c12,stroke:#000,color:#000
    classDef secret fill:#e67e22,stroke:#000,color:#fff
```
