Recent Updates

Latest improvements and new features added to the BulaWork platform. Last updated: February 2026

Version 1.5 - February 2026

Mock Interview System

  • Candidate Mock Interviews: Practice interviews with AI interviewer for real job postings before the actual interview
  • Resume Session Support: Pause and resume incomplete mock interviews with time tracking
  • AI-Powered Feedback: Receive detailed performance analysis, strengths, areas for improvement, and recommendations
  • Credit System: 1 credit per mock interview session with configurable pricing

Mobile Responsiveness

  • Mock Interview Room: Full mobile responsive design with touch-friendly controls (44px+ touch targets)
  • Portrait/Landscape Support: Optimized layouts for both mobile orientations
  • iOS Smooth Scrolling: Added -webkit-overflow-scrolling: touch for native scroll feel
  • Extra Small Devices: Additional breakpoints at 400px for smaller screens
  • Take Exam Page: Scrollable and responsive exam interface
  • Interview Report: Mobile-optimized feedback and transcript display

Bulawork AI Assistant Improvements

  • Real-time Database Integration: AI assistant now uses live data from 19 data sections including:
    • Active Jobs & Application Metrics
    • AI Interview Data & Pipeline Analytics
    • Skills Analytics & Recent Hires
    • Job Performance Metrics & Bottleneck Analysis
  • Markdown Rendering: Clean response formatting with proper HTML rendering (no raw ##, **, - symbols)
  • Data Integrity: Strict rules preventing fake/placeholder data - only real database values
  • Branding: Renamed from "AI HR Assistant" to "Bulawork AI"

Performance & Database

  • API Timeout Fix: Increased cURL timeout from 60 to 180 seconds for long interview analysis
  • Token Limits: Added max_tokens: 4000 for AI responses to prevent overflows
  • Transcript Truncation: Long interview transcripts (15,000+ chars) now truncated for processing
  • Deterministic AI Analysis: Set temperature: 0 for consistent re-analysis results
  • 30-Day Chat Cleanup: Automatic deletion of old AI chat history via cron job

Exam Creator Improvements

  • Job Skills Integration: Skills now fetched from job_skills table with proper fallbacks
  • Enhanced Data Retrieval: Falls back to required_skills, requirements, and description fields
  • Responsibilities Extraction: Automatically extracts responsibilities from job descriptions when not explicitly set

AI Interview Analysis

  • Removed Candidate Ranking: Eliminated unrealistic percentile rankings when no comparison data exists
  • Incomplete Interview Detection: Low scores (15%) for interviews under 1 minute with minimal responses
  • Fair Scoring: Context-sensitive ratings based on actual interview content

Files Modified

FileChanges
candidate/mock-interview-room.phpMobile responsive CSS, landscape support
candidate/mock-interviews.phpMobile responsive, extra small device breakpoints
candidate/mock-interview-report.phpScrollable transcript, mobile optimizations
take-exam.phpMobile scrollability, responsive layout
hr/ai-assistant.phpMarkdown formatter, title branding
api/hr/ai-assistant.phpReal-time data sections, formatting rules
hr/exam-creator.phpJob skills integration from job_skills table
config/api.phpIncreased API timeout to 180 seconds
api/ai-interview/analyze-interview.phpToken limits, transcript truncation, deterministic analysis
cron/chat-cleanup.phpNew cron job for 30-day chat retention

System Overview

BulaWork is a comprehensive AI-powered job recruitment platform designed for the Fiji job market. The platform connects job seekers (candidates) with employers (HR/companies) through an intelligent matching system enhanced by artificial intelligence capabilities.

Key Features

AI-Powered Matching

Intelligent candidate-job matching using OpenAI GPT integration for resume analysis and job description generation.

Enterprise Security

AES-256-GCM document encryption, OTP authentication, rate limiting, and comprehensive security headers.

Multi-Role System

Three distinct user roles: Candidates, HR Managers, and Administrators with role-based access control.

Exam System

AI-generated assessment exams with proctoring, monitoring, and automated scoring capabilities.

Mobile Ready

RESTful mobile API for native Android application with token-based authentication.

Smart Notifications

Job alerts, application status updates, interview scheduling, and email notifications.

System Architecture

Presentation Layer (Frontend)

PHP Views + HTML5 + CSS3 + Vanilla JavaScript | Responsive Design | Font Awesome Icons | Chart.js

Application Layer (Backend)

PHP 8.x | Session Management | CSRF Protection | Rate Limiting | Input Validation

API Layer

RESTful JSON APIs | Authentication Middleware | Mobile API Support | OpenAI Integration

Data Layer

MySQL/MariaDB | PDO with Prepared Statements | 86 Database Tables | Foreign Key Constraints

Security Layer

AES-256-GCM Encryption | Argon2ID Password Hashing | OTP 2FA | Security Headers | CORS

Technology Stack

ComponentTechnologyPurpose
BackendPHP 8.xServer-side processing and API
DatabaseMySQL/MariaDBData persistence with 86 tables
FrontendHTML5, CSS3, JavaScriptUser interface and interactions
AI IntegrationOpenAI GPT APIResume analysis, job matching, exam generation
EmailSMTP (Gmail/Custom)Transactional emails and notifications
EncryptionOpenSSL (AES-256-GCM)Document and file encryption
Password HashingArgon2ID / BCRYPTSecure password storage
IconsFont Awesome 6UI icons and visual elements
ChartsChart.jsAnalytics and data visualization

Database Schema

The BulaWork database consists of 86 tables organized into logical groups for users, companies, jobs, applications, AI features, exams, and security.

Core Database Tables

User Management (7 tables)

TableDescriptionKey Fields
usersMain user accountsuser_id, email, password_hash, role, status, otp_enabled
user_profilesExtended user infofirst_name, last_name, phone, avatar_url, city, country, bio
candidatesJob seeker profilesresume_url, experience_years, current_position, availability
candidate_skillsCandidate skillsskill_name, proficiency, years_experience
candidate_educationEducation historyinstitution, degree, field_of_study, start_date, end_date
candidate_experienceWork experiencecompany, position, description, start_date, end_date
candidate_qualificationsCertificationstitle, issuing_organization, document_url, encryption_id

Company Management (8 tables)

TableDescriptionKey Fields
companiesCompany profilescompany_name, company_email, logo_url, industry, status
company_branchesBranch locationsbranch_name, address, city, latitude, longitude
company_creditsAI credit balancetotal_credits, used_credits, remaining_credits
company_subscriptionsSubscription plansplan_id, status, billing_cycle, start_date, end_date
company_tool_accessAI tool permissionstool_id, is_enabled, custom_credit_cost

Jobs & Applications (10 tables)

TableDescriptionKey Fields
jobsJob listingstitle, description, requirements, salary_min, salary_max, deadline
applicationsJob applicationsjob_id, candidate_id, status, cover_letter, ai_fit_score
application_documentsSubmitted documentsdocument_url, encryption_id, document_type
application_answersScreening Q&Aquestion_id, question_text, answer_text
interviewsInterview schedulingscheduled_date, interview_type, meeting_link, status
saved_jobsBookmarked jobscandidate_id, job_id, saved_at
job_required_documentsRequired uploadsdocument_name, is_mandatory, allowed_types

AI Features (8 tables)

TableDescriptionKey Fields
ai_toolsAvailable AI toolstool_name, tool_slug, credit_cost, category
ai_subscription_plansPricing plansplan_name, monthly_credits, price_monthly, features
ai_candidate_analysisCandidate scoringoverall_score, skills_score, strengths, recommendation
ai_chat_sessionsAI chat historysession_title, context_type, is_active
ai_interview_questionsGenerated questionsquestion_text, question_type, difficulty

Exam System (7 tables)

TableDescriptionKey Fields
examsExam definitionsexam_title, total_questions, time_per_question, passing_score
exam_questionsMCQ questionsquestion_text, option_a-d, correct_answer, points
exam_sessionsCandidate sessionssession_token, started_at, status, tab_switches
exam_responsesAnswer submissionsselected_answer, is_correct, time_taken
exam_resultsFinal scoresscore_percentage, passed, ai_analysis
exam_monitoringProctoring eventsevent_type, screenshot_url, event_data

Security Tables (6 tables)

TableDescriptionKey Fields
email_verificationsOTP codesverification_code, purpose, expires_at, attempts
trusted_devicesRemembered devicesdevice_fingerprint, device_name, trusted_until
otp_audit_logOTP activity logaction_type, success, ip_address
password_reset_tokensReset tokenstoken, expires_at, used
api_rate_limitsRate limitingidentifier, request_count, window_start
activity_logsUser activityaction, entity_type, details, ip_address

API Reference

Authentication APIs

Location: /api/auth/

POST /api/auth/login.php

Authenticate user with email/password. Supports OTP verification flow.

// Request
{
    "email": "user@example.com",
    "password": "securepassword",
    "remember": true,
    "trust_device": false
}

// Response (Success)
{
    "success": true,
    "requires_otp": false,
    "redirect_url": "/hr/dashboard.php",
    "message": "Welcome back, John!"
}

// Response (OTP Required)
{
    "success": true,
    "requires_otp": true,
    "email": "user@example.com"
}
POST /api/auth/register.php

Register new candidate or employer account with email verification.

POST /api/auth/send-otp.php

Send OTP verification code to user's email.

POST /api/auth/verify-otp.php

Verify OTP code and complete login. Optionally trust device.

POST /api/auth/forgot-password.php

Request password reset link via email.

Candidate APIs

Location: /api/candidate/ - Requires authenticated candidate session

EndpointMethodDescription
update-profile.phpPOSTUpdate candidate profile information
upload-resume.phpPOSTUpload resume with AES-256 encryption
upload-avatar.phpPOSTUpload profile photo
add-skill.phpPOSTAdd skill to profile
add-education.phpPOSTAdd education record
add-experience.phpPOSTAdd work experience
apply.phpPOSTSubmit job application
save-job.phpPOSTBookmark/unbookmark job
job-alerts.phpPOSTManage job alert preferences
ai-analysis.phpPOSTGet AI-powered profile analysis
get-qualifications.phpGETRetrieve uploaded qualifications

HR APIs

Location: /api/hr/ - Requires authenticated HR session

EndpointMethodDescription
dashboard-data.phpGETFetch dashboard statistics and metrics
job-action.phpPOSTCreate, update, or delete job postings
get-job-applicants.phpGETGet applicants for a specific job
update-application-status.phpPOSTChange application status
candidate-analysis.phpPOSTAI-powered candidate analysis and ranking
schedule-interview.phpPOSTSchedule interview with candidate
generate-job-description.phpPOSTAI-generate job description
generate-interview-questions.phpPOSTAI-generate interview questions
exam-questions.phpPOSTCreate/manage exam questions
parse-resume.phpPOSTExtract data from uploaded resume
ai-assistant.phpPOSTAI recruiting assistant chat
request-credits.phpPOSTRequest additional AI credits

Admin APIs

Location: /api/admin/ - Requires admin authentication

EndpointMethodDescription
get-stats.phpGETPlatform-wide statistics
create-user.phpPOSTCreate new user account
update-user.phpPOSTUpdate user details
delete-user.phpDELETESoft-delete user account
approve-company.phpPOSTApprove/reject company registration
subscription-management.phpPOSTManage company subscriptions
update-smtp-settings.phpPOSTConfigure email settings
file-manager.phpPOSTManage uploaded files

Mobile APIs

Location: /api/mobile/ - Token-based authentication for native apps

EndpointMethodDescription
auth.phpPOSTMobile login/register with access tokens
jobs.phpGETBrowse and search jobs
applications.phpPOST/GETSubmit and view applications
profile.phpPOST/GETManage candidate profile
companies.phpGETView company profiles

Security Measures

Implemented Security Features

Password Security

Argon2ID hashing (or BCRYPT fallback) with secure cost parameters. Password requirements enforced (minimum 8 characters).

Two-Factor Authentication (OTP)

Email-based OTP verification with 6-digit codes. Trusted device support to skip OTP on known devices. Rate limiting prevents brute force attacks.

Document Encryption

AES-256-GCM encryption for all uploaded documents (resumes, qualifications, attachments). Per-document key derivation using HKDF. Secure token-based document access.

CSRF Protection

Token-based CSRF protection on all forms. Timing-safe token comparison. Automatic token regeneration.

SQL Injection Prevention

All database queries use PDO prepared statements with parameterized queries. Input validation and sanitization layer.

XSS Prevention

Output encoding with htmlspecialchars(). Content Security Policy headers. Script tag removal from user input.

Rate Limiting

API rate limiting with configurable thresholds. IP-based tracking with sliding window. 429 Too Many Requests responses with Retry-After headers.

Security Headers

X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Content-Security-Policy, Strict-Transport-Security (HSTS), Referrer-Policy.

Authentication Flow

1
User Submits Credentials

Email and password sent via POST to /api/auth/login.php with CSRF token validation.

2
Credential Verification

Email lookup in database, password_verify() against Argon2ID hash. Account status checked (active, pending, suspended).

3
OTP Check (if enabled)

If user has OTP enabled and device is not trusted, 6-digit OTP is sent to email. User redirected to OTP verification form.

4
Session Creation

Session regenerated to prevent fixation. User ID, role, and name stored in session. User agent fingerprint recorded for hijacking detection.

5
Role-Based Redirect

Candidates → /candidate/dashboard.php, HR → /hr/dashboard.php, Admins → /admin/dashboard.php

Document Encryption System

All sensitive documents (resumes, qualifications, application attachments) are encrypted using AES-256-GCM before storage.

// Encryption Process (config/encryption.php)
1. Generate unique document ID for key derivation
2. Derive document-specific key using HKDF from master key
3. Generate random 12-byte IV (nonce)
4. Encrypt with AES-256-GCM (authenticated encryption)
5. Store: [IV (12 bytes)] + [Tag (16 bytes)] + [Ciphertext]
6. Add .enc extension to filename

// Decryption Process
1. Extract IV, Tag, and Ciphertext from file
2. Derive document key using stored document ID
3. Decrypt and verify authentication tag
4. Return plaintext only if authentication passes

Candidate Features

Dashboard

Overview of applications, saved jobs, profile completion score, AI match score, and upcoming interviews.

Job Search

Browse jobs with filters (location, department, salary, job type). Real-time search and sort options.

Profile Builder

Complete profile with skills, education, experience, qualifications, and documents. Progress gamification.

Resume Upload

Encrypted resume storage. Support for PDF, DOC, DOCX formats. AI-powered resume parsing.

Applications

Apply to jobs with cover letter, answer screening questions, upload required documents.

Saved Jobs

Bookmark interesting jobs for later. Expiry notifications. Quick apply from saved list.

Job Alerts

Set up alerts for specific job titles. Email notifications when matching jobs are posted.

Mock Interviews

Practice AI interviews for real job postings. Get feedback, pause/resume sessions, improve your interview skills.

Take Exams

Complete AI-generated assessments sent by employers. Timed questions with proctoring.

HR Features

Dashboard

KPIs overview: active jobs, applications, candidates reviewed, shortlisted. Real-time pipeline view.

Job Posting

Create job listings with AI-enhanced descriptions. Set requirements, salary range, deadline.

Applicant Management

View all applicants per job. Filter by status. Bulk actions. Download resumes.

AI Candidate Analysis

AI-powered scoring and ranking. Skills matching. Experience analysis. Hire recommendations.

Interview Scheduling

Schedule interviews with candidates. Video/phone/in-person types. Email invitations.

AI Video Interviews

Conduct AI-powered video interviews. Real-time transcription, automated analysis, hiring recommendations.

Exam Creator

AI-generate assessment exams from job requirements. MCQ questions. Timed tests. Automatic grading.

Bulawork AI Assistant

Chat-based AI recruiting assistant with real-time database integration. Get advice, analyze candidates, view live metrics.

Credits System

AI features consume credits. View balance, request more credits, track usage history.

Branch Management

Manage company locations. Add branches with addresses and contact details.

Archive

Archived applications and jobs. 90-day retention policy. Restore or delete items.

Admin Features

Analytics Dashboard

Platform-wide statistics. User counts, job metrics, application trends, growth charts.

User Management

View all users. Create, edit, activate, suspend accounts. Role management.

Company Approvals

Review and approve company registrations. Reject with reason. Send notifications.

Subscription Management

Manage company subscriptions. Assign plans. Add credits. View billing history.

AI Tools Config

Enable/disable AI tools. Set credit costs. Manage tool categories.

SMTP Settings

Configure email server. Test connection. Set from address and name.

File Manager

Browse uploaded files. View storage usage. Manage document encryption.

SEO Settings

Configure meta tags, site title, description for public pages.

HR Notifications

Send system-wide notifications to HR users. Manage notification templates.

Maintenance Mode

Enable maintenance mode. Only admins can login. Custom maintenance message.

Frontend Architecture

CSS Design System

BulaWork uses a custom CSS design system with CSS variables for consistent theming.

Core Color Palette

:root {
    /* Primary Colors */
    --primary-dark: #2F2E2E;
    --charcoal: #36454F;
    --charcoal-dark: #2D3748;
    --accent-yellow: #F3D15F;
    --accent-yellow-hover: #E5C34D;
    
    /* Background Colors */
    --bg-cream: #F9FAFB;
    --bg-dashboard: linear-gradient(135deg, #F9FAFB 0%, #FFFBEB 40%, #FDE047 100%);
    --card-white: #FFFFFF;
    
    /* Status Colors */
    --success: #10B981;
    --info: #3B82F6;
    --warning: #F59E0B;
    --danger: #EF4444;
    --purple: #8B5CF6;
    
    /* Border Radius */
    --border-radius-xl: 32px;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
    
    /* Shadows */
    --shadow-soft: 0 10px 40px -10px rgba(47, 46, 46, 0.10);
    --shadow-hover: 0 20px 50px -10px rgba(156, 141, 112, 0.25);
    --shadow-charcoal: 0 8px 25px rgba(54, 69, 79, 0.25);
}

CSS Files Structure

FilePurpose
css/design-system.cssGlobal variables, typography, utility classes
css/components.cssReusable component styles (buttons, cards, forms)
css/responsive.cssMedia queries and responsive breakpoints
assets/css/admin-common.cssAdmin panel shared styles
assets/css/hr-animations.cssHR dashboard animations
assets/css/loading.cssLoading spinners and skeleton screens

JavaScript Modules

Frontend JavaScript is organized into modular files for different functionalities.

FilePurposeKey Functions
js/app.jsMain application logicnavigateToScreen(), initializeScreen(), modal handling
assets/js/hr-page-transitions.jsHR page animationsPage load transitions, skeleton screens
assets/js/hr-dialogs.jsHR modal dialogsConfirmation dialogs, toast notifications
assets/js/loading.jsLoading statesshowLoading(), hideLoading(), progress bars

Key JavaScript Patterns

// AJAX Form Submission Pattern
async function submitForm(formData, endpoint) {
    try {
        const response = await fetch(endpoint, {
            method: 'POST',
            headers: { 'X-Requested-With': 'XMLHttpRequest' },
            body: formData
        });
        const data = await response.json();
        if (data.success) {
            showToast('Success!', 'success');
        } else {
            showToast(data.error || 'Error occurred', 'error');
        }
    } catch (error) {
        showToast('Network error', 'error');
    }
}

// Modal Pattern
function openModal(modalId) {
    document.getElementById(modalId).classList.add('active');
    document.body.style.overflow = 'hidden';
}

function closeModal(modalId) {
    document.getElementById(modalId).classList.remove('active');
    document.body.style.overflow = '';
}

Directory Structure

bulaw/
├── admin/                    # Admin panel pages
│   ├── dashboard.php         # Admin dashboard
│   ├── users.php            # User management
│   ├── company-approvals.php # Company approval
│   ├── settings.php         # System settings
│   └── ...
├── api/                      # RESTful API endpoints
│   ├── auth/                 # Authentication APIs
│   ├── admin/               # Admin APIs
│   ├── candidate/           # Candidate APIs
│   ├── hr/                  # HR APIs
│   ├── mobile/              # Mobile app APIs
│   └── serve-document.php   # Encrypted document server
├── assets/                   # Static assets
│   ├── css/                 # Stylesheets
│   └── js/                  # JavaScript files
├── candidate/               # Candidate panel pages
│   ├── dashboard.php        # Candidate dashboard
│   ├── onboarding.php       # Profile setup
│   └── job-alerts.php       # Job alert settings
├── config/                  # Configuration files
│   ├── database.php         # DB connection + helpers
│   ├── security.php         # Security functions
│   ├── encryption.php       # Document encryption
│   ├── email.php            # Email service
│   ├── api.php              # OpenAI integration
│   └── otp-helper.php       # OTP management
├── cron/                    # Scheduled tasks
│   ├── job-alerts.php       # Send job alerts
│   ├── friday-summary.php   # Weekly HR summaries
│   └── archive-cleanup.php  # Delete old archives
├── css/                     # Global stylesheets
├── database/                # Database migrations
│   └── migrations/          # SQL migration files
├── hr/                      # HR panel pages
│   ├── dashboard.php        # HR dashboard
│   ├── jobs.php             # Job management
│   ├── applicants.php       # Applicant list
│   ├── ai-tools.php         # AI tools hub
│   └── ...
├── includes/                # Reusable PHP includes
│   ├── admin-header.php     # Admin layout header
│   ├── public-header.php    # Public page header
│   └── hr-approval-check.php # HR access guard
├── js/                      # Main JavaScript
├── uploads/                 # File uploads (encrypted)
├── index.php               # Landing page redirect
├── login.php               # Login page
├── signup.php              # Registration page
├── find-jobs.php           # Public job search
├── job-details.php         # Job detail page
└── apply.php               # Job application page

Deployment Notes

Server Requirements

  • PHP 8.0 or higher with extensions: PDO, OpenSSL, JSON, mbstring, fileinfo
  • MySQL 8.0 or MariaDB 10.5+
  • Apache or Nginx web server with mod_rewrite
  • HTTPS certificate (required for production)
  • Minimum 512MB RAM, 5GB storage

Installation Steps

  1. Clone repository to web server document root
  2. Create MySQL database and import database/bulawork_deployment_v4.sql
  3. Configure config/database.php with database credentials
  4. Set file permissions: chmod 755 for directories, 644 for files
  5. Create writable uploads directory: chmod 775 uploads/
  6. Configure SMTP settings via Admin > Settings > Email
  7. Set OpenAI API key in config/api.php for AI features
  8. Create first admin user manually in database or via CLI

Cron Jobs

# Job alert emails - every 6 hours
0 */6 * * * php /path/to/bulaw/cron/job-alerts.php

# Friday HR summary - Fridays at 5 PM
0 17 * * 5 php /path/to/bulaw/cron/friday-summary.php

# Archive cleanup - daily at 2 AM
0 2 * * * php /path/to/bulaw/cron/archive-cleanup.php

# Saved jobs expiry check - daily at 6 AM
0 6 * * * php /path/to/bulaw/cron/saved-jobs-expiry.php

# AI Chat history cleanup (30-day retention) - daily at 3 AM
0 3 * * * php /path/to/bulaw/cron/chat-cleanup.php

BulaWork - AI-Powered Job Recruitment Platform

Documentation Version 1.5 - February 2026