# itsaaryan/skillset-verified architecture

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

- Interactive diagram: https://gitdiagram.com/itsaaryan/skillset-verified
- Repository: https://github.com/itsaaryan/skillset-verified

## Overview

##### Main Components
- Frontend (React Application):
- User interface built using React (the “src/” folder contains pages, components, and asset files).
- The components include specialized views for Admin, Employee, and Organization Endorser roles; chat features; QR scanning; and analytics (charts and graphs).
- Integration with MetaMask for login/authentication.
- Blockchain Layer (Smart Contracts and Migrations):
- Smart contracts deployed on the Ethereum network (files in “src/abis” such as Admin.json, Employee.json, OrganizationEndorser.json, and others).
- Migration scripts (in the “migrations” folder) and the Truffle configuration (truffle-config.js) that manage contract deployment.
- Firebase & External API Services:
- Firebase as a backend service (see “src/firebase/firebase.js” and “src/firebase/api.js”) likely used for the chat system and real-time notifications.
- Mention external API calls (such as retrieving Codeforces, HackerEarth, or other coding platform ratings) for displaying platform ratings.
- CI/CD and Deployment:
- Integration with GitHub workflows (under “.github/workflows”) and deployment onto Azure Static Web Apps.
- Mention configuration files that support the build and deployment process (like package.json, web.config, etc.).

##### Relationships and Interactions
- The Blockchain Layer for executing smart contract functions via MetaMask.
- Firebase/external APIs for chat messages, notifications, and rating integrations.
- That the Blockchain layer (smart contracts) controls the core business logic for skill endorsements, certifications, and role management.
- That user interactions (e.g., sending a chat, requesting endorsements, generating/reading QR codes) involve communication flows between the UI, blockchain operations, and Firebase.

##### Architectural Patterns and Design Principles
- Separation of concerns: Clearly distinguish the presentation layer (React components/pages) from the decentralized business logic (smart contracts) and the backend services (Firebase & external API integrations).
- DApp Integration: Show the MetaMask and blockchain connection as a dedicated interface, ensuring that the end-user’s interactions are secure and verified.
- Use of CI/CD: Emphasize automation in deployments to Azure using GitHub workflows, which streamlines development and ensures consistency.

##### Relevant Technologies, Frameworks, and Libraries
- React.js for the UI.
- MetaMask for decentralized authentication.
- Ethereum smart contracts (with Truffle for deployment and migration).
- Firebase for real-time functionality like chat and notifications.
- External API integrations for verifying platform-based ratings.
- Azure Static Web Apps for hosting.
- Additionally, mention utility libraries (e.g., for QR scanning or charting) where relevant.

- It should illustrate the secure login via MetaMask that then routes transactions to smart contracts on the blockchain.
- Additionally, show the support for notifications and chat being powered by Firebase along with external API integrations for rating validations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        A1["React UI (Admin, Employee, Org Endorser)"]:::frontend
        A2["MetaMask Integration"]:::frontend
    end

    %% Blockchain Layer
    subgraph "Blockchain Layer"
        B1["Smart Contracts (Ethereum)"]:::blockchain
        B2["Migration Scripts"]:::blockchain
        B3["Truffle Configuration"]:::blockchain
    end

    %% Backend Services
    subgraph "Backend Services"
        C1["Firebase (Chat/Notifications)"]:::backend
        C2["External APIs (Ratings)"]:::backend
    end

    %% CI/CD & Deployment
    subgraph "CI/CD & Deployment"
        D1["GitHub Workflows"]:::cicd
        D2["Deployment Config (package.json)"]:::cicd
        D4["Web Config"]:::cicd
        D3["Azure Static Web Apps"]:::cicd
    end

    %% Data Flow Connections
    A1 -->|"MetaMaskAuth"| A2
    A2 -->|"SmartContractCalls"| B1
    A1 -->|"Chat/Notifications"| C1
    A1 -->|"RatingsIntegration"| C2

    %% Blockchain Internal Connections
    B2 -->|"Deploys"| B1
    B3 -->|"Configures"| B1

    %% CI/CD Connections
    D1 -->|"Triggers"| D2
    D2 -->|"Includes"| D4
    D3 -->|"Hosts"| A1

    %% Styling Classes
    classDef frontend fill:#a2d5f2,stroke:#1b4965,stroke-width:2px;
    classDef blockchain fill:#b8e0d2,stroke:#116530,stroke-width:2px;
    classDef backend fill:#fff3b0,stroke:#aa6f39,stroke-width:2px;
    classDef cicd fill:#f7c8a7,stroke:#a23e48,stroke-width:2px;

    %% Click Events
    click A1 "https://github.com/itsaaryan/skillset-verified/tree/main/src/"
    click A2 "https://github.com/itsaaryan/skillset-verified/blob/main/src/MetaMaskGuide.js"
    click B1 "https://github.com/itsaaryan/skillset-verified/tree/main/src/abis"
    click B2 "https://github.com/itsaaryan/skillset-verified/tree/main/migrations/"
    click B3 "https://github.com/itsaaryan/skillset-verified/blob/main/truffle-config.js"
    click C1 "https://github.com/itsaaryan/skillset-verified/blob/main/src/firebase/firebase.js"
    click C2 "https://github.com/itsaaryan/skillset-verified/blob/main/src/firebase/api.js"
    click D1 "https://github.com/itsaaryan/skillset-verified/tree/main/.github/workflows/"
    click D2 "https://github.com/itsaaryan/skillset-verified/blob/main/package.json"
    click D4 "https://github.com/itsaaryan/skillset-verified/blob/main/web.config"
```
