# filipkrz03/joboffertsapi architecture

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

- Interactive diagram: https://gitdiagram.com/filipkrz03/joboffertsapi
- Repository: https://github.com/filipkrz03/joboffertsapi

## Overview

##### Main Components Identification
The system consists of several microservices:
- JobOfferService: Manages job offers and technologies
- UsersService: Handles user management and authentication
- WebScrapper: Scrapes job offers from various sources
- MailSendingService: Handles email notifications
- JobOffersMapperService: Maps raw job offers to processed ones
- OffersAndUsersDatabaseMigratorService: Manages database migrations

##### Component Relationships

- REST API calls between services
- Event-driven communication via RabbitMQ
- Database access patterns
- External service interactions

##### Key Architectural Patterns to Highlight

a. Event-Driven Architecture:
- How services communicate through RabbitMQ events
- Producer/consumer patterns in each service

b. Microservices Pattern:
- Service independence
- Database per service pattern

c. Background Jobs:
- Quartz scheduler components
- Periodic tasks like job scraping and mail sending

##### Additional Elements

a. Timing information:
- 3-hour intervals for updates
- 22:00 and 04:00 for outdated offer deletion

- Service boundaries
- Event types
- Database relationships

##### Technical Stack Indicators

Technology badges or labels for:
- ASP.NET Core
- Entity Framework
- RabbitMQ
- SQL Server
- Firebase Auth
- Docker

##### API Gateway Layer
- Exposed endpoints for JobOffersService (port 7206)
- Exposed endpoints for UsersService (port 7104)

##### Testing Scope
- A note about test coverage
- Integration test boundaries

Remember to include the periodic nature of the system's operations and how data flows from raw job offers through processing to user notifications.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External["External Systems"]
        Firebase["Firebase Auth"]
        SMTP["SMTP Server"]
        JobSites["Job Posting Websites"]
    end

    subgraph Core["Core Services"]
        JOS["Job Offer Service"]:::service
        US["Users Service"]:::service
        WS["Web Scrapper"]:::service
        MSS["Mail Sending Service"]:::service
        JOMS["Job Offers Mapper Service"]:::service
        OUDMS["Offers & Users Database Migrator"]:::service
    end

    subgraph MessageBroker["Message Broker Layer"]
        RMQ["RabbitMQ"]:::messagebroker
    end

    subgraph Databases["Data Layer"]
        JODB["Job Offers DB"]:::database
        UDB["Users DB"]:::database
        RODB["Raw Offers DB"]:::database
    end

    %% External System Connections
    JobSites -->|"Scrapes Data"| WS
    Firebase -.->|"Auth"| US
    SMTP -.->|"Email Gateway"| MSS

    %% Core Service Interactions
    WS -->|"Raw Offers"| RMQ
    RMQ -->|"Process Raw Offers"| JOMS
    JOMS -->|"Processed Offers"| RMQ
    RMQ -->|"Create Offers"| JOS
    JOS -->|"Notification Events"| RMQ
    RMQ -->|"Send Emails"| MSS

    %% Database Connections
    JOS -->|"CRUD Operations"| JODB
    US -->|"User Management"| UDB
    JOMS -->|"Raw Data Storage"| RODB
    OUDMS -.->|"Migrations"| JODB
    OUDMS -.->|"Migrations"| UDB

    %% Styling
    classDef service fill:#a8d5ff,stroke:#333,stroke-width:2px
    classDef database fill:#f5f5f5,stroke:#333,stroke-width:2px
    classDef messagebroker fill:#ffe6cc,stroke:#333,stroke-width:2px
    classDef external fill:#e6e6e6,stroke:#333,stroke-width:2px

    %% Click Events
    click JOS "https://github.com/FilipKrz03/JobOffertsApi/tree/master/JobOfferService"
    click US "https://github.com/FilipKrz03/JobOffertsApi/tree/master/UsersService"
    click WS "https://github.com/FilipKrz03/JobOffertsApi/tree/master/WebScrapper"
    click MSS "https://github.com/FilipKrz03/JobOffertsApi/tree/master/MailSedningService"
    click JOMS "https://github.com/FilipKrz03/JobOffertsApi/tree/master/JobOffersMapperService"
    click OUDMS "https://github.com/FilipKrz03/JobOffertsApi/tree/master/OffersAndUsersDatabaseMigratorService"

    %% Service Component Click Events
    click JOS_DB "https://github.com/FilipKrz03/JobOffertsApi/blob/master/JobOfferService/DbContexts/JobOffersContext.cs"
    click US_AUTH "https://github.com/FilipKrz03/JobOffertsApi/blob/master/UsersService/Services/AuthenticationService.cs"
    click US_JWT "https://github.com/FilipKrz03/JobOffertsApi/blob/master/UsersService/Services/JwtProvider.cs"
    click WS_SCRAPER1 "https://github.com/FilipKrz03/JobOffertsApi/blob/master/WebScrapper/Services/PracujPlScrapperService.cs"
    click WS_SCRAPER2 "https://github.com/FilipKrz03/JobOffertsApi/blob/master/WebScrapper/Services/TheProtocolScrapperService.cs"
    click MSS_CORE "https://github.com/FilipKrz03/JobOffertsApi/blob/master/MailSedningService/Services/MailService.cs"
    click JOMS_MAP "https://github.com/FilipKrz03/JobOffertsApi/blob/master/JobOffersMapperService/Services/RawJobOfferService.cs"
    click OUDMS_CTX "https://github.com/FilipKrz03/JobOffertsApi/blob/master/OffersAndUsersDatabaseMigratorService/DbContexts/OffersApiDbContext.cs"
```
