How dragand-ukr/jobspotter works
Main Components
• Backend Microservices: There are several Spring Boot microservices under the “jobspotter_backend/services” directory:
• Config Server – centralizes configuration (found in services/config-server).
• Discovery Service – handles service registration and discovery (services/discovery).
• Gateway Service – the API gateway that intercepts requests, handles authentication (see security filters and token rotation), and routes them to the appropriate services (services/gateway).
• Job Post Service – manages job postings, search (with full-text search using Lucene/Hibernate Search), and address-related functionality.
• Notification Service – pushes real-time notifications using Kafka and SSE.
• Report Service – handles administrative report management backed by MongoDB.
• Review Service – manages reviews and ratings for job posts.
• User Service – deals with user management, authentication integration via Keycloak, caching, and file storage (AWS S3 integration).
• Frontend: Located in “jobspotter_frontend”, it likely is a React/Vite-based application. It interacts with the backend via the API Gateway.
• Databases and External Tools:
• PostgreSQL and MongoDB for database needs.
• Kafka for messaging.
• Keycloak for authentication/authorization.
• AWS S3 for file storage.
• (Optional) Redis caching (to be implemented).
How Components Interact
• User requests originate from the frontend and are routed via the API Gateway.
• The Gateway performs initial token extraction (HTTP-only cookies) and authorization by interfacing with Keycloak.
• Validated requests are forwarded to the appropriate microservice (job-post, user, review, etc.).
• All microservices obtain their configuration from the Config Server and register with the Discovery Service for dynamic lookup.
• The Notification Service uses Kafka to publish events; these events are consumed by clients (e.g., via SSE in the frontend).
• For reporting, the Report Service leverages MongoDB’s flexible schema while other data storage (like job posts, users) is likely stored in PostgreSQL.
• Some inter-service communication is visible in client modules (e.g., job-post calling review or user service APIs).
Architectural Patterns and Design Principles
• Microservices Architecture: Each responsibility is split among loosely coupled services.
• API Gateway: Acts as the “face” of the backend, handling cross-cutting concerns (authentication and token refresh).
• Service Discovery: Ensures responsiveness and load balancing among services.
• Centralized Configuration: Provided through the Config Server for consistency.
• Real-Time Messaging: Kafka integration for notifications.
• Secure Authentication: Managed via Keycloak with token-based authorization.
• Containerization & Scalability: Docker (as indicated by docker-compose files) and planned GitHub Action CI/CD processes.