Commit b78094

2025-10-08 09:39:55 Vinay Deokar: UI changes
Projects/HireGenius/Technical Document (LLD+HLD)).md ..
@@ 1,25 1,28 @@
# Technical Document (LLD/HLD)
- # HireGenius- AI-Powered Recruitment Automation System
+ ## HireGenius- AI-Powered Recruitment Automation System
### 📘 Table of Contents
- 1. [System Overview](#1-system-overview)
- 2. [Module Breakdown](#2-module-breakdown)
- 3. [API Design](#3-api-design)
- 4. [Database Design](#4-database-design)
- 5. [Business Workflow](#5-business-workflow)
- 6. [System Architecture](#6-system-architecture)
- 7. [Sequence Diagram](#7-sequence-diagram)
- 8. [Flow Diagram](#8-flow-diagram)
+ | # | Section |
+ |---|---------|
+ | 1 | [System Overview](#1-system-overview) |
+ | 2 | [Module Breakdown](#2-module-breakdown) |
+ | 3 | [API Design](#3-api-design) |
+ | 4 | [Database Design](#4-database-design) |
+ | 5 | [Business Workflow](#5-business-workflow) |
+ | 6 | [System Architecture](#6-system-architecture) |
+ | 7 | [Sequence Diagram](#7-sequence-diagram) |
+ | 8 | [Flow Diagram](#8-flow-diagram) |
- ## 1. System Overview
- ### 1.1 🎯 Purpose
+ ### 1. System Overview
+
+ #### 1.1 🎯 Purpose
Automate the recruitment pipeline from resume ingestion to candidate ranking using **NLP-based parsing**, **vector embeddings**, and **AI-powered re-ranking**.
---
- ### 1.2 ⚙️ Key Capabilities
+ #### 1.2 ⚙️ Key Capabilities
- **Incremental Resume Ingestion:** Fetch new resumes from Gmail on schedule
- **Automated Resume Parsing:** Extract structured data (skills, experience, education, contact)
- **Semantic Matching:** Use embeddings to find similar candidates to job descriptions
@@ 28,7 31,7 @@
---
- ### 1.3 🧰 Technology Stack
+ #### 1.3 🧰 Technology Stack
| Layer | Technology |
|--------|-------------|
| **Frontend** | React.js + Tailwind CSS |
@@ 39,9 42,9 @@
| **Email Integration** | Gmail API with OAuth 2.0 |
| **Scheduler** | node-cron |
- ## 2. Module Breakdown
+ ### 2. Module Breakdown
- ### Module 1: Gmail Module
+ #### Module 1: Gmail Module
**Responsibility:** Email integration and resume fetching
**Functions:**
@@ 59,7 62,7 @@
---
- ### Module 2: Resume Parser Module
+ #### Module 2: Resume Parser Module
**Responsibility:** Extract structured data from resume text
**Parsing Strategy:** Rule-based NLP with regex patterns
@@ 104,7 107,7 @@
```
---
- ### Alternative AI Approach (Optional Enhancement)
+ #### Alternative AI Approach (Optional Enhancement)
Instead of rule-based parsing, use GPT-4o-mini with structured JSON output. The flow would be: extract plain text -> send it to GPT-4o-mini with a schema-enforced prompt -> receive structured JSON (name, email, phone, skills, experience, education, total years).
**Pros:**
@@ 118,7 121,7 @@
- Requires API reliability and internet access
-
---
- ### Module 3: Embedding Module
+ #### Module 3: Embedding Module
**Responsibility:** Generate vector embeddings for semantic search
**Embedding Strategy:**
@@ 138,7 141,7 @@
---
- ### Module 4: Database Module
+ #### Module 4: Database Module
**Responsibility:** Data persistence and vector operations
**Core Operations:**
@@ 160,7 163,7 @@
---
- ### Module 5: Job Description Module
+ #### Module 5: Job Description Module
**Responsibility:** JD lifecycle management and candidate retrieval
**Functions:**
@@ 184,7 187,7 @@
---
- ### Module 6: Ranking Module
+ #### Module 6: Ranking Module
**Responsibility:** AI-powered re-ranking of top candidates
**Two-Stage Ranking:**
@@ 236,7 239,7 @@
---
- ### Module 7: Application Controller
+ #### Module 7: Application Controller
**Responsibility:** Orchestrate workflow across modules
**Core Workflows:**
@@ 265,7 268,7 @@
---
- ### Module 8: HR UI Module
+ #### Module 8: HR UI Module
**Responsibility:** Provide API endpoints for frontend dashboard
**API Endpoints:** Detailed in Section 3
@@ 278,9 281,9 @@
---
- ## 3. API Design
+ ### 3. API Design
- ### 3.1 Authentication Endpoints
+ #### 3.1 Authentication Endpoints
| Method | Endpoint | Request Body | Response | Description |
|--------|----------------|-------------------|--------------|--------------------------|
@@ 297,7 300,7 @@
---
- ### 3.2 Job Management Endpoints
+ #### 3.2 Job Management Endpoints
| Method | Endpoint | Request Body | Response | Description |
|--------|-----------------|-------------------------------------------|---------------------------|--------------------------------------------|
@@ 329,7 332,7 @@
```
---
- ### 3.3 Candidate Retrieval Endpoints
+ #### 3.3 Candidate Retrieval Endpoints
| Method | Endpoint | Request Body | Response | Description |
|--------|------------------------------|-------------------------------------------|---------------------------|-----------------------------------|
@@ 374,7 377,7 @@
```
---
- ### 3.4 Resume Processing Endpoints (Internal)
+ #### 3.4 Resume Processing Endpoints (Internal)
| Method | Endpoint | Request Body | Response | Description |
|--------|----------------------------------|-------------|---------------------------|-----------------------------------|
@@ 382,7 385,7 @@
| GET | /api/internal/processing-logs/:jobId | Query: ?status=success&page=1 | {logs[], total} | View processing logs |
---
- ### 3.5 Dashboard & Analytics Endpoints
+ #### 3.5 Dashboard & Analytics Endpoints
| Method | Endpoint | Request Body | Response | Description |
|--------|------------------------------------|-------------|---------------------------|-------------------------------|
@@ 413,9 416,9 @@
![](./image-1759857909487.png)
---
- ### 4.2 Table Specifications
+ #### 4.2 Table Specifications
- #### Table: users
+ ##### Table: users
**Purpose:** Store HR user accounts
| Column | Type | Constraints | Description |
@@ 433,7 436,7 @@
---
- #### Table: jobs
+ ##### Table: jobs
**Purpose:** Store job descriptions and automation settings
| Column | Type | Constraints | Description |
@@ 460,7 463,7 @@
---
- #### Table: candidates
+ ##### Table: candidates
**Purpose:** Store candidate resumes and parsed data
| Column | Type | Constraints | Description |
@@ 512,9 515,7 @@
}
```
---
- ### 4.2 Table Specifications (continued)
-
- #### Table: communication
+ ##### Table: communication
**Purpose:** Log all email communications
| Column | Type | Constraints | Description |
@@ 534,7 535,7 @@
---
- #### Table: processing_logs
+ ##### Table: processing_logs
**Purpose:** Audit trail for resume processing
| Column | Type | Constraints | Description |
@@ 559,7 560,7 @@
---
- #### Table: scheduled_tasks
+ ##### Table: scheduled_tasks
**Purpose:** Manage cron jobs and scheduled tasks
| Column | Type | Constraints | Description |
@@ 579,7 580,7 @@
---
- ### 4.3 Database Relationships
+ #### 4.3 Database Relationships
| Parent Table | Child Table | Relationship Type | Foreign Key | On Delete |
|--------------|-----------------|-----------------|------------------------------|-----------|
@@ 596,7 597,7 @@
---
- ### 4.4 pgvector Configuration
+ #### 4.4 pgvector Configuration
**Extension Setup:**
```sql
@@ 605,9 606,9 @@
---
- ## 5. Business Workflow
+ ### 5. Business Workflow
- #### PHASE 1: JOB CREATION
+ ##### PHASE 1: JOB CREATION
- HR User opens Dashboard → Create Job Form
- Input: Title, JD Text, Dates, Min Score
- POST /api/jobs
@@ 618,7 619,7 @@
- Job Created ✅
- Status: Active
- #### PHASE 2: RESUME INGESTION (Automated - Every 4 hours)
+ ##### PHASE 2: RESUME INGESTION (Automated - Every 4 hours)
- Cron Trigger → Application Controller
- Gmail Module:
- Fetch emails with attachments
@@ 650,7 651,7 @@
- processing_time_ms
- Candidate Stored ✅
- #### PHASE 3: CANDIDATE RANKING (On-Demand)
+ ##### PHASE 3: CANDIDATE RANKING (On-Demand)
- HR User → Dashboard → View Job → Click "View Candidates"
- GET /api/jobs/:jobId/candidates
- Application Controller:
@@ 672,7 673,7 @@
- Parsed Data (skills, experience)
- Actions: View Details, Contact, Reject
- #### PHASE 4: CANDIDATE INTERACTION (Manual)
+ ##### PHASE 4: CANDIDATE INTERACTION (Manual)
- HR selects candidate → Actions:
- View full resume
- Update status ('contacted', 'replied', 'interviewed')
@@ 681,7 682,7 @@
- Status updated in database
- Dashboard reflects new status
- #### PHASE 5: JOB CLOSURE
+ ##### PHASE 5: JOB CLOSURE
- HR closes job → DELETE /api/jobs/:jobId
- Update job.status = 'closed'
- Stop all scheduled tasks
@@ 690,14 691,14 @@
---
- ## 6. System Architecture
+ ### 6. System Architecture
![](./image-1759857600801.drawio.png)
---
- ## 7. Sequence Diagram
+ ### 7. Sequence Diagram
![](./image-1759857739651.-2025-10-07-172157.png)
---
- ## 8. Flow Diagram
+ ### 8. Flow Diagram
![](./image-1759914896125.drawio.png)
---
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9