Skip to main content

Overview

The Job Manager backend is decomposed into 8 microservices, each with a dedicated bounded context. This page provides detailed C4 component diagrams for each service.
All microservices follow a consistent internal architecture with API Module (interfaces, DTOs) and Service Module (business logic, repositories).

Container Diagram

The complete backend container diagram showing all microservices, databases, Kafka messaging, and external system integrations.
Backend Container Diagram

System Components

Infrastructure Layer

  • API Gateway (Spring Cloud Gateway)
  • Service Discovery (Eureka)
  • Kafka Cluster for event streaming
  • Redis for token caching

Core Microservices

  • Company Auth Service
  • Company Profile Service
  • Job Post Service
  • Payment Service

Supporting Services

  • Company Media Service
  • Notification Service
  • Applicant Discovery Service
  • Skill Tag Service

External Systems

  • Job Applicant (JA) Backend
  • External Payment Service (Stripe)
  • Google Authentication
  • Email Service (Mailgun)
  • Media File Storage (S3/GCS)

Common Components

All microservices share these foundational architectural elements:
Spring Boot security filter that validates all incoming requests originate from the API Gateway, preventing unauthorized direct access to internal services. This filter intercepts every incoming request to verify it originated from our API Gateway, maintaining the secured connection of our internal network and preventing outer requests.
@Component
public class GatewayOriginFilter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest request,
                                    HttpServletResponse response,
                                    FilterChain chain) {
        String gatewayHeader = request.getHeader("X-Gateway-Origin");
        if (isValidGatewayOrigin(gatewayHeader)) {
            chain.doFilter(request, response);
        } else {
            response.sendError(HttpStatus.FORBIDDEN.value());
        }
    }
}
Encapsulates External elements (exposed interfaces/DTOs) and Internal elements (module-private). Only External elements are exposed to other modules and microservices while Internal data remains isolated. This enforces strict encapsulation and the Separation of Concerns principle.
api-module/
├── external/
│   ├── Interface.java      # Public API contract
│   └── DTO.java            # External data transfer
└── internal/
    ├── Interface.java      # Private API contract
    └── DTO.java            # Internal data transfer
Contains @Service components for business logic and @Repository components for database operations. The Service module contains the core business logic of the microservice, ensuring modular architecture and ease of maintenance.
service-module/
├── Controller.java         # REST endpoints
├── Service.java            # Business logic
├── Repository.java         # Database queries
└── Model.java              # Entity definitions
Defines producer/consumer configurations with topics and Avro schemas for event messaging.Request-Reply Pattern: Every Kafka communication follows the Request-Reply pattern which includes two Kafka topics:
  • A Publisher topic to trigger the request process
  • A Consumer topic to get the reply result (follows pattern {TOPIC}_REPLIED)
@Configuration
public class KafkaConfig {
    @Bean
    public ProducerFactory<String, Object> producerFactory() {
        Map<String, Object> props = new HashMap<>();
        props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
        props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, KafkaAvroSerializer.class);
        return new DefaultKafkaProducerFactory<>(props);
    }
}
Exclusively implemented within the Auth Microservice to handle seamless authentication access. Redis is used as an in-memory storage to cache auth_token and refresh_token for authenticated users, significantly reducing latency during token validation by skipping queries to the primary database.
@Configuration
public class RedisConfig {
    @Bean
    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
        RedisTemplate<String, Object> template = new RedisTemplate<>();
        template.setConnectionFactory(factory);
        template.setKeySerializer(new StringRedisSerializer());
        template.setValueSerializer(new GenericJackson2JsonRedisSerializer());
        return template;
    }
}

Kafka Communication Convention

All frontend communication requests are directed to the API Gateway. The frontend does not communicate directly with microservices. Instead, it sends RESTful requests to the Gateway, which then verifies, identifies, and routes these requests to the corresponding microservice.

Company Authentication Service

Handles company registration, login, SSO integration, and premium subscription status management.
Company Auth Component Diagram

Communication

  • Incoming Events
  • Outgoing Events
  • External Services
SourceTopicPurpose
JA BackendJA_PROFILE_MATCHEDNew/updated applicants matching job posts
Payment ServiceJM_SUBSCRIPTION_PAIDUpdate premium status after payment

Key Components

ComponentResponsibility
Company Auth ControllerREST endpoints for login, register, logout
Company Auth ServiceAuthentication business logic
Company Auth RepositoryUser credential persistence
Redis ConfigToken cache configuration
Kafka ConfigEvent publishing/consumption

Company Profile Service

Manages company profile CRUD operations with geographic database sharding.
Company Profile Component Diagram

Communication

  • Incoming Events
  • Database Sharding
SourceTopicPurpose
Company Media ServiceJM_LOGO_UPDATEDUpdate logoUrl in profile
Company Auth ServiceJM_COMPANY_REGISTRATIONCreate new profile record

Key Components

ComponentResponsibility
Company Profile ControllerREST endpoints for profile CRUD
Company Profile ServiceProfile business logic
Company Profile RepositoryShard-aware data persistence
Kafka ConfigEvent consumption for updates

Job Post Service

Core recruitment engine handling job lifecycle and JA Backend integration.
Job Post Component Diagram

Communication

  • Incoming Events
  • Outgoing Events
SourceTopicPurpose
JA BackendJA_PROFILE_UPDATEDTrigger premium notifications
JA BackendGET_JOBS_REQUESTEDJob filtering for JA searches
JA BackendADMIN_{ACTION}_JOB_POST_REQUESTEDAdmin CRUD operations

Key Components

ComponentResponsibility
Job Post ControllerREST endpoints for job CRUD
Job Post ServiceJob lifecycle business logic
Job Post RepositoryJob data persistence
Job Post ModelJob entity with skill tags
Kafka ConfigCross-system event messaging

Payment Service

Handles premium subscription payments via Stripe integration.
Payment Component Diagram

Communication

  • Incoming Events
  • Outgoing Events
  • External Services
SourceTopicPurpose
JA BackendPAYMENT_REQUESTEDPremium subscription from applicants

Key Components

ComponentResponsibility
Payment ControllerREST endpoints for payment initiation
Payment ServicePayment processing business logic
Payment RepositoryTransaction record persistence
Payment ModelTransaction entity
Kafka ConfigPayment event messaging

Company Media Service

Manages media file uploads (logos, images, videos) with cloud storage.
Company Media Component Diagram

Communication

  • Outgoing Events
  • External Services
TargetTopicPurpose
Company Profile ServiceJM_LOGO_UPDATEDUpdate logo URL in profile

Key Components

ComponentResponsibility
Company Media ControllerREST endpoints for media CRUD
Company Media ServiceFile upload business logic
Company Media RepositoryMedia metadata persistence
Company Media ModelMedia entity with type enum
Kafka ConfigLogo update event publishing

Notification Service

Processes notification events and delivers real-time alerts via WebSocket.
Notification Component Diagram

Communication

  • Incoming Events
  • Delivery Channels
SourceTopicPurpose
Auth ServiceJM_SUBSCRIPTION_EXPIREDExpired subscription alerts
Job Post ServiceJM_APPLICANT_MATCHEDNew applicant match alerts

Key Components

ComponentResponsibility
Notification ControllerREST endpoints for notification retrieval
Notification ServiceAlert processing business logic
Notification RepositoryNotification persistence
Notification ModelNotification entity with read status
WebSocketReal-time delivery system
Kafka ConfigEvent consumption

Applicant Discovery Service

Handles premium company search profiles and applicant search requests.
Applicant Discovery Component Diagram

Communication

  • REST APIs
  • Outgoing Events
  • Search Profile CRUD for premium companies
  • Applicant search requests with filters
  • Full-text search across applicant profiles

Key Components

ComponentResponsibility
Applicant Discovery ControllerREST endpoints for search
Applicant Discovery ServiceSearch orchestration logic
Applicant Discovery RepositorySearch profile persistence
Applicant Discovery ModelSearch profile entity
Kafka ConfigCross-system search requests

Skill Tag Service

Maintains the centralized master list of technical skills shared across the platform.
Skill Tag Component Diagram
The Skill Tag Service is the source of truth for skill taxonomy. Both JM and JA backends retrieve tags via REST API to ensure consistent skill matching.

Key Responsibilities

  • CRUD operations for skill tags
  • Provide autocomplete suggestions for job posts
  • Ensure unified taxonomy across job posts and applicant profiles
  • Expose REST API for JA Backend consumption

Key Components

ComponentResponsibility
Skill Tag ControllerREST endpoints for tag CRUD
Skill Tag ServiceTag management business logic
Skill Tag RepositoryTag data persistence
Skill Tag ModelTag entity