|
| 1 | +# 💻 ZidioConnect Backend Microservices |
| 2 | + |
| 3 | +This repository contains the backend source code for the ZidioConnect Job Portal, implemented as a **Spring Cloud Microservices Architecture**. All services are developed in Java, communicate via Eureka, and are secured using JWT. |
| 4 | + |
| 5 | +## 🧱 Project Architecture & Technology Stack |
| 6 | + |
| 7 | +The system is composed of 16 highly specialized services. All communication is routed through the central **API Gateway**. |
| 8 | + |
| 9 | +### Core Technologies |
| 10 | +| Component | Technology | Role | |
| 11 | +| :--- | :--- | :--- | |
| 12 | +| **Language** | Java 8 (Spring Boot 2.7.x) | Primary development language. | |
| 13 | +| **Persistence** | MySQL / Spring Data JPA | Relational Database for all data persistence. | |
| 14 | +| **Discovery** | Eureka Server | Centralized Service Registry (Service IPs/Ports). | |
| 15 | +| **Routing** | API Gateway (8080) | Single entry point for the frontend; handles security and load balancing. | |
| 16 | +| **Configuration** | Config Server (8888) | Centralized management of configuration files (YAML/Properties). | |
| 17 | +| **Security** | JWT (JSON Web Tokens) | Stateless authentication and cross-service authorization. | |
| 18 | + |
| 19 | +### Service Map |
| 20 | +| Service Name | Port | Function | |
| 21 | +| :--- | :--- | :--- | |
| 22 | +| **AUTH-SERVICE** | `8081` | Handles User Registration, Login, and JWT Token Issuance. | |
| 23 | +| **API-GATEWAY** | `8080` | External Access Point / Router. | |
| 24 | +| **CONFIG-SERVER** | `8888` | Configuration Source for all services. | |
| 25 | +| **RECRUITER-SERVICE** | `8085` | Recruiter Profile and Management (Optimized Search). | |
| 26 | +| **STUDENT-SERVICE** | `8083` | Student Profile and Management (Optimized Caching). | |
| 27 | +| **ADMIN-SERVICE** | `8090` | Admin CRUD and System Oversight. | |
| 28 | +| **SYSTEM-USER-SERVICE**| `8082` | Core User Management for Admins. | |
| 29 | +| **JOBPOST-SERVICE** | `8084` | Job Creation and Listing. | |
| 30 | +| **APPLICATION-SERVICE**| `8086` | Application Submission and Tracking. | |
| 31 | +| **ANALYTICS-SERVICE** | `8093` | Metrics and Reporting. | |
| 32 | +| **EMAIL-SERVICE** | `8094` | Asynchronous Email Sending. | |
| 33 | +| **FILEUPLOAD-SERVICE**| `8092` | Resume/File Storage. | |
| 34 | +| **(Other Services)** | `8087-8091` | Subscription, Payment, Paid-Status, Notification, Employee services. | |
| 35 | + |
| 36 | +## 🛠️ Local Development Setup |
| 37 | + |
| 38 | +To run the full microservice suite, services **must** be started in the correct sequence. |
| 39 | + |
| 40 | +### 1. Prerequisites Check |
| 41 | +* **Java 8** and **Maven** installed. |
| 42 | +* **MySQL Server** running with the correct database schema created (e.g., `authdb`, `recruiterdb`, etc.). |
| 43 | +* **Internet connection** (to fetch configurations from the Config Server's Git Repo). |
| 44 | + |
| 45 | +### 2. Startup Sequence (The Golden Rule) |
| 46 | + |
| 47 | +Use `cd <service-name>` followed by `mvn spring-boot:run` for each service. |
| 48 | + |
| 49 | +1. **START INFRASTRUCTURE FIRST (Required):** |
| 50 | + * **1. Eureka Server:** Start the `eureka-server` (`:8761`). |
| 51 | + * **2. Config Server:** Start the `config-server` (`:8888`). |
| 52 | + |
| 53 | +2. **START GATEWAY & AUTHENTICATION:** |
| 54 | + * **3. Auth Service:** Start the `auth-service` (`:8081`). (Issues JWTs). |
| 55 | + * **4. API Gateway:** Start the `api-gateway` (`:8080`). (Entry Point). |
| 56 | + |
| 57 | +3. **START FUNCTIONAL SERVICES:** |
| 58 | + * **5. Start All Remaining Services:** (`recruiter-service`, `student-service`, `admin-service`, etc.). |
| 59 | + |
| 60 | +## 🔐 Testing and Security |
| 61 | + |
| 62 | +All tests must be conducted via the **API Gateway** on port **8080**. |
| 63 | + |
| 64 | +1. **Authentication:** Use `POST /api/auth/register?role=ROLE_ADMIN` to get a fresh token. |
| 65 | +2. **Access:** Use the **Bearer Token** for all subsequent calls. The authorization for each service is enforced by the **`@PreAuthorize`** annotations. |
| 66 | + |
| 67 | +### 🛡️ File Upload Security |
| 68 | +The **File Upload Service** has been hardened: |
| 69 | +* **Allowed Extensions**: `pdf`, `doc`, `docx`, `jpg`, `jpeg`, `png` ONLY. |
| 70 | +* **Path Sanitization**: Filenames are sanitized to prevent path traversal. |
| 71 | +* **Relative Paths**: The API returns relative filenames (e.g., `uuid_filename.pdf`) instead of improper absolute server paths. |
| 72 | + |
| 73 | +--- |
0 commit comments