# zuminhhit/jobify-be architecture

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

- Interactive diagram: https://gitdiagram.com/zuminhhit/jobify-be
- Repository: https://github.com/zuminhhit/jobify-be

## Overview

##### Project type and purpose
- This is a Laravel‐based, API‐first monolithic backend for “Jobify,” a job board service. It exposes RESTful endpoints (via Nginx → PHP-FPM → Laravel Controllers) for authentication, company management, job postings, job applications, and user profile management. It uses Docker (Laradock) to orchestrate services (MySQL, Redis, MongoDB, Elasticsearch, Kibana, etc.) and employs Domain-Driven Design (DDD) patterns to organize code into feature “Series” (CompanySeries, JobSeries, ProfileSeries, etc.).

##### File structure
- Top‐level directories:
- app/Commands (Command–Handler pattern for CQRS‐style actions)
- app/Http/Controllers (API Controllers)
- app/Services, app/Repositories, app/Entities (Service & Repository layers over Domain Entities)
- config, database (migrations & seeders), routes, resources (Swagger, Vue/JS assets), public (index.php)
- Infrastructure code: Docker compose files in laradock, Supervisor configs, Horizon/Telescope integration, queued Jobs/Observers for Elasticsearch sync.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Clients
    subgraph "Clients"
        direction TB
        WebApp["Frontend App"]:::client
        MobileApp["Mobile App"]:::client
        SwaggerUI["Swagger UI"]:::client
    end

    %% Docker Container Boundary
    subgraph "Docker Container" 
        direction TB
        NGINX["Nginx Reverse Proxy"]:::gateway
        PHPFPM["PHP-FPM"]:::service
        LaravelBootstrap["Laravel Bootstrap"]:::service
    end

    %% Laravel Application Layers
    subgraph "Laravel Application" 
        direction TB
        Routes["API Routes"]:::routes
        Controllers["HTTP Controllers"]:::controller
        Requests["HTTP Requests Validation"]:::validation
        Resources["HTTP Resources / DTOs"]:::dto
        Commands["Domain Commands & Handlers"]:::command
        Services["Service Layer"]:::service
        Repositories["Repository Layer"]:::repository
        Entities["Domain Entities"]:::entity
        DTOs["Data Transfer Objects"]:::dtoModel
        Observers["Model Observers"]:::observer
        Jobs["Queued Jobs & ES Sync"]:::job
        ConsoleCmd["Console Commands & Scheduler"]:::console
    end

    %% Infrastructure & Data Stores
    subgraph "Infrastructure & Data Stores"
        direction TB
        MySQL["MySQL"]:::db
        Redis["Redis (Cache & Queue)"]:::cache
        MongoDB["MongoDB"]:::nosql
        ES["Elasticsearch"]:::search
        Scheduler["Cron Scheduler"]:::scheduler
        Supervisor["Supervisor / Horizon"]:::worker
    end

    %% Monitoring & External Services
    subgraph "Monitoring & External Services"
        direction TB
        Mail["Mail / SMTP"]:::external
        Storage["File Storage (Local/S3)"]:::external
        Broadcasting["Real-time Broadcasting"]:::external
        Telescope["Telescope"]:::monitor
        HorizonUI["Horizon Dashboard"]:::monitor
        Kibana["Kibana Logs"]:::monitor
    end

    %% Client to Gateway
    WebApp -->|API Request| NGINX
    MobileApp -->|API Request| NGINX
    SwaggerUI -->|API Docs| NGINX

    %% Gateway to App
    NGINX --> PHPFPM
    PHPFPM --> LaravelBootstrap
    LaravelBootstrap --> Routes

    %% Request flow inside Laravel
    Routes --> Controllers
    Controllers --> Requests
    Controllers --> Resources
    Controllers --> Commands
    Commands --> Services
    Services --> Repositories
    Repositories --> Entities
    Entities --> DTOs

    %% Observers and Jobs
    Entities --> Observers
    Observers --> Jobs
    Jobs -->|ES Sync| ES
    Jobs -->|Notifications| Mail

    %% Console Scheduler
    Scheduler --> ConsoleCmd
    ConsoleCmd --> Jobs
    ConsoleCmd -->|Batch Sync| ES

    %% Workers
    Redis --> Supervisor
    Supervisor --> Jobs

    %% Data Stores connections
    Repositories --> MySQL
    Repositories --> Redis
    Repositories --> MongoDB

    %% Monitoring
    Supervisor --> HorizonUI
    LaravelBootstrap --> Telescope
    ES --> Kibana

    %% External services
    Services --> Storage
    Services --> Broadcasting

    %% Click events
    click NGINX "https://github.com/zuminhhit/jobify-be/blob/develop/public/.htaccess"
    click LaravelBootstrap "https://github.com/zuminhhit/jobify-be/blob/develop/bootstrap/app.php"
    click Controllers "https://github.com/zuminhhit/jobify-be/tree/develop/app/Http/Controllers/API"
    click Commands "https://github.com/zuminhhit/jobify-be/tree/develop/app/Commands"
    click Services "https://github.com/zuminhhit/jobify-be/tree/develop/app/Services"
    click Repositories "https://github.com/zuminhhit/jobify-be/tree/develop/app/Repositories"
    click Entities "https://github.com/zuminhhit/jobify-be/tree/develop/app/Entities"
    click DTOs "https://github.com/zuminhhit/jobify-be/tree/develop/app/DataTransferObjects"
    click Requests "https://github.com/zuminhhit/jobify-be/tree/develop/app/Http/Requests"
    click Resources "https://github.com/zuminhhit/jobify-be/tree/develop/app/Http/Resources"
    click Routes "https://github.com/zuminhhit/jobify-be/blob/develop/routes/api.php"
    click Jobs "https://github.com/zuminhhit/jobify-be/tree/develop/app/Jobs/Searchable"
    click Observers "https://github.com/zuminhhit/jobify-be/tree/develop/app/Observers"
    click ConsoleCmd "https://github.com/zuminhhit/jobify-be/tree/develop/app/Console/Commands"
    click Supervisor "https://github.com/zuminhhit/jobify-be/blob/develop/config/horizon.php"
    click Redis "https://github.com/zuminhhit/jobify-be/blob/develop/config/cache.php"
    click MySQL "https://github.com/zuminhhit/jobify-be/blob/develop/config/database.php"
    click ES "https://github.com/zuminhhit/jobify-be/blob/develop/config/elastic.client.php"
    click MongoDB "https://github.com/zuminhhit/jobify-be/blob/develop/config/database.php"
    click Mail "https://github.com/zuminhhit/jobify-be/tree/develop/app/Mail"
    click Storage "https://github.com/zuminhhit/jobify-be/blob/develop/config/filesystems.php"
    click Broadcasting "https://github.com/zuminhhit/jobify-be/blob/develop/resources/js/echo.js"
    click HorizonUI "https://github.com/zuminhhit/jobify-be/blob/develop/app/Providers/HorizonServiceProvider.php"
    click Telescope "https://github.com/zuminhhit/jobify-be/blob/develop/app/Providers/TelescopeServiceProvider.php"

    %% Styles
    classDef client fill:#DDEEFF,stroke:#333,stroke-width:1px;
    classDef gateway fill:#FFE0B2,stroke:#333,stroke-width:1px;
    classDef service fill:#E8F5E9,stroke:#333,stroke-width:1px;
    classDef controller fill:#FFF3E0,stroke:#333,stroke-width:1px;
    classDef validation fill:#F3E5F5,stroke:#333,stroke-width:1px;
    classDef dto fill:#E1F5FE,stroke:#333,stroke-width:1px;
    classDef command fill:#FFEBEE,stroke:#333,stroke-width:1px;
    classDef repository fill:#E0F7FA,stroke:#333,stroke-width:1px;
    classDef entity fill:#F1F8E9,stroke:#333,stroke-width:1px;
    classDef dtoModel fill:#E3F2FD,stroke:#333,stroke-width:1px;
    classDef observer fill:#FFF8E1,stroke:#333,stroke-width:1px;
    classDef job fill:#FBE9E7,stroke:#333,stroke-width:1px;
    classDef console fill:#ECEFF1,stroke:#333,stroke-width:1px;
    classDef db fill:#B2DFDB,stroke:#333,stroke-width:1px;
    classDef cache fill:#FFE082,stroke:#333,stroke-width:1px;
    classDef nosql fill:#D1C4E9,stroke:#333,stroke-width:1px;
    classDef search fill:#FFCCBC,stroke:#333,stroke-width:1px;
    classDef scheduler fill:#F0F4C3,stroke:#333,stroke-width:1px;
    classDef worker fill:#DCEDC8,stroke:#333,stroke-width:1px;
    classDef external fill:#CFD8DC,stroke:#333,stroke-width:1px;
    classDef monitor fill:#F5F5F5,stroke:#333,stroke-width:1px;
```
