# oliceglad/benefit architecture

> Architecture diagram of the GitHub repository oliceglad/benefit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oliceglad/benefit
- Repository: https://github.com/oliceglad/benefit

## Overview

Benefit is a microservice platform for matching candidates to vacancies. The user-facing path runs through the API gateway to authentication and service APIs; candidates build profiles and employers publish vacancies, while matching and assessment support candidate selection. Applications and invitations connect the parties, with chat and notifications supporting follow-up. The README documents service boundaries and several cross-service flows; unsampled feature internals are represented at their service paths, and only documented relationships are connected.

Main entry points: [`backend/applications-service/app/services/applications.py`](https://github.com/oliceglad/benefit/blob/main/backend/applications-service/app/services/applications.py) (Applications), [`backend/candidate-service/app/services/profiles.py`](https://github.com/oliceglad/benefit/blob/main/backend/candidate-service/app/services/profiles.py) (Candidate profile), [`backend/chat-service/app/services`](https://github.com/oliceglad/benefit/tree/main/backend/chat-service/app/services) (Chat and tasks), [`backend/notification-service/app`](https://github.com/oliceglad/benefit/tree/main/backend/notification-service/app) (Notifications)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_gateway["API gateway"]
  node_auth["Authentication"]
end

subgraph group_talent["Talent and vacancies"]
  node_core["Core API"]
  node_candidate_profile["Candidate profile<br/>[profiles.py]"]
  node_employer_vacancies["Employer vacancies<br/>[employers.py]"]
  node_matching["Talent matching"]
end

subgraph group_selection["Selection workflow"]
  node_assessment["Assessment tests"]
  node_applications["Applications<br/>[applications.py]"]
  node_invitations["Invitations<br/>[invitations.py]"]
end

subgraph group_engagement["Communication"]
  node_chat["Chat and tasks"]
  node_notifications["Notifications"]
  node_mail["Email delivery"]
end

subgraph group_shared["Shared delivery"]
  node_outbox["Outbox delivery<br/>[outbox.py]"]
  node_internal_api["Internal API<br/>[internal.py]"]
end

node_candidate(("Candidate"))
node_employer(("Employer"))
node_fsp["FSP ID<br/>[main.py]"]
node_keycloak["Keycloak"]

node_candidate -->|"uses API"| node_gateway
node_employer -->|"uses API"| node_gateway
node_gateway -->|"routes auth"| node_auth
node_gateway -->|"routes profiles"| node_candidate_profile
node_gateway -->|"routes vacancies"| node_employer_vacancies
node_gateway -->|"routes tests"| node_assessment
node_gateway -->|"routes applications"| node_applications
node_gateway -->|"routes invitations"| node_invitations
node_gateway -->|"routes chat"| node_chat
node_gateway -->|"routes notifications"| node_notifications
node_gateway -->|"routes talent"| node_matching
node_gateway -->|"routes remaining"| node_core
node_auth -->|"supports OIDC"| node_fsp
node_auth -->|"supports OIDC"| node_keycloak
node_assessment -->|"updates via outbox"| node_candidate_profile
node_assessment -->|"records events"| node_outbox
node_applications -->|"records events"| node_outbox
node_outbox -->|"delivers events"| node_notifications
node_notifications -->|"duplicates by email"| node_mail
node_applications -->|"creates conversation"| node_chat
node_applications -->|"grants contact access"| node_candidate_profile
node_chat -->|"publishes notifications"| node_notifications
node_chat -->|"publishes activity"| node_candidate_profile
node_applications -->|"checks vacancy"| node_employer_vacancies
node_applications -->|"checks profile"| node_candidate_profile

click node_auth "https://github.com/oliceglad/benefit/tree/main/backend/auth-service/app"
click node_core "https://github.com/oliceglad/benefit/tree/main/backend/core/app"
click node_candidate_profile "https://github.com/oliceglad/benefit/blob/main/backend/candidate-service/app/services/profiles.py"
click node_employer_vacancies "https://github.com/oliceglad/benefit/blob/main/backend/employer-service/app/services/employers.py"
click node_matching "https://github.com/oliceglad/benefit/tree/main/backend/matching-service/app/services"
click node_assessment "https://github.com/oliceglad/benefit/tree/main/backend/assessment-service/app/services"
click node_applications "https://github.com/oliceglad/benefit/blob/main/backend/applications-service/app/services/applications.py"
click node_invitations "https://github.com/oliceglad/benefit/blob/main/backend/applications-service/app/services/invitations.py"
click node_chat "https://github.com/oliceglad/benefit/tree/main/backend/chat-service/app/services"
click node_notifications "https://github.com/oliceglad/benefit/tree/main/backend/notification-service/app"
click node_mail "https://github.com/oliceglad/benefit/tree/main/backend/mail-service/app"
click node_outbox "https://github.com/oliceglad/benefit/blob/main/backend/libs/benefit-common/benefit_common/outbox.py"
click node_internal_api "https://github.com/oliceglad/benefit/blob/main/backend/libs/benefit-common/benefit_common/internal.py"
click node_fsp "https://github.com/oliceglad/benefit/blob/main/backend/fsp-id-mock/app/main.py"

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_auth toneBlue
class node_core,node_candidate_profile,node_employer_vacancies,node_matching toneAmber
class node_assessment,node_applications,node_invitations toneMint
class node_chat,node_notifications,node_mail toneRose
class node_outbox,node_internal_api,node_candidate,node_employer,node_keycloak toneIndigo
class node_fsp toneTeal
```

## Components

### Access and identity

- **API gateway**
- [Authentication](https://github.com/oliceglad/benefit/tree/main/backend/auth-service/app): `backend/auth-service/app`

### Talent and vacancies

- [Core API](https://github.com/oliceglad/benefit/tree/main/backend/core/app): `backend/core/app`
- [Candidate profile](https://github.com/oliceglad/benefit/blob/main/backend/candidate-service/app/services/profiles.py): `backend/candidate-service/app/services/profiles.py`
- [Employer vacancies](https://github.com/oliceglad/benefit/blob/main/backend/employer-service/app/services/employers.py): `backend/employer-service/app/services/employers.py`
- [Talent matching](https://github.com/oliceglad/benefit/tree/main/backend/matching-service/app/services): `backend/matching-service/app/services`

### Selection workflow

- [Assessment tests](https://github.com/oliceglad/benefit/tree/main/backend/assessment-service/app/services): `backend/assessment-service/app/services`
- [Applications](https://github.com/oliceglad/benefit/blob/main/backend/applications-service/app/services/applications.py): `backend/applications-service/app/services/applications.py`
- [Invitations](https://github.com/oliceglad/benefit/blob/main/backend/applications-service/app/services/invitations.py): `backend/applications-service/app/services/invitations.py`

### Communication

- [Chat and tasks](https://github.com/oliceglad/benefit/tree/main/backend/chat-service/app/services): `backend/chat-service/app/services`
- [Notifications](https://github.com/oliceglad/benefit/tree/main/backend/notification-service/app): `backend/notification-service/app`
- [Email delivery](https://github.com/oliceglad/benefit/tree/main/backend/mail-service/app): `backend/mail-service/app`

### Shared delivery

- [Outbox delivery](https://github.com/oliceglad/benefit/blob/main/backend/libs/benefit-common/benefit_common/outbox.py): `backend/libs/benefit-common/benefit_common/outbox.py`
- [Internal API](https://github.com/oliceglad/benefit/blob/main/backend/libs/benefit-common/benefit_common/internal.py): `backend/libs/benefit-common/benefit_common/internal.py`

### Other components

- **Candidate**
- **Employer**
- [FSP ID](https://github.com/oliceglad/benefit/blob/main/backend/fsp-id-mock/app/main.py): `backend/fsp-id-mock/app/main.py`
- **Keycloak**

## Connections

- Candidate → API gateway: uses API
- Employer → API gateway: uses API
- API gateway → Authentication: routes auth
- API gateway → Candidate profile: routes profiles
- API gateway → Employer vacancies: routes vacancies
- API gateway → Assessment tests: routes tests
- API gateway → Applications: routes applications
- API gateway → Invitations: routes invitations
- API gateway → Chat and tasks: routes chat
- API gateway → Notifications: routes notifications
- API gateway → Talent matching: routes talent
- API gateway → Core API: routes remaining
- Authentication → FSP ID: supports OIDC (evidence: `backend/fsp-id-mock/app/main.py`)
- Authentication → Keycloak: supports OIDC
- Assessment tests → Candidate profile: updates via outbox
- Assessment tests → Outbox delivery: records events
- Applications → Outbox delivery: records events (evidence: `backend/applications-service/app/services/applications.py`)
- Outbox delivery → Notifications: delivers events (evidence: `backend/notification-service/app/api/internal/router.py`)
- Notifications → Email delivery: duplicates by email
- Applications → Chat and tasks: creates conversation (evidence: `backend/applications-service/app/services/applications.py`)
- Applications → Candidate profile: grants contact access (evidence: `backend/applications-service/app/services/applications.py`)
- Chat and tasks → Notifications: publishes notifications (evidence: `backend/chat-service/app/services/delivery.py`)
- Chat and tasks → Candidate profile: publishes activity (evidence: `backend/chat-service/app/services/delivery.py`)
- Applications → Employer vacancies: checks vacancy (evidence: `backend/applications-service/app/services/applications.py`)
- Applications → Candidate profile: checks profile (evidence: `backend/applications-service/app/services/applications.py`)
