# zinct/jobpilot architecture

> Architecture diagram of the GitHub repository zinct/jobpilot, 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/zinct/jobpilot
- Repository: https://github.com/zinct/jobpilot

## Overview

##### Main Components
- Frontend Client – Found primarily in the src/hirex_frontend directory. This includes the UI components, pages (such as login, registration, resume builder, job recommendations, dashboard, and more), and utility functions. It is built with modern JavaScript tooling (Vite, Tailwind, ESLint) and follows a component-based architecture typical of React applications.
- On-Chain Backend – Located under src/hirex_backend with a main.mo file. This is written in Motoko for the Internet Computer and handles core on-chain services such as the AI-powered resume builder, resume analysis, and AI career assistance. It interacts with blockchain-based storage and authentication mechanisms (like Internet Identity).
- Jobs Recommendation Microservice – Located in the jobs_recommendation folder, it includes app.py, a Dockerfile, and build scripts. This service is responsible for processing job recommendations using HTTP outcalls and interfacing with external data sources. It represents a complementary backend component that supports the career recommendation feature.
- Infrastructure & Deployment – Files such as dfx.json, mops.toml, and package.json indicate configuration for deployment on the Internet Computer using DFX, project build setups, and dependency management. The assets directory and playground.sh provide visual/operational components and deployment scripts for local or playground environments.

##### Mapping the Relationships and Data Flow
- Frontend ↔ Jobs Recommendation Service: For personalized job recommendations, the frontend interacts with the jobs recommendation microservice using HTTP outcalls. Highlight that even though this service is off-chain, it provides critical real-time matching data.
- External Services: Optionally indicate any external API calls that the jobs recommendation service might perform using HTTP outcalls. This can be represented by an “External Data Sources” component linked back to the microservice.
- Deployment/Configuration: Illustrate that the entire system is deployed on the Internet Computer (using dfx.json) and leverages blockchain features for secure data storage and authentication (Internet Identity integration).

##### Architectural Patterns & Design Details
- Separation of Concerns: Clearly segregate the UI (frontend), business logic and on-chain operations (backend in Motoko), and external integrations (Python-based jobs recommendation service). This separation is crucial because each component deals with different aspects of the decentralized and AI-driven workflow.
- Modular Design: Within the frontend, note that there are multiple feature directories (auth, chatbot, course, cv, dashboard, job, main, profile) that hint at a modular and scalable React-based architecture.
- On-Chain vs. Off-Chain: Emphasize the use of blockchain to secure sensitive operations (resume analysis, career advice) while still leveraging traditional services (HTTP outcalls for job matching).

- Labels and annotations clarifying architectural patterns (e.g., microservices for the recommendation system, component-based architecture for the frontend).
- A separation of layers that emphasizes security and data flow from the user interface through to the transparent on-chain backend operations.
- Notes on integration points like Internet Identity and HTTP outcalls for job recommendations.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Infrastructure & Deployment
    subgraph "Infrastructure & Deployment"
        DFX["DFX Config (dfx.json)"]:::infrastructure
        MOPS["MOPS Config (mops.toml)"]:::infrastructure
        PKG["Package Config (package.json)"]:::infrastructure
        PG["Playground Script (playground.sh)"]:::infrastructure
        ASSETS["Assets Directory"]:::infrastructure
    end

    %% Frontend Layer
    subgraph "Frontend Layer"
        FC["Frontend Client (React/Vite)"]:::frontend
        FCFeat["Frontend Features (Modular UI)"]:::frontend
    end

    %% Backend Layer (On-Chain)
    subgraph "Backend Layer"
        OB["On-Chain Backend (Motoko on Internet Computer)"]:::backend
    end

    %% Jobs Recommendation Service
    subgraph "Jobs Recommendation Service (Python/Docker)"
        JApp["Service App (app.py)"]:::microservice
        JDocker["Dockerfile"]:::microservice
        JBuild["Build Script (build.sh)"]:::microservice
        JReq["Requirements (requirements.txt)"]:::microservice
        JApp --- JDocker
        JDocker --- JBuild
        JBuild --- JReq
    end

    %% External Data Sources
    Ext["External Data Sources"]:::external

    %% Inter-component Communication
    FC -->|"RPC_on-chain"| OB
    FC -->|"HTTP_outcall"| JApp
    JApp -->|"HTTP_call"| Ext

    %% Deployment/Configuration relationships (dotted lines)
    DFX ---|"deploys"| OB
    DFX ---|"deploys"| JApp
    MOPS ---|"configures"| OB
    PKG ---|"manages"| FC
    PG ---|"runs"| FC
    ASSETS ---|"provides"| FC

    %% Styling Definitions
    classDef frontend fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef backend fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef microservice fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef infrastructure fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#922B21,stroke-width:2px;

    %% Click Events for Frontend
    click FC "https://github.com/zinct/jobpilot/tree/main/src/hirex_frontend"
    click FCFeat "https://github.com/zinct/jobpilot/tree/main/src/hirex_frontend/src/features"

    %% Click Event for On-Chain Backend
    click OB "https://github.com/zinct/jobpilot/blob/main/src/hirex_backend/main.mo"

    %% Click Events for Jobs Recommendation Service
    click JApp "https://github.com/zinct/jobpilot/blob/main/jobs_recommendation/app.py"
    click JDocker "https://github.com/zinct/jobpilot/tree/main/jobs_recommendation/Dockerfile"
    click JBuild "https://github.com/zinct/jobpilot/blob/main/jobs_recommendation/build.sh"
    click JReq "https://github.com/zinct/jobpilot/blob/main/jobs_recommendation/requirements.txt"

    %% Click Events for Infrastructure & Deployment
    click DFX "https://github.com/zinct/jobpilot/blob/main/dfx.json"
    click MOPS "https://github.com/zinct/jobpilot/blob/main/mops.toml"
    click PKG "https://github.com/zinct/jobpilot/blob/main/package.json"
    click PG "https://github.com/zinct/jobpilot/blob/main/playground.sh"
    click ASSETS "https://github.com/zinct/jobpilot/tree/main/assets"
```
