{"id":27180045,"url":"https://github.com/1hashcode/employee-management-microservices","last_synced_at":"2026-04-12T05:34:02.784Z","repository":{"id":286877578,"uuid":"962213481","full_name":"1HashCode/Employee-Management-Microservices","owner":"1HashCode","description":"An Employee Management System with 5 microservice, build using Java, Spring boot and Docker. Implemented technologies like Grpc, Kafka, Docker, Jwt, Cloud Gateway. ","archived":false,"fork":false,"pushed_at":"2025-04-08T19:46:25.000Z","size":528,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T20:25:51.529Z","etag":null,"topics":["docker","grpc","java","jwt-authentication","kafka","microservices-architecture","postgresql","repository-service","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1HashCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security-service/.gitattributes","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-07T20:23:35.000Z","updated_at":"2025-04-08T19:46:29.000Z","dependencies_parsed_at":"2025-04-08T20:36:41.035Z","dependency_job_id":null,"html_url":"https://github.com/1HashCode/Employee-Management-Microservices","commit_stats":null,"previous_names":["1hashcode/employee-management-microservices"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1HashCode%2FEmployee-Management-Microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1HashCode%2FEmployee-Management-Microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1HashCode%2FEmployee-Management-Microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1HashCode%2FEmployee-Management-Microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1HashCode","download_url":"https://codeload.github.com/1HashCode/Employee-Management-Microservices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054497,"owners_count":21040016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","grpc","java","jwt-authentication","kafka","microservices-architecture","postgresql","repository-service","spring-boot"],"created_at":"2025-04-09T14:25:23.414Z","updated_at":"2025-12-30T23:05:09.367Z","avatar_url":"https://github.com/1HashCode.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏬 Employee Management System Microservices\n---\n\n#### 🗂️ A scalable and modular Employee Management System built using microservices architecture. \nThe system consists of 5 independently deployable services, documented with `OpenAPI`, \nusing `gRPC` for synchronous and `Kafka` for asynchronous messaging and containerized using `Docker` for easy orchestration and deployment.\n\n---\n## ✨Key Highlights\n- 🔐 Built secure and efficient `REST APIs` using Spring Boot with `JWT-based authentication`\n- ⚡ Employed `gRPC` for fast inter-service communication and 📩 `Apache Kafka` for asynchronous messaging\n- 🛡️ Created a centralized `API Gateway` to handle routing, security, and request forwarding across services\n- 🐳 Used `Docker` to containerize each service and `Docker Compose` to orchestrate all services \n- 🛢️ Leveraged `PostgreSQL` as the primary database, integrated via Docker containers\n- 📃 Documented each service using `OpenAPI (Swagger)` for easy collaboration and maintenance\n- 🧱 Designed the system for scalability, security, and independent service deployment\n---\n## 🧩 Microservices Overview\nThe system follows a microservices architecture with independently deployable services, each having a specific responsibility:\n\n### 🛡️ API Gateway\n\u003cdetails\u003e\n\u003csummary\u003e  Click to Know More \u003c/summary\u003e\n  \n  \u003cbr\u003e\n  \n- Acts as the entry point for all client requests.\n- Uses a custom `GatewayFilter` to validate JWT tokens and forward requests securely to appropriate microservices.\n- Ensures centralized security and request routing.\n\n\u003c/details\u003e\n\n\n\n### 🔐 Security Service\n\u003cdetails\u003e\n\u003csummary\u003e Click to Know More \u003c/summary\u003e\n  \n  \u003cbr\u003e\n  \n- Handles authentication and authorization using JWT (JSON Web Tokens).\n- Provides endpoints for token generation and validation.\n- Persists authentication-related data in a PostgreSQL database (`security-service-DB`).\n\n\u003c/details\u003e\n\n\n\n\n\n\n### 👨‍💼 Employee Service\n\u003cdetails\u003e\n\u003csummary\u003e  Click to Know More \u003c/summary\u003e\n  \n  \u003cbr\u003e\n  \n- Responsible for CRUD operations on employee data.\n- On creation of an employee:\n  - Sends a gRPC request to `performance-service` to create a performance record.\n  - Publishes an event on the Kafka `employee topic` for asynchronous processing.\n  - Uses PostgreSQL (`employee-service-DB`) for data persistence.\n- On deletion of an employee:\n  - deletes the employee record from `employee-service-DB`\n  - Sends a gRPC request to `performance-service` to delete a performance record.\n\n\u003c/details\u003e\n\n\n\n### 📊 Performance Service\n\u003cdetails\u003e\n\u003csummary\u003e Click to Know More \u003c/summary\u003e\n  \n  \u003cbr\u003e\n  \n- Manages performance reviews of employees.\n- Supports updating, retrieving performance data.\n- Accepts gRPC calls from the `employee-service` for creation and deletion of performance record.\n- Data is stored in PostgreSQL (`performance-service-DB`).\n\n\u003c/details\u003e\n\n\n\n\n\n### 📈 HR Analytics Service (Demo Service)\n\u003cdetails\u003e\n\u003csummary\u003e  Click to Know More \u003c/summary\u003e\n  \n  \u003cbr\u003e\n  \n- Demonstrates event-driven microservice communication.\n- Consumes create employee events from the Kafka `employee-topic`.\n- Showcases real-time data syncing using Kafka-based message consumption.\n\n\u003c/details\u003e\n\n\n\n### 🗄️ Databases \u0026 Message Brokers\n\u003cdetails\u003e\n  This system uses Dockerized databases and Kafka for seamless integration and scaling.\n  \n\u003csummary\u003e  Click to Know More \u003c/summary\u003e\n  \n  \u003cbr\u003e\n  \n- #### 🗃️ PostgreSQL Containers\n  Each core service has its own dedicated PostgreSQL database container:\n  - `security-service-DB` – Stores valid authenticated users from SQL script.\n  - `employee-service-DB` – Stores employee information and records.\n  - `performance-service-DB` – Stores performance-related data for employees.\n\n#### 🔁 Kafka Infrastructure\n- Kafka Broker runs inside a container to handle real-time messaging.\n- Maintains a topic named `employee-topic` which:\n  - Receives events from `employee-service` on employee creation.\n  - Is consumed by services like `hr-analytics-service` for analytics and further processing.\n\n\u003c/details\u003e\n\n---\n\n## 🧩 Project Dependencies\nThis project uses a robust set of tools and libraries that enable secure, scalable, and maintainable development using the microservices architecture.   \n**Here's a breakdown of the core dependencies:**\n\n\u003cdetails\u003e\n\u003csummary\u003e  Click to Know More \u003c/summary\u003e\n  \n  \u003cbr\u003e\n  \n- 🖥️ Backend Frameworks \u0026 Libraries\n  - `Spring Boot` — Simplifies the bootstrapping and development of Spring-based applications with minimal configuration.\n  - `Spring DevTools` — Enables hot reloading and automatic restarts for a faster development experience.\n  - `Spring Security` — Provides comprehensive security features, including authentication, authorization, and protection against common vulnerabilities.\n  - `Spring Data JPA` — Simplifies database operations using Java Persistence API with minimal boilerplate code.\n  - `Spring Cloud Gateway` — A lightweight API Gateway built on Spring Boot for routing, filtering, and securing requests across services.\n  - `Spring Web` — Supports RESTful API development using Spring MVC.\n\n- 🔐 Security\n  - `Validation` — Ensures input data adheres to expected formats using annotations like @Valid and @NotNull.\n  - `JWT (JSON Web Token)` — Used for securely transmitting information between parties, especially for stateless authentication.\n    \n- ⚡ Inter-Service Communication\n  - `Protobuf (Protocol Buffers)` — A language-neutral, platform-neutral extensible mechanism for serializing structured data (used in gRPC).\n  - `gRPC` — A high-performance, open-source universal RPC framework for inter-service communication.\n\n- 📡 Event Streaming\n  - `Kafka` — Used for distributed event streaming; enables asynchronous communication between microservices using topics.\n\n- 🐳 Containerization\n  - `Docker` — Containerizes each service for consistent environments across development and production.\n  - `Docker Compose` — Orchestrates multiple containers including microservices, databases, and Kafka broker using a single YAML file.\n\n- 🛠️ Build \u0026 Dependency Management\n  - `Maven` — Handles project builds, dependencies, and plugin management using a centralized pom.xml.\n\n- 🛢️ Database \u0026 Drivers\n  - `PostgreSQL Driver` — JDBC driver for connecting to PostgreSQL databases used by microservices.\n\n- 📄 API Documentation\n  - `OpenAPI / Swagger` — Automatically generates interactive API documentation for REST endpoints.\n\n\u003c/details\u003e\n\n\n---\n\n## Architecture Diagram\n![EMS Architecture](images/Architecture_Diagram.png)\n\n---\n\n## 📬 API Documentation Snapshot\nThis image showcases the OpenAPI (Swagger) documentation for the Employee Management System.\nIt provides a visual overview of the available REST endpoints, request/response structures, and service contracts for each microservice.\nThe documentation is generated automatically and helps developers and testers interact with the APIs efficiently during development and debugging.\n\n### Auth Requests\n![auth-requests](images/auth-controller-requests.png)\n\n### Employee Requests\n![employee-requests](images/employee-controller-requests.PNG)\n\n### Performance Requests\n![performance-requests](images/performance-controller-requests.PNG)\n\n---\n\n## 📬 API Request Collection with Postman\nA complete and well-structured Postman collection (`Employee_Management_Service_API_Requests.postman_collection.json file`) is included in the project. It contains all the necessary API requests categorized by service, making it easy for developers or testers to interact with the system's endpoints quickly.\nSimply import the collection into Postman and start testing the microservices seamlessly.\n\n---\n\n## 🐳 Docker Compose Integration\n`Docker Compose` is used to streamline the orchestration of all microservices, supporting containers, and environments required for this project. It allows us to define and manage multiple containers in a single `YAML` file, ensuring all services start in the correct order with appropriate configurations and ports.\n\n### ✅ Services Managed via docker-compose.yml:\n- API Gateway\n- Security Service\n- Employee Service\n- Performance Service\n- HR Analytics Service\n- PostgreSQL Containers:\n  - security-service-DB\n  - employee-service-DB\n  - performance-service-DB\n- Kafka Broker with employee-topic\n\n▶️ Running the Entire Project:\nTo build and start all services, run:\n\u003cpre\u003edocker-compose up --build\u003c/pre\u003e\nThis command:\n- Builds all the images defined in the docker-compose.yml\n- Creates the containers\n- Runs them concurrently with appropriate networks, environment variables, and port mappings\n\nTo stop all running containers:\n\u003cpre\u003e docker-compose down \u003c/pre\u003e\n\n---\n\n## 🛠️Steps to Run the Project From GitHub\n\n1. Clone the Repository\n\u003cpre\u003e git clone https://github.com/your-username/your-repo.git\ncd your-repo \u003c/pre\u003e\n\n2. Make Sure Docker and Docker Compose Are Installed\n\u003cpre\u003edocker --version\ndocker-compose --version\u003c/pre\u003e\n\n3. Turn on the docker engine\n\n4. Run the Whole Project with Docker Compose\n\u003cpre\u003edocker-compose up --build\n\u003c/pre\u003e\n\n5. Import the project's Postman collection into Postman to access ready-made requests.\n\n6. Stop the Project (when done)\n\u003cpre\u003edocker-compose down\n\u003c/pre\u003e\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1hashcode%2Femployee-management-microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1hashcode%2Femployee-management-microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1hashcode%2Femployee-management-microservices/lists"}