Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,25 @@
*.iml
out
gen

# Dependencies
node_modules/
backend/node_modules/
frontend/node_modules/

# Environment variables
.env
backend/.env
frontend/.env

# Build outputs
frontend/build/
frontend/dist/

# Logs
*.log
npm-debug.log*

# OS files
.DS_Store
Thumbs.db
223 changes: 223 additions & 0 deletions ARCHITECTURE.md

Large diffs are not rendered by default.

241 changes: 241 additions & 0 deletions IMPLEMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# Hiring Pipeline Feature - Implementation Summary

## Overview

This document summarizes the implementation of the hiring pipeline feature as specified in the GitHub issue.

## What Was Implemented

### Backend Changes

#### 1. Extended Data Models

**Application Model** (`backend/models/Application.js`)
- βœ… Added `status` field with enum values: `applied`, `phone_screen`, `onsite`, `offer`, `hired`, `rejected`
- βœ… Added `scorecard` object containing:
- `rating` (1-5 stars)
- `competencies` array (key, rating, notes)
- `summary` (overall feedback)
- `updatedAt` (timestamp)
- `updatedBy` (user reference for future use)
- βœ… Added `stageHistory` array to track all stage transitions with:
- `from` and `to` stages
- `changedAt` timestamp
- `changedBy` (user reference for future use)
- `note` (optional comment)

**Job Model** (`backend/models/Job.js`)
- βœ… Added `stages` array with default pipeline stages
- βœ… Added `emailTemplates` object for automated notifications with templates for:
- `phone_screen`
- `onsite`
- `offer`
- `rejected`

#### 2. New API Endpoints

**Applications Routes** (`backend/routes/applications.js`)
- βœ… `GET /api/applications` - Enhanced with query filters:
- `jobId` - Filter by specific job
- `stage` - Filter by current status
- `q` - Search by candidate name or cover letter
- `minRating` - Filter by minimum scorecard rating
- βœ… `GET /api/applications/:id` - Get single application details
- βœ… `PATCH /api/applications/:id/status` - Update application stage
- Validates stage against job's allowed stages
- Records stage transition in history
- Sends email notification if template is enabled
- βœ… `PATCH /api/applications/:id/scorecard` - Update application scorecard
- Saves rating, competencies, and summary
- Records update timestamp

#### 3. Email Notification System

**Email Utility** (`backend/utils/email.js`)
- βœ… Nodemailer integration for SMTP email sending
- βœ… Template variable replacement ({{candidateName}}, {{jobTitle}})
- βœ… Configurable via environment variables
- βœ… Graceful degradation when SMTP not configured

**Environment Configuration** (`backend/.env.example`)
- βœ… Added SMTP configuration variables:
- `SMTP_HOST`
- `SMTP_PORT`
- `SMTP_USER`
- `SMTP_PASS`

### Frontend Changes

#### 1. New Components

**PipelineBoard** (`frontend/src/components/PipelineBoard.js`)
- βœ… Kanban-style board with columns for each stage
- βœ… Drag-and-drop functionality using @dnd-kit
- βœ… Real-time search/filter by candidate name or email
- βœ… Optimistic UI updates with error handling
- βœ… Responsive grid layout

**ApplicationCard** (`frontend/src/components/ApplicationCard.js`)
- βœ… Compact card showing candidate info
- βœ… Displays scorecard rating if available
- βœ… Draggable using @dnd-kit/sortable
- βœ… Click to open detail dialog

**ApplicationDetailDialog** (`frontend/src/components/ApplicationDetailDialog.js`)
- βœ… Modal dialog with three tabs:
- Overview: Candidate details, job info, cover letter
- Scorecard: Rating and evaluation form
- Timeline: Stage history visualization
- βœ… Full-width responsive design

**ScorecardForm** (`frontend/src/components/ScorecardForm.js`)
- βœ… Overall rating (1-5 stars)
- βœ… Four default competencies:
- Communication
- Problem-Solving
- Technical Skills
- Culture Fit
- βœ… Individual ratings and notes for each competency
- βœ… Overall summary text field
- βœ… Save/Cancel actions

**TimelineList** (`frontend/src/components/TimelineList.js`)
- βœ… Visual timeline using @mui/lab Timeline components
- βœ… Shows stage transitions with timestamps
- βœ… Displays optional notes for each transition
- βœ… Formatted stage names (e.g., "Phone Screen" instead of "phone_screen")

**DroppableStage** (`frontend/src/components/DroppableStage.js`)
- βœ… Droppable container for each pipeline stage
- βœ… Visual feedback when hovering during drag
- βœ… Contains sortable context for applications

#### 2. Updated Components

**App.js**
- βœ… Added 'pipeline' view state
- βœ… Added handleViewPipeline function
- βœ… Integrated PipelineBoard component

**JobList.js**
- βœ… Added "Pipeline" button to each job card
- βœ… Calls onViewPipeline callback

#### 3. New Dependencies

- βœ… @mui/lab - Timeline components
- βœ… @mui/icons-material - Icons
- βœ… @dnd-kit/core - Drag and drop core
- βœ… @dnd-kit/sortable - Sortable items
- βœ… @dnd-kit/utilities - Utility functions

### Documentation

#### 1. README Updates
- βœ… Updated Features section with pipeline capabilities
- βœ… Updated Technology Stack
- βœ… Updated Directory Structure
- βœ… Added API Documentation section with all endpoints
- βœ… Added SMTP configuration instructions
- βœ… Added Pipeline Stages documentation

#### 2. Testing Guide
- βœ… Created comprehensive TESTING.md
- βœ… Backend API testing instructions with curl examples
- βœ… Frontend testing checklist
- βœ… Email notification testing guide
- βœ… Troubleshooting section

## Features Demonstrated

### 1. Drag and Drop
Users can drag application cards between pipeline stages, triggering automatic status updates and history recording.

### 2. Scorecards
Structured evaluation system with:
- Overall rating
- Individual competency ratings
- Detailed notes per competency
- Summary feedback
- Timestamp tracking

### 3. Timeline
Complete audit trail of all stage transitions with:
- Source and destination stages
- Timestamps
- Optional notes
- Future support for user attribution

### 4. Email Notifications
Automated email sending when:
- Application moves to a new stage
- Email template is configured for that stage
- Template is enabled
- Candidate has email address

### 5. Search and Filter
Real-time filtering of applications by:
- Candidate name
- Email address
- Current stage
- Minimum rating

## Testing Verification

### Backend
βœ… All models compile without errors
βœ… All routes have proper error handling
βœ… Email utility handles missing configuration gracefully
βœ… API endpoints follow REST conventions

### Frontend
βœ… Production build completes successfully
βœ… All components use proper TypeScript-compatible props
βœ… Material-UI components properly imported
βœ… Drag and drop integration complete
βœ… Responsive design implemented

## Usage Instructions

### For Recruiters

1. **View Pipeline**: Click "Pipeline" on any job listing
2. **Move Candidates**: Drag cards between stages
3. **Add Scorecards**: Click a card β†’ Scorecard tab β†’ Fill and save
4. **Review History**: Click a card β†’ Timeline tab
5. **Search**: Use search box to filter candidates

### For Administrators

1. **Configure Email**: Set SMTP credentials in backend/.env
2. **Customize Stages**: Modify stages array in Job model
3. **Create Templates**: Add email templates to job documents
4. **Monitor Usage**: Check stage history for insights

## Future Enhancements (Out of Scope)

These features were marked as out of scope for v1 but could be added later:

- Calendar booking UI with ICS invite generation
- Multi-org/tenant separation
- SSO integration
- External HRIS sync
- Bulk actions (email, stage move)
- CSV export of pipeline data
- Custom competency templates
- Advanced analytics and reporting

## Conclusion

All features from the original GitHub issue have been successfully implemented:

βœ… Hiring pipeline with customizable stages
βœ… Drag-and-drop Kanban board
βœ… Scorecard system with ratings and feedback
βœ… Stage history timeline
βœ… Email notifications on stage changes
βœ… Search and filter functionality
βœ… Complete API documentation
βœ… Testing guide

The implementation is production-ready and follows the existing codebase patterns and conventions.
Loading