How ychine/tdks-overclock works
Linaw helps workers understand employment contracts and quitclaims: consent, upload, OCR, human verification, plain-language interpretation, and referrals. The React app coordinates the workflow and keeps working state in the browser tab; confirmed fields feed chat, while payroll calculations are deterministic. Separate capabilities include contract comparison and a questionnaire for users without a contract. Backend routes proxy OCR and chat to Lumen. The README documents the main workflow and guardrails; some frontend and service connections are not shown in sampled source, so those links use README evidence or are omitted.
Main entry points: Summary.jsx Contract summary · chat.js Chat routes · ocr.js OCR routes · App.jsx App routing
Components 27
Contract workflow
- App routing
frontend/src/App.jsx - Consent
frontend/src/pages/Consent.jsx - Document upload
frontend/src/pages/Upload.jsx - OCR API client
frontend/src/api/ocr.js - Field extraction
frontend/src/lib/extract.js - OCR reading
frontend/src/pages/Reading.jsx - Field verification
frontend/src/pages/Review.jsx
Understanding tools
- Contract summary
frontend/src/pages/Summary.jsx - Legal glossary
frontend/src/lib/glossary.js - Salary breakdown
frontend/src/pages/Salary.jsx - Payroll calculator
frontend/src/lib/payroll.js - Ask Linaw
frontend/src/pages/Chat.jsx - Chat API client
frontend/src/api/chat.js - Contract comparison
frontend/src/pages/Compare.jsx - No-contract questions
frontend/src/pages/Questions.jsx - Agency referrals
frontend/src/pages/Help.jsx - Agency directory
frontend/src/lib/agencies.js
Backend services
- OCR routes
backend/src/routes/ocr.js - Lumen OCR
backend/src/services/lumenOcr.js - Chat routes
backend/src/routes/chat.js - Chat message builder
backend/src/services/chatMessage.js - Verified law selection
backend/src/services/legalRefs.js - Lumen AI chat
backend/src/services/lumenChat.js - Express API
backend/server.js
Shared frontend
- Translations
frontend/src/i18n/I18nProvider.jsx
Other components
- Worker
- Lumen service
Connections 30
- Worker → App routing: uses
- App routing → Consent: routes to
frontend/src/App.jsx - Consent → Document upload: agrees then uploads
- Document upload → OCR API client: submits document
- OCR API client → OCR routes: requests OCR
- Express API → OCR routes: mounts
backend/server.js - OCR routes → Lumen OCR: calls
backend/src/routes/ocr.js - Lumen OCR → Lumen service: sends document
- Lumen OCR → OCR routes: returns OCR pages
backend/src/routes/ocr.js - OCR API client → OCR reading: provides OCR result
- OCR reading → Field extraction: extracts fields
- Field extraction → Field verification: presents fields
frontend/src/pages/Review.jsx - Worker → Field verification: checks and corrects
- Field verification → Contract summary: confirms fields for
- Contract summary → Legal glossary: explains terms
- Contract summary → Salary breakdown: offers breakdown
- Salary breakdown → Payroll calculator: calculates pay
- Contract summary → Ask Linaw: offers questions
- Ask Linaw → Chat API client: sends question
- Chat API client → Chat routes: requests answer
- Express API → Chat routes: mounts
backend/server.js - Chat routes → Chat message builder: builds message
backend/src/routes/chat.js - Chat routes → Verified law selection: selects law
backend/src/routes/chat.js - Chat routes → Lumen AI chat: sends message
backend/src/routes/chat.js - Lumen AI chat → Lumen service: asks AI
- Worker → Contract comparison: compares contracts
- Worker → No-contract questions: answers questions
- Contract summary → Agency referrals: offers referrals
- Agency referrals → Agency directory: shows agencies
- App routing → Translations: provides translations
frontend/src/App.jsx