# kliodt/vacancy-service-b architecture

> Architecture diagram of the GitHub repository kliodt/vacancy-service-b, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kliodt/vacancy-service-b
- Repository: https://github.com/kliodt/vacancy-service-b

## Overview

This is a Spring-based vacancy-publication microservice platform. The main user workflow enters through the API gateway, uses account or organization services for identity and ownership, then creates, searches, or responds to vacancies; user profiles can also manage favorite vacancies and upload files. Kafka carries lifecycle and response events to dependent services, while the notification service pushes relevant events over WebSockets. The README documents discovery, centralized configuration, and gateway routing; only selected service internals were sampled, so detailed wiring for those and other documented capabilities is not inferred.

Main entry points: [`gatewayService/src/main/java/com/vacancy/gateway/GatewayServiceApplication.java`](https://github.com/kliodt/vacancy-service-b/blob/master/gatewayService/src/main/java/com/vacancy/gateway/GatewayServiceApplication.java) (API gateway), [`vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaConsumerService.java`](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaConsumerService.java) (Vacancy event consumer), [`fileService/src/main/java/com/vacancy/files/kafka/KafkaConsumerService.java`](https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/kafka/KafkaConsumerService.java) (File event consumer), [`vacancyService/src/main/java/com/vacancy/vacancy/controller/VacancyController.java`](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/controller/VacancyController.java) (Vacancy and response APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform and entry"]
  node_gateway["API gateway"]
  node_eureka["Service discovery"]
  node_config["Central config"]
end

subgraph group_identity["Accounts and organizations"]
  node_users["User and auth API"]
  node_user_logic["User operations"]
  node_user_store[("User data")]
  node_organizations["Organization API"]
  node_organization_logic["Organization operations"]
  node_organization_store[("Organization data")]
end

subgraph group_vacancy["Vacancies and files"]
  node_vacancy_api["Vacancy and response APIs"]
  node_vacancy_logic["Vacancy operations"]
  node_response_logic["Application responses"]
  node_vacancy_store[("Vacancy data")]
  node_response_store[("Response data")]
  node_files_api["File API"]
  node_file_logic["File operations"]
  node_file_store[("File metadata")]
  node_file_content[("File content storage")]
end

subgraph group_events["Events and notifications"]
  node_kafka["Kafka topics"]
  node_user_events["User event producer"]
  node_organization_events["Organization event producer"]
  node_vacancy_events["Vacancy event producer"]
  node_vacancy_consumer["Vacancy event consumer"]
  node_file_consumer["File event consumer"]
  node_notification["Notification listeners"]
  node_push["WebSocket push"]
end

node_applicant(("Applicant"))
node_organization_user(("Organization user"))
node_live_clients(("Realtime clients"))

node_applicant -->|"sends requests"| node_gateway
node_organization_user -->|"sends requests"| node_gateway
node_gateway -.->|"routes requests"| node_users
node_gateway -.->|"routes requests"| node_organizations
node_gateway -.->|"routes requests"| node_vacancy_api
node_gateway -.->|"routes requests"| node_files_api
node_users -->|"invokes"| node_user_logic
node_user_logic -->|"reads and writes"| node_user_store
node_organizations -->|"invokes"| node_organization_logic
node_organization_logic -->|"reads and writes"| node_organization_store
node_vacancy_api -->|"invokes"| node_vacancy_logic
node_vacancy_api -->|"invokes"| node_response_logic
node_vacancy_logic -->|"reads and writes"| node_vacancy_store
node_response_logic -->|"reads and writes"| node_response_store
node_files_api -->|"invokes"| node_file_logic
node_file_logic -->|"reads and writes"| node_file_store
node_file_logic -->|"stores content"| node_file_content
node_user_events -->|"publishes events"| node_kafka
node_organization_events -->|"publishes events"| node_kafka
node_vacancy_events -->|"publishes events"| node_kafka
node_vacancy_consumer -->|"consumes events"| node_kafka
node_file_consumer -->|"consumes events"| node_kafka
node_notification -.->|"consumes events"| node_kafka
node_vacancy_consumer -->|"deletes responses"| node_response_store
node_vacancy_consumer -->|"deletes vacancies"| node_vacancy_store
node_file_consumer -->|"deletes metadata"| node_file_store
node_file_consumer -->|"deletes content"| node_file_content
node_notification -.->|"dispatches notifications"| node_push
node_push -->|"pushes messages"| node_live_clients
node_gateway -.->|"discovers services"| node_eureka
node_gateway -.->|"loads configuration"| node_config

click node_gateway "https://github.com/kliodt/vacancy-service-b/blob/master/gatewayService/src/main/java/com/vacancy/gateway/GatewayServiceApplication.java"
click node_eureka "https://github.com/kliodt/vacancy-service-b/blob/master/eurekaServer/src/main/java/com/vacancy/eureka/EurekaServerApplication.java"
click node_config "https://github.com/kliodt/vacancy-service-b/blob/master/configServer/src/main/java/com/vacancy/config/ConfigServerApplication.java"
click node_users "https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/controller/UserController.java"
click node_user_logic "https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/service/UserServiceImpl.java"
click node_user_store "https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/repository/UserRepository.java"
click node_organizations "https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/controller/OrganizationController.java"
click node_organization_logic "https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/service/OrganizationServiceImpl.java"
click node_organization_store "https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/repository/OrganizationRepository.java"
click node_vacancy_api "https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/controller/VacancyController.java"
click node_vacancy_logic "https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/service/VacancyServiceImpl.java"
click node_response_logic "https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/service/UserVacancyResponseServiceImpl.java"
click node_vacancy_store "https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/repository/VacancyRepository.java"
click node_response_store "https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/repository/UserVacancyResponseRepository.java"
click node_files_api "https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/controller/FileController.java"
click node_file_logic "https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/service/FileServiceImpl.java"
click node_file_store "https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/repository/FileRepository.java"
click node_file_content "https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/service/FileServiceImpl.java"
click node_user_events "https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/kafka/KafkaProducerService.java"
click node_organization_events "https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/kafka/KafkaProducerService.java"
click node_vacancy_events "https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaProducerService.java"
click node_vacancy_consumer "https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaConsumerService.java"
click node_file_consumer "https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/kafka/KafkaConsumerService.java"
click node_notification "https://github.com/kliodt/vacancy-service-b/blob/master/notificationService/src/main/java/com/vacancy/notification/kafka/VacancyResponseCreatedListener.java"
click node_push "https://github.com/kliodt/vacancy-service-b/blob/master/notificationService/src/main/java/com/vacancy/notification/websocket/WebSocketPushService.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gateway,node_eureka,node_config,node_organization_user,node_live_clients toneBlue
class node_users,node_user_logic,node_user_store,node_organizations,node_organization_logic,node_organization_store toneAmber
class node_vacancy_api,node_vacancy_logic,node_response_logic,node_vacancy_store,node_response_store,node_files_api,node_file_logic,node_file_store,node_file_content toneMint
class node_kafka,node_user_events,node_organization_events,node_vacancy_events,node_vacancy_consumer,node_file_consumer,node_notification,node_push toneRose
class node_applicant toneIndigo
```

## Components

### Platform and entry

- [API gateway](https://github.com/kliodt/vacancy-service-b/blob/master/gatewayService/src/main/java/com/vacancy/gateway/GatewayServiceApplication.java): `gatewayService/src/main/java/com/vacancy/gateway/GatewayServiceApplication.java`
- [Service discovery](https://github.com/kliodt/vacancy-service-b/blob/master/eurekaServer/src/main/java/com/vacancy/eureka/EurekaServerApplication.java): `eurekaServer/src/main/java/com/vacancy/eureka/EurekaServerApplication.java`
- [Central config](https://github.com/kliodt/vacancy-service-b/blob/master/configServer/src/main/java/com/vacancy/config/ConfigServerApplication.java): `configServer/src/main/java/com/vacancy/config/ConfigServerApplication.java`

### Accounts and organizations

- [User and auth API](https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/controller/UserController.java): `userService/src/main/java/com/vacancy/user/controller/UserController.java`
- [User operations](https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/service/UserServiceImpl.java): `userService/src/main/java/com/vacancy/user/service/UserServiceImpl.java`
- [User data](https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/repository/UserRepository.java): `userService/src/main/java/com/vacancy/user/repository/UserRepository.java`
- [Organization API](https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/controller/OrganizationController.java): `organizationService/src/main/java/com/vacancy/organization/controller/OrganizationController.java`
- [Organization operations](https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/service/OrganizationServiceImpl.java): `organizationService/src/main/java/com/vacancy/organization/service/OrganizationServiceImpl.java`
- [Organization data](https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/repository/OrganizationRepository.java): `organizationService/src/main/java/com/vacancy/organization/repository/OrganizationRepository.java`

### Vacancies and files

- [Vacancy and response APIs](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/controller/VacancyController.java): `vacancyService/src/main/java/com/vacancy/vacancy/controller/VacancyController.java`
- [Vacancy operations](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/service/VacancyServiceImpl.java): `vacancyService/src/main/java/com/vacancy/vacancy/service/VacancyServiceImpl.java`
- [Application responses](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/service/UserVacancyResponseServiceImpl.java): `vacancyService/src/main/java/com/vacancy/vacancy/service/UserVacancyResponseServiceImpl.java`
- [Vacancy data](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/repository/VacancyRepository.java): `vacancyService/src/main/java/com/vacancy/vacancy/repository/VacancyRepository.java`
- [Response data](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/repository/UserVacancyResponseRepository.java): `vacancyService/src/main/java/com/vacancy/vacancy/repository/UserVacancyResponseRepository.java`
- [File API](https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/controller/FileController.java): `fileService/src/main/java/com/vacancy/files/controller/FileController.java`
- [File operations](https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/service/FileServiceImpl.java): `fileService/src/main/java/com/vacancy/files/service/FileServiceImpl.java`
- [File metadata](https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/repository/FileRepository.java): `fileService/src/main/java/com/vacancy/files/repository/FileRepository.java`
- [File content storage](https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/service/FileServiceImpl.java): `fileService/src/main/java/com/vacancy/files/service/FileServiceImpl.java`

### Events and notifications

- **Kafka topics**
- [User event producer](https://github.com/kliodt/vacancy-service-b/blob/master/userService/src/main/java/com/vacancy/user/kafka/KafkaProducerService.java): `userService/src/main/java/com/vacancy/user/kafka/KafkaProducerService.java`
- [Organization event producer](https://github.com/kliodt/vacancy-service-b/blob/master/organizationService/src/main/java/com/vacancy/organization/kafka/KafkaProducerService.java): `organizationService/src/main/java/com/vacancy/organization/kafka/KafkaProducerService.java`
- [Vacancy event producer](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaProducerService.java): `vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaProducerService.java`
- [Vacancy event consumer](https://github.com/kliodt/vacancy-service-b/blob/master/vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaConsumerService.java): `vacancyService/src/main/java/com/vacancy/vacancy/kafka/KafkaConsumerService.java`
- [File event consumer](https://github.com/kliodt/vacancy-service-b/blob/master/fileService/src/main/java/com/vacancy/files/kafka/KafkaConsumerService.java): `fileService/src/main/java/com/vacancy/files/kafka/KafkaConsumerService.java`
- [Notification listeners](https://github.com/kliodt/vacancy-service-b/blob/master/notificationService/src/main/java/com/vacancy/notification/kafka/VacancyResponseCreatedListener.java): `notificationService/src/main/java/com/vacancy/notification/kafka/VacancyResponseCreatedListener.java`
- [WebSocket push](https://github.com/kliodt/vacancy-service-b/blob/master/notificationService/src/main/java/com/vacancy/notification/websocket/WebSocketPushService.java): `notificationService/src/main/java/com/vacancy/notification/websocket/WebSocketPushService.java`

### Other components

- **Applicant**
- **Organization user**
- **Realtime clients**

## Connections

- Applicant → API gateway: sends requests
- Organization user → API gateway: sends requests
- API gateway → User and auth API: routes requests
- API gateway → Organization API: routes requests
- API gateway → Vacancy and response APIs: routes requests
- API gateway → File API: routes requests
- User and auth API → User operations: invokes
- User operations → User data: reads and writes
- Organization API → Organization operations: invokes
- Organization operations → Organization data: reads and writes
- Vacancy and response APIs → Vacancy operations: invokes
- Vacancy and response APIs → Application responses: invokes
- Vacancy operations → Vacancy data: reads and writes
- Application responses → Response data: reads and writes
- File API → File operations: invokes
- File operations → File metadata: reads and writes
- File operations → File content storage: stores content
- User event producer → Kafka topics: publishes events
- Organization event producer → Kafka topics: publishes events
- Vacancy event producer → Kafka topics: publishes events
- Vacancy event consumer → Kafka topics: consumes events
- File event consumer → Kafka topics: consumes events
- Notification listeners → Kafka topics: consumes events
- Vacancy event consumer → Response data: deletes responses
- Vacancy event consumer → Vacancy data: deletes vacancies
- File event consumer → File metadata: deletes metadata
- File event consumer → File content storage: deletes content
- Notification listeners → WebSocket push: dispatches notifications
- WebSocket push → Realtime clients: pushes messages
- API gateway → Service discovery: discovers services
- API gateway → Central config: loads configuration
