Product
Architecture
A walkthrough of how the Landon AI tools platform works — from upload to report — and how the access & rules engine enforces fair, secure usage.
Core flow
Upload
2–6 PDFs · ≤20MB each
Validate
Type, size, virus scan
Rules engine
Token / subscription gate
AI workflow
Compare & extract
Report
Saved & versioned
Rules engine
Every comparison request passes through deterministic checks before the AI workflow is invoked.
user.signedIn === true→ continuefiles.length BETWEEN 2 AND 6→ continuefiles[*].type === 'application/pdf'→ continuefiles[*].size ≤ 20MB→ continueuser.subscription === 'pro' OR user.freeTokenUsed === false→ run AI workflowrate_limit(user.id, '1m') ≤ 3→ proceedotherwise→ reject with reasonAccess matrix
What each role can do.
| Capability | User | Admin |
|---|---|---|
| Run PDF comparison | ✓ | — |
| View own history | ✓ | — |
| Manage own profile | ✓ | ✓ |
| See all users | — | ✓ |
| Grant tokens | — | ✓ |
| Disable accounts | — | ✓ |
| View inbox | — | ✓ |
Data model
User
├─ id, name, email, role
├─ subscription: 'free' | 'pro'
└─ freeTokenUsed: boolean
Comparison
├─ id, userId
├─ files[]: { name, label, size }
├─ status, createdAt
└─ summary, report (markdown)
ContactMessage
├─ id, userId?, name, email
├─ topic, message
└─ status: 'new' | 'in_review' | 'resolved'Components
Upload service
Storage
Token ledger
AI workflow
Report renderer
Access control
Each module is independently swappable; the platform is built to host additional tools alongside PDF Comparison.
Token state machine
Failure modes & safeguards
Oversized file
Reject before upload completes; surface inline error.
Duplicate submit
Idempotency key per request blocks rapid double-clicks.
Workflow timeout
Auto-retry once, then mark comparison as failed.
Account abuse
Per-IP and per-fingerprint rate limit on signup.
Sensitive data
Files isolated per user; deleted on request.
Unexpected output
Strict schema check on workflow response.