Skip to content

Osireg17/freedom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AceYourHireVue: Comprehensive Documentation

This document compiles the information from the provided sources to offer a detailed overview of the AceYourHireVue platform.

1. Introduction and Vision

AceYourHireVue is a SaaS platform designed to empower job seekers to excel in one-way interviews through AI-driven, hyper-personalized preparation that mirrors hiring expectations. It aims to transform anxiety into confidence by equipping users with the tools to articulate their skills effectively and stand out in competitive job markets.

The platform leverages Large Language Models (LLMs) to dynamically generate personalized interview questions and provide automated feedback. Proper error handling is critical for maintaining user trust, ensuring system stability, and facilitating rapid debugging. This document outlines the overarching goals, functional boundaries, and strategic direction of AceYourHireVue, serving as a foundational reference for all stakeholders.

1.1 Core Value Proposition

Context-Aware Question Generation: Dynamically tailored questions based on job descriptions, resumes, and industry trends. Real-Time Feedback: Instant scoring and actionable insights on responses powered by LLM technology. Adaptive Learning: Progress tracking and iterative practice sessions that evolve with the user's skill level.

1.2 Strategic Goals

  1. Become the Market Leader: Establish AceYourHireVue as the premier AI-driven interview preparation platform with demonstrable success rates.
  2. Drive User Success: Achieve a self-reported increase in job offer rates among active users.
  3. Ensure Accessibility: Maintain a multi-tier pricing model to democratize access to advanced AI tools for underserved job seekers.
  4. Build a Feedback-Driven Roadmap: Incorporate user suggestions into bi-monthly feature updates.

2. Technical Architecture

AceYourHireVue is built on a modular, scalable architecture that leverages modern cloud-based and serverless solutions for performance and cost-efficiency. The core components include:

Frontend: Next.js (latest version) for SSR and SSG. Hosted on Vercel with continuous integration and automatic scaling. Utilizes TanStack Query (React Query) for data fetching and caching, and ShadCN UI for a modern component library based on Tailwind CSS. Backend: Next.js API Routes for backend logic, orchestrated by Trigger.dev for background tasks. Database & Storage: Supabase (PostgreSQL) for structured data with automated backups, read replicas, and secure file storage for resumes and recordings. Drizzle ORM is used for database interactions. NeonDB will be used to run unit tests and integration tests. Supabase Storage is used for resume uploads and interview recordings. AI & Speech Processing: Question Generation: Uses either Deepseek API, OpenAI or Gemini [Need to evaluate price & effectiveness] for dynamic, role-specific interview questions and user answer analysis. Specifically, ChatGPT 4o-mini-web-search and Google Gemini Flash 2.0 with search grounding are used for question generation. Speech Analysis: Deepgram for real-time speech-to-text transcription and analysis. Deepgram's Nova-3 model is used for speech analysis. Authentication & User Management: Clerk for handling multi-method authentication (email/password, Google, Microsoft) integrated with Supabase. Pricing & Payments: Stripe for subscription management and payment processing. Hosting & Deployment: Vercel for serverless deployments and automatic scaling. Rate Limiting: Upstash Redis for distributed API rate limiting. Observability: BetterStack for logging and monitoring.

The architecture supports real-time API interactions, secure data storage, efficient AI-driven assessments, and compliance with data privacy standards.

3. Error Handling Strategy

The error handling strategy for AceYourHireVue aims to establish consistent patterns for managing, reporting, and resolving errors across the application. Proper error handling is critical for maintaining user trust, ensuring system stability, and facilitating rapid debugging.

3.1 Purpose

Provide a consistent approach to handling errors throughout the application. Ensure appropriate error messaging for different user contexts and subscription tiers. Establish robust logging and monitoring for error detection and resolution. Define recovery strategies for various failure scenarios.

3.2 Guiding Principles

  1. User Experience First: Prioritize clear communication and graceful degradation.
  2. Comprehensive Visibility: Ensure all errors are properly captured and logged.
  3. Actionable Information: Error messages should guide users toward solutions.
  4. Security Consciousness: Never expose sensitive information in user-facing errors.

3.3 Error Display Strategies

Error messages should be:

  1. Clear: Easy to understand, avoiding jargon.
  2. Actionable: Provide specific next steps or solutions when possible.
  3. Contextual: Adapt message detail based on the user's context and subscription tier.
  4. Consistent: Maintain a consistent tone and format across the application.
  5. Constructive: Focus on solutions rather than problems.
  6. Concise: Keep messages brief but informative.

Different error types will have different display methods:

Critical Errors: Modal dialog (e.g., "We couldn't save your interview recording. Please try again or contact support if the problem persists."). Non-Critical Errors: Inline notifications or subtle UI updates (e.g., for form validation failures). AI Service Failures: User-friendly fallback messages (e.g., "We're experiencing a delay in creating your questions. We've saved your progress and will notify you when ready.").

3.4 Error Logging

A central logging utility (lib/logger.ts) provides consistent logging across the application. BetterStack is used for comprehensive logging and error tracking.

const logCaughtError = (error: unknown, additionalContext?: Record<string, any>) => {
  const isErrorObject = error instanceof Error;
  const errorDetails: ErrorDetails = {
    message: isErrorObject ? error.message : String(error),
    stack: isErrorObject ? error.stack : undefined,
    additionalContext,
  };
  logError(errorDetails);
  setLastError(isErrorObject ? error : new Error(String(error)));
};

Global request logging can be implemented via middleware using BetterStack's integration. Log sampling, levels, context filtering, and retention policies should be considered.

3.5 Monitoring and Alerting

Highlight.io monitors both frontend and backend errors. Alerts are triggered based on a combination of error frequency, impact, and severity. Monitoring includes:

Client-side errors by browser/device Form validation failure rates API timeouts experienced by users Authentication/authorization failures LLM service response times Question generation failures Speech-to-text transcription errors Analysis quality metrics

A custom dashboard visualizes error rates.

3.6 Recovery Strategies and Fallbacks

The system implements retry logic and fallback providers for LLM analysis. For example, if the primary LLM provider fails, a fallback to gpt-4 is attempted. Specific error handling is implemented for services like Deepgram transcription.

A feature degradation strategy is in place to gracefully degrade functionality during service disruptions. A ServiceHealthMonitor tracks the status of critical services ('llm', 'transcription', 'database', 'payment', 'authentication'). If a service is down, the system can return a degraded state. For example, if the transcription service is down, a simplified interview mode is shown.

The Bulkhead Pattern is used to isolate components to contain failures and prevent resource exhaustion. Global error handlers are in place to catch unhandled errors.

3.7 Post-Mortem Process

After significant incidents, a structured process is followed:

  1. Incident Timeline: Document the chronological sequence of events, detection time, response time, and resolution time. Identify key decision points and actions taken.
  2. Root Cause Analysis: Determine the underlying cause of the incident.
  3. Corrective Actions: Identify and implement steps to prevent recurrence.
  4. Lessons Learned: Document insights and improvements for the error handling strategy.
  5. Communication: Inform stakeholders about the incident and resolution.

3.8 Error Handling in Documentation & Training

Error Documentation: Error Catalog: Document each error code, possible causes, and resolution steps. Link to relevant code sections and previous incidents. Update with new errors as they're discovered. User-Facing Error Guides: Create help center articles for common user-encountered errors. Include troubleshooting steps and self-service solutions. Reference these guides in appropriate error messages.

4. Development and Testing

The development process follows a clear workflow, including version control and a defined branching strategy.

4.1 Development Environment & Tooling

Technologies & Frameworks: Frontend (Next.js, TanStack Query, ShadCN UI), Backend (Next.js API Routes, Trigger.dev), Database (Supabase, Drizzle ORM), Authentication (Clerk), AI/LLM (ChatGPT 4o-mini-web-search, Google Gemini Flash 2.0, Deepseek V3), Speech Analysis (Deepgram), Rate Limiting (Upstash Redis), Observability (BetterStack), Payments (Stripe). Development Tools: Cursor or VScode, Git with GitHub. CI/CD: GitHub Actions. Testing Frameworks: Jest, React Testing Library, Cypress, Lighthouse CI, axe-core.

Local development setup involves cloning the repository, installing dependencies, and setting up environment variables.

4.2 Branching Strategy

main → Production develop → Staging release/* → UAT (optional) PR branches → Preview

4.3 Automation and Governance

Required checks for pull requests include linting, unit tests, end-to-end tests, Vercel build verification, and security scans. Semantic versioning and changelog management are automated using standard-version, adhering to Conventional Commits. Branch hygiene includes automatic deletion upon merging and weekly clean-ups for stale branches.

4.4 Testing Strategy

AceYourHireVue adopts a comprehensive testing approach following the testing pyramid principle.

Unit Tests: Validate individual functions and components in isolation (Jest). Integration Tests: Verify interactions between different parts of the system (Jest). Mocking is used for external APIs (Deepseek, Deepgram). Component Tests: Test UI components in isolation (React Testing Library). End-to-End (E2E) Tests: Simulate real user scenarios to validate overall system behavior (Cypress with Percy for visual regression testing). Prioritize E2E tests for revenue-critical paths. Performance Tests: Ensure system responsiveness, especially for AI-powered features (Lighthouse CI and custom timing measurements). Define baseline performance expectations. Accessibility Tests: Ensure WCAG 2.1 AA compliance (axe-core integration with component tests and Cypress). Subscription Tier Tests: Verify that features are correctly enabled or disabled based on user subscription tier (Jest). AI Output Quality Tests: Evaluate the relevance, accuracy, and helpfulness of AI-generated content.

Test cases are documented in code using JSDoc comments and in shared documents for complex features. Test data is managed using fixture files and data generators, covering all subscription tiers. Error scenarios are explicitly tested in all API integrations, mocking error responses from external services.

Continuous testing involves running unit, component, and critical integration tests on every PR, and the full E2E suite nightly and before production deployments. Test coverage reports are generated and stored. Isolated test databases with consistent seed data are maintained.

4.5 CI/CD Pipeline

GitHub Actions is used for automated testing, linting, and deployment. The CI/CD pipeline includes steps to run linters, unit tests, component tests, subscription tier tests, and Cypress E2E tests before deploying to Vercel on the main branch.

4.6 Roles & Responsibilities (Solo Developer)

As a solo developer, responsibilities include development, testing, CI/CD management, and documentation.

4.7 Risk Management & Contingency

Identified risks include cold starts with Trigger.dev. Mitigation strategies include pre-warming functions and optimizing execution flow.

5. API Documentation

The AceYourHireVue API is built using Next.js API Routes orchestrated by Trigger.dev for backend processes. Authentication is handled by Clerk, with API routes protected using Clerk's middleware.

5.1 Authentication & User Management

Users sign up or sign in through Clerk-powered UI components. Authenticated user IDs are used to manage data access in Supabase. /api/users/me: Retrieves the authenticated user's profile. /api/users: Updates user information.

5.2 Resume Management

POST /api/resumes/upload: Uploads a resume for parsing and LLM analysis (multipart/form-data). GET /api/resumes/{resumeId}/status: Checks the status of resume processing. GET /api/resumes: Retrieves a list of uploaded resumes for the authenticated user. DELETE /api/resumes/{resumeId}: Deletes a specific resume.

5.3 Interview Management

Generate Job-Based Interview: POST /api/interviews/job-based. Generate Resume-Based Interview: POST /api/interviews/resume-based. Create Custom Interview: POST /api/interviews/custom. Get All Interviews: GET /api/interviews (supports filtering by status and type, and pagination). Get Interview Details: GET /api/interviews/{interviewId}. Get Interview Questions: GET /api/interviews/{interviewId}/questions. Submit Question Response (Video Recording): POST /api/interviews/{interviewId}/questions/{questionId}/response (multipart/form-data). Get Question Feedback: GET /api/interviews/{interviewId}/questions/{questionId}/feedback. Complete Interview: POST /api/interviews/{interviewId}/complete.

5.4 Behavioral Question Library

Search Behavioral Question Library: GET /api/questions/library (supports filtering by category and text search, and pagination).

5.5 Analytics and Progress API

Get User Analytics Overview: GET /api/analytics/overview (tier-based response). Get Category Performance: GET /api/analytics/categories/{category} (tier-based response). Get Interview Progress History: GET /api/analytics/history (supports timeframe and limit).

5.6 Trigger.dev Jobs

Asynchronous processing tasks are handled by Trigger.dev jobs, including:

Question Generation Job: Process the job description information or the parsed resume using an LLM will create questions. Triggered by the question.create event Response Analysis Job: Processes audio responses, transcribes them, and generates feedback using Deepgram and LLM. Triggered by the response.submitted event.

5.7 Database Schema (Supabase/PostgreSQL)

Key tables include users, interviews, interview_questions, interview_answers, and behavioral_questions. Relationships and key features are defined. Row Level Security (RLS) policies ensure users can only access their own data. Full-text search is implemented for the question library. Extensions to the responses table support tiered response analysis.

5.8 Error Handling in API Routes

API routes use a consistent error handling approach, returning JSON responses with appropriate status codes for validation errors (ZodError) and other errors.

6. Prompt Engineering

The prompt engineering strategy focuses on creating realistic, challenging, and industry-specific interview questions similar to those used in actual HireVue interviews.

6.1 Design Principles

  1. Industry & Company Relevance: Questions should reflect the realities of the specific industry and company culture.
  2. Experience Level Calibration: Question complexity should be appropriate for the candidate's experience level.
  3. Clear Question Structure: Prompts should generate well-formatted questions with clear follow-up prompts.
  4. Focus on Key Skills & Responsibilities: Questions should target essential requirements for the role.

6.2 Core Prompt Templates

Templates are defined for:

Scenario-Based Questions: Present realistic workplace scenarios. Technical Questions: Assess technical knowledge and problem-solving. Behavioral Questions: Assess past behavior and experience using the STAR method. Resume-Based Questions: Generate personalized questions based on the candidate's resume.

6.3 Question Type Distribution

Job-based interviews generate a mix of question types.

6.4 Advanced Question Generation Techniques

Hybrid Question Format: Blends technical, behavioral, and scenario-based elements. Current-Context Integration: Incorporates current industry developments and company context.

6.5 API Flow for Question Generation

A Trigger.dev job handles the question generation process:

  1. Receive job details and desired number of questions.
  2. Perform contextual analysis using an LLM.
  3. Generate questions based on the analysis and prompt templates.
  4. Store questions in the database.
  5. Return results.

7. Response Analysis Framework

The tiered response analysis system evaluates user interview responses through speech-to-text processing and provides detailed feedback using LLMs. The depth of analysis depends on the user's subscription tier.

7.1 Subscription Tiers and Features

Free Tier: Basic transcript, overall score, brief feedback (strength and improvement). Standard Tier: Everything in Free, full STAR method breakdown, communication and content quality assessment, basic speech metrics, highlighted transcript, expanded improvement suggestions. Pro Tier: Everything in Standard, advanced speech pattern and utterance analysis, interpersonal traits assessment, industry-specific benchmarking, unlimited response storage.

7.2 Technical Implementation

Deepgram's Nova-3 model is used for speech analysis with different feature flags enabled per tier. Functions extract different levels of detail from the Deepgram response.

7.3 Multi-Dimension LLM Analysis

LLMs analyze the response with varying levels of detail based on the tier. Different prompt templates are used for free, standard, and pro tiers to generate appropriate feedback.

7.4 Score Calculation

Each tier uses a different method to calculate the overall score. Free tier provides a composite score. Standard and pro tiers calculate scores based on the different analysis dimensions.

7.5 Integration with Trigger.dev

The system is implemented as a Trigger.dev job (analyze-interview-response) that processes responses asynchronously. The job retrieves audio, user subscription, and question data, configures Deepgram options, transcribes the audio, generates tier-appropriate feedback using LLMs, and updates the database with the analysis results.

7.6 Database Schema Extensions

The responses table is extended with columns to store tier-specific analysis results (score, feedback, star scores, communication scores, content scores, interpersonal scores, speech metrics, improvement suggestions, improvement areas, industry insights, overall score, analyzed_at).

7.7 Upgrade Pathway UI/UX

UI elements should prompt free tier users to upgrade to access more detailed feedback.

7.8 Integration with Analytics API

The response analysis data is integrated with the Analytics API to provide consistent feature availability, data aggregation, and a seamless user experience. The API leverages the detailed assessment data stored in the database by the response analysis framework. The interview detail endpoint and analytics category endpoint include response analysis data with tier-appropriate detail. The response analysis data also feeds into personalized improvement recommendations.

8. Requirements

The Requirements Document defines the functional and non-functional requirements for AceYourHireVue.

8.1 Functional Requirements and User Stories

Detailed functional requirements and corresponding user stories are defined for the following features:

Job Description-based Interview Questions (FR-1.1 to FR-1.7) Resume-based Interview Questions (FR-2.1 to FR-2.10) Interview Question Library (FR-3.1 to FR-3.5) Interview Replay & Practice (FR-4.1 to FR-4.5) User-Created Interviews (FR-5.1 to FR-5.7) User Onboarding and Management (FR-6.1 to FR-6.6) Feedback and Progress Tracking (FR-7.1 to FR-7.5)

8.2 Non-Functional Requirements

Performance: Page load times, API response times, background processing times should meet specified targets (NFR-1, NFR-2). Security: Sensitive data encryption (AES-256), secure communication (TLS 1.2+), adherence to GDPR and CCPA (NFR-3, NFR-4). Usability & Accessibility: Mobile-responsive UI, WCAG 2.1 Level AA compliance, streamlined onboarding (NFR-5, NFR-6).

8.3 Acceptance Criteria

Detailed acceptance criteria are defined for each functional requirement, outlining specific conditions that must be met for the requirement to be considered complete and correctly implemented.

9. Security and Compliance

AceYourHireVue implements a multi-layered approach to security.

9.1 Data Security

Encryption: AES-256 for data at rest and TLS for data in transit. Field-level encryption for resume content in Supabase. Regular, encrypted backups. Authentication: Clerk with multi-factor authentication (MFA) ensures secure user access. Strong password policies are enforced. JWT-based session management by Clerk. Access Control: Role-based access control (RBAC) restricts sensitive actions. Supabase's row-level security policies are implemented. Least privilege principle for database access. Data Retention: Adheres to GDPR, CCPA, and other relevant data protection regulations. Users have data export and account deletion capabilities. Only essential user information is stored, with sensitive information hashed and salted. Data in Transit: HTTPS enforced across all communications, proper CORS policies, secure WebSocket connections, and appropriate security headers.

9.2 Compliance Considerations

Full compliance with GDPR, CCPA, and other applicable standards is ensured. Audit logging is maintained for security audits and anomaly detection. User consent is obtained for all data collection.

9.3 API Security

Rate Limiting: Tiered rate limiting based on user role and endpoint sensitivity. Limits at user and IP address levels. Restrictive limits on authentication endpoints. Incremental backoff for repeated failures. Input Validation: Strict validation of all API request parameters to prevent injection attacks. Output Sanitization: Sanitize all API responses to prevent cross-site scripting (XSS) vulnerabilities. AI Response Caching: Cache common AI responses to reduce exposure of user data.

9.4 Security Monitoring (Solo Development)

Automated Security Scanning: Weekly GitHub CodeQL scans, Dependabot for dependency updates, simple security logging, Sentry for security-related exceptions. Manual Security Reviews: Personal reviews before major feature deployments, OWASP Top 10 checklist for periodic audits. Vulnerability Management: Prioritize fixing high-risk vulnerabilities immediately. Documentation: Document security decisions and trade-offs.

9.5 Incident Response Plan

Simple incident procedure: 1. Identify and contain the issue, 2. Assess impact, 3. Fix and deploy, 4. Notify users, 5. Document. Recovery readiness includes database backups, documented recovery procedures, and tested rollback procedures.

10. Monitoring and Logging

Comprehensive logging and error tracking are implemented using BetterStack to ensure high reliability and facilitate debugging.

10.1 Core Logging Implementation

A central logging utility (lib/logger.ts) provides consistent logging. BetterStack's Next.js integration is used. Structured logging with automatic parsing of JSON logs simplifies querying and analysis.

10.2 Global Request Logging via Middleware

BetterStack can be integrated at the middleware level to automatically log all requests. Considerations include sampling, log levels, context filtering, and retention policies.

10.3 Benefits

Complete visibility of client and server errors with full context. Early warning system for identifying issues.

11. Deployment Strategy

Frontend & Backend: Hosted on Vercel with serverless deployments and automatic scaling. Database: Supabase PostgreSQL with automated backups and read replicas. File Storage: Supabase Storage. CI/CD Pipeline: GitHub Actions for automated testing, linting, and deployment. Background Processing: Trigger.dev functions must return a job ID immediately to track asynchronous execution, with pre-warming strategies to mitigate cold start delays.

Deployment safety includes checks and monitoring to prevent and quickly resolve deployment-related errors.

12. Testing Strategy (Revisited)

AceYourHireVue employs a comprehensive testing strategy.

Unit Tests: Isolate and test individual components and functions (Jest). Integration Tests: Verify the interaction between different parts of the system (Jest). Component Tests: Test individual UI components (React Testing Library). End-to-End Tests: Simulate full user workflows (Cypress). Performance Tests: Measure speed and responsiveness (Lighthouse CI). Accessibility Tests: Ensure inclusivity (axe-core). Subscription Tier Tests: Validate feature access based on user tier (Jest). AI Output Quality Tests: Assess the quality of AI-generated content.

13. Success Metrics

User Engagement: Percentage of users who return weekly to practice and track progress. Subscription Conversion Rate: The ratio of free/trial users who convert to paid subscription plans. Target: 5% conversion rate from free to paid users. Interview Success Rate: Users reporting successful interviews or receiving job offers (Qualitative and user-reported). Aim for a self-reported increase in job offer rates among active users. Customer Satisfaction: Positive feedback through in-app surveys and reviews (e.g., net promoter score).

14. Future Enhancements

Potential upgrades and improvements include:

AI-driven video analytics and tone analysis. Community engagement features (discussion forums, shared interview questions).

15. Conclusion

AceYourHireVue is designed to be a powerful and user-friendly platform for interview preparation, leveraging AI and a robust technical architecture. This comprehensive documentation provides a detailed understanding of the platform's vision, scope, technical design, error handling, development process, API functionalities, and future direction, ensuring a reliable and impactful solution for job seekers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published