Skip to content

mariamtouny/FinalProject-33-BarmagTouny

Repository files navigation

πŸš€ Akeed - Enterprise Microservices Job Platform

Java Spring Boot Spring Cloud Docker Kubernetes Microservices

πŸ“‹ Table of Contents

Overview

Akeed is a comprehensive, enterprise-grade job platform built using modern microservices architecture. This project demonstrates advanced software engineering practices, scalable system design, and production-ready deployment strategies. The platform handles job postings, user management, applications, search functionality, and real-time notifications.

🎯 Business Domain

  • Job Posting & Management: Recruiters can create, manage, and boost job posts
  • User Profiles: Comprehensive user profiles with skills, experience, and education
  • Application System: Complete job application workflow with status tracking
  • Advanced Search: Multi-strategy search with filtering, location-based, and recent searches
  • Real-time Notifications: Event-driven notification system using message queues

πŸ—οΈ Architecture

Microservices Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   API Gateway   β”‚    β”‚   Load Balancer β”‚    β”‚   Monitoring    β”‚
β”‚    (Port 8089)  β”‚    β”‚                 β”‚    β”‚   (Grafana)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Service Mesh                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚UserService  β”‚PostService  β”‚AppService   β”‚SearchServiceβ”‚NotifSvc β”‚
β”‚(Port 8084)  β”‚(Port 8082)  β”‚(Port 8080)  β”‚(Port 8083)  β”‚(8081)   β”‚
β”‚PostgreSQL   β”‚MongoDB      β”‚PostgreSQL   β”‚PostgreSQL   β”‚MongoDB  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚                       β”‚                       β”‚
          β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Redis       β”‚    β”‚    RabbitMQ     β”‚    β”‚   Databases     β”‚
β”‚   (Caching)     β”‚    β”‚  (Messaging)    β”‚    β”‚  (Persistence)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ Communication Patterns

  • Synchronous: REST APIs with OpenFeign clients for inter-service communication
  • Asynchronous: RabbitMQ for event-driven messaging and notifications
  • Caching: Redis for performance optimization and session management
  • API Gateway: Centralized routing, load balancing, and cross-cutting concerns

πŸ”§ Microservices

1. πŸ‘€ User Service (Port 8084)

Technology Stack: Spring Boot, PostgreSQL, Redis, RabbitMQ

  • User Management: Registration, authentication, profile management
  • Recruiter Profiles: Company information, job posting permissions
  • User Types: Job seekers and recruiters with role-based access
  • Data Models: Users, Recruiters, Education, Work Experience, Blocked Users
  • Caching: Redis for user session and profile caching
  • Patterns: Repository pattern, Service layer architecture

2. πŸ“ Post Service (Port 8082)

Technology Stack: Spring Boot, MongoDB, Redis, RabbitMQ

  • Job Post Management: CRUD operations for job postings
  • Post Status: Active, Archived, Deleted states with lifecycle management
  • Post Boosting: Premium job post promotion feature
  • Media Support: Multiple media URLs and post types
  • Observer Pattern: Real-time notifications for post events
  • Builder Pattern: Complex post object construction
  • Caching: Redis for frequently accessed posts

3. πŸ“‹ Application Service (Port 8080)

Technology Stack: Spring Boot, PostgreSQL, Redis, RabbitMQ

  • Application Workflow: Complete job application lifecycle
  • Status Tracking: Pending, Accepted, Rejected, Withdrawn states
  • Command Pattern: Encapsulated application operations
  • Feign Integration: Communication with Post Service for job details
  • Event Publishing: RabbitMQ notifications for application events
  • Audit Logging: Comprehensive application history tracking

4. πŸ” Search Service (Port 8083)

Technology Stack: Spring Boot, PostgreSQL, Redis, OpenFeign

  • Strategy Pattern: Multiple search algorithms (Filter, Location, Recent, Post, User)
  • Advanced Filtering: Skills, location, employment type, industry filters
  • Search History: User search tracking and recent searches
  • Cross-Service Search: Federated search across posts and users
  • Caching: Redis for search result optimization
  • Performance: Optimized queries with database indexing

5. πŸ”” Notification Service (Port 8081)

Technology Stack: Spring Boot, MongoDB, RabbitMQ

  • Event-Driven: RabbitMQ consumer for real-time notifications
  • Command Pattern: Encapsulated notification operations
  • Observer Pattern: Notification lifecycle event handling
  • Notification Types: Job applications, post updates, system alerts
  • Status Management: Read/Unread notification states
  • Scalable Design: Asynchronous processing for high throughput

6. 🌐 API Gateway (Port 8089)

Technology Stack: Spring Cloud Gateway

  • Centralized Routing: Single entry point for all client requests
  • Load Balancing: Intelligent request distribution
  • Cross-Cutting Concerns: Authentication, logging, rate limiting
  • Service Discovery: Dynamic service registration and discovery

πŸ› οΈ Technologies & Patterns

πŸ—οΈ Design Patterns Implemented

  • Microservices Pattern: Distributed system architecture
  • API Gateway Pattern: Centralized request routing
  • Database per Service: Data isolation and independence
  • Event Sourcing: RabbitMQ for event-driven communication
  • CQRS: Command Query Responsibility Segregation
  • Observer Pattern: Real-time event notifications
  • Strategy Pattern: Multiple search algorithms
  • Command Pattern: Encapsulated business operations
  • Builder Pattern: Complex object construction
  • Repository Pattern: Data access abstraction
  • Factory Pattern: Service and command creation

πŸ”§ Technology Stack

  • Backend Framework: Spring Boot 3.4.5, Spring Cloud 2024.0.1
  • Programming Language: Java 23
  • Databases: PostgreSQL (ACID compliance), MongoDB (Document storage)
  • Caching: Redis (In-memory data structure store)
  • Message Queue: RabbitMQ (Asynchronous messaging)
  • Service Communication: OpenFeign (Declarative REST clients)
  • Containerization: Docker & Docker Compose
  • Orchestration: Kubernetes with custom deployments
  • Monitoring: Grafana, Loki, Promtail (Observability stack)
  • Build Tool: Maven
  • API Documentation: RESTful APIs with comprehensive endpoints

πŸ”’ Enterprise Features

  • Caching Strategy: Multi-level caching with Redis
  • Error Handling: Comprehensive exception management
  • Logging: Structured logging with Logback and Loki integration
  • Health Checks: Spring Actuator endpoints
  • Metrics: Prometheus metrics collection
  • Configuration Management: Externalized configuration
  • Security: Role-based access control

πŸš€ Getting Started

Prerequisites

  • Java 23+
  • Docker & Docker Compose
  • Maven 3.8+
  • Kubernetes (optional, for K8s deployment)

🐳 Docker Compose Deployment

# Clone the repository
git clone <repository-url>
cd FinalProject-33-BarmagTouny

# Start all services with dependencies
docker-compose up -d

# Start with monitoring stack
docker-compose -f docker-compose.yaml -f docker-compose-monitoring.yml up -d

☸️ Kubernetes Deployment

# Create namespace
kubectl apply -f K8s/namespace.yaml

# Deploy databases
kubectl apply -f K8s/postgres/
kubectl apply -f K8s/mongo/
kubectl apply -f K8s/redis/
kubectl apply -f K8s/rabbitmq/

# Deploy microservices
kubectl apply -f K8s/user-service/
kubectl apply -f K8s/post-service/
kubectl apply -f K8s/app-service/
kubectl apply -f K8s/search-service/
kubectl apply -f K8s/notification-service/
kubectl apply -f K8s/apigateway/

πŸ”§ Local Development

# Build all services
mvn clean install

# Start infrastructure services
docker-compose up postgres mongo redis rabbitmq -d

# Run services individually
cd UserService && mvn spring-boot:run
cd PostService && mvn spring-boot:run
cd AppService && mvn spring-boot:run
cd SearchService && mvn spring-boot:run
cd NotificationService && mvn spring-boot:run
cd gateway && mvn spring-boot:run

πŸ“Š Monitoring & Observability

πŸ” Monitoring Stack

  • Grafana (Port 3000): Visualization and dashboards
  • Loki (Port 3100): Log aggregation and querying
  • Promtail: Log collection and forwarding
  • Redis Insight (Port 5540): Redis monitoring
  • Mongo Express (Port 9000): MongoDB administration
  • RabbitMQ Management (Port 15672): Message queue monitoring

πŸ“ˆ Key Metrics

  • Service health and uptime
  • Request/response times
  • Database connection pools
  • Cache hit/miss ratios
  • Message queue throughput
  • Error rates and exceptions

πŸ” Logging Strategy

  • Structured Logging: JSON format with correlation IDs
  • Centralized Logs: Loki aggregation across all services
  • Log Levels: Configurable logging levels per service
  • Audit Trails: Comprehensive business operation logging

πŸ”„ CI/CD & Deployment

🐳 Container Strategy

  • Multi-stage Builds: Optimized Docker images
  • Health Checks: Container health monitoring
  • Resource Limits: Memory and CPU constraints
  • Security: Non-root user execution

☸️ Kubernetes Features

  • Deployments: Rolling updates and rollbacks
  • Services: Load balancing and service discovery
  • ConfigMaps: Environment-specific configuration
  • Secrets: Secure credential management
  • Namespaces: Environment isolation
  • Health Probes: Liveness and readiness checks

🌐 API Documentation

Service Endpoints

User Service (8084)

GET    /api/users/{id}              - Get user profile
POST   /api/users                   - Create user
PUT    /api/users/{id}              - Update user
DELETE /api/users/{id}              - Delete user
GET    /api/users/{id}/applications - Get user applications

Post Service (8082)

GET    /api/posts                   - Get all posts
POST   /api/posts                   - Create post
GET    /api/posts/{id}              - Get post by ID
PUT    /api/posts/{id}/boost        - Boost post
PUT    /api/posts/{id}/archive      - Archive post
DELETE /api/posts/{id}              - Delete post

Application Service (8080)

GET    /api/applications            - Get all applications
POST   /api/applications            - Submit application
GET    /api/applications/{id}       - Get application details
PUT    /api/applications/{id}/status - Update application status

Search Service (8083)

POST   /api/search                  - General search
POST   /api/search/filter           - Filtered search
POST   /api/search/location         - Location-based search
POST   /api/search/recent           - Recent searches

Notification Service (8081)

GET    /notifications/by/{userId}   - Get user notifications
POST   /notifications               - Create notification
PUT    /notifications/{id}          - Update notification
DELETE /notifications/{id}          - Delete notification

πŸ† Key Features

🎯 Business Features

  • Multi-tenant Architecture: Support for multiple organizations
  • Role-based Access: Job seekers and recruiters with different permissions
  • Advanced Search: AI-powered search with multiple strategies
  • Real-time Notifications: Instant updates for applications and posts
  • Post Management: Complete lifecycle management with boosting
  • Application Tracking: End-to-end application workflow
  • User Profiles: Comprehensive professional profiles

πŸ”§ Technical Features

  • Microservices Architecture: Scalable, maintainable service design
  • Event-Driven Communication: Asynchronous messaging with RabbitMQ
  • Polyglot Persistence: PostgreSQL and MongoDB for optimal data storage
  • Caching Strategy: Redis for performance optimization
  • Service Discovery: Dynamic service registration and discovery
  • Circuit Breaker: Fault tolerance and resilience patterns
  • Distributed Tracing: Request correlation across services
  • Comprehensive Monitoring: Full observability stack

πŸš€ DevOps Features

  • Containerization: Docker containers for all services
  • Orchestration: Kubernetes deployment configurations
  • Infrastructure as Code: Declarative infrastructure management
  • Monitoring & Alerting: Grafana dashboards and alerting
  • Log Aggregation: Centralized logging with Loki
  • Health Checks: Comprehensive service health monitoring
  • Auto-scaling: Kubernetes horizontal pod autoscaling

🀝 Contributing

This project demonstrates enterprise-level software development practices including:

  • Clean Architecture principles
  • SOLID design principles
  • Domain-Driven Design (DDD)
  • Test-Driven Development (TDD)
  • Continuous Integration/Continuous Deployment (CI/CD)
  • Infrastructure as Code (IaC)
  • Observability and monitoring best practices

πŸ“ž Contact

For questions about this project's architecture, implementation details, or technical decisions, please feel free to reach out.


Built with ❀️ using modern enterprise technologies and best practices

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 14