How mochiday/auto-apply-applet works
Main Components
a) Client Layer:
• External HTTP clients making POST requests
• Should show the JSON payload structure
b) Server Layer:
• Express.js server (Port 8762)
• Main application entry point
c) Driver Management Layer:
• Driver initialization system
• Driver registry/factory
d) Job Board Drivers:
• Lever driver (currently the only one)
• Placeholder for future drivers
e) Automation Layer:
• Puppeteer browser automation
• Form filling components
Component Relationships
[Client] → [Express Server] → [Driver Manager] → [Specific Driver] → [Puppeteer Automation] → [Job Board Websites]
Detailed Component Breakdown
For the Lever driver (use as a template for future drivers):
• Config management
• Input handlers
• Basic questions handler
• Custom questions handler
• Resume upload functionality
• Application submission
Specific Implementation Details to Highlight
a) Driver Architecture:
src/drivers/
• apply.ts (Main driver interface)
• init.ts (Driver initialization)
• Lever/ (Specific driver implementation)
b) Lever Driver Components:
• Configuration (config.ts)
• Input Processing (inputHandlers.ts)
• Form Filling (fillLeverBasicQuestions.ts, fillLeverCustomQuestions.ts)
• Resume Handling (uploadResumeToLever.ts)
• Submission Logic (submitLeverApplication.ts)
Key Flows
a) Application Flow:
Response returned to client
b) Data Flow:
• How candidate data moves through the system
• Where data transformation occurs
• Error handling paths
Additional Elements
• Notes about scalability points for future job board additions
• Configuration injection points
• Error handling paths
• Asynchronous operations
Technical Details
• TypeScript types and interfaces
• Puppeteer browser instances
• Express server endpoints
• File system interactions (for resume handling)
This architecture should be represented in a way that emphasizes its modular design and the separation of concerns between the driver interface, specific implementations, and the automation layer.