Inspiration## Inspiration
As an Electrical Engineering student, I've seen how engineering assessments usually work: fixed questions with fixed answers. You can memorize them, or use AI to generate the "right" answer. But real engineering isn't about knowing the static answer—it's about what you do when the facts change mid-problem. I wanted to build something that records adaptation, not just completion.
What it does
Defend is a mobile proof session.
- You solve a realistic troubleshooting task (e.g., a tripping pump motor).
- Your initial answers lock and timestamp.
- The evidence mutates (the supply is fixed, but the current imbalance remains).
- You revise your diagnosis and explain why in your own words.
- You get an honest, compact record: Submitted, Adapted, Explained, time taken, help disclosed, and a cryptographic record fingerprint.
It explicitly states: auto-checked, not verified. It doesn't certify skill; it shows how you respond to changed evidence.
How we built it
- Expo (React Native) + TypeScript: 5-screen flow using
expo-router. - Deterministic Engine: A JSON-driven challenge schema (
motor-imbalance.json) with seeded variants (Mulberry32 PRNG), constraint validation, and pure-function grading. No backend, no LLMs. - RevenueCat Integration: Wired
react-native-purchasesfor monetization. Free tier gives one session; Pro unlocks full JSON packet export and fresh randomized variants. Purchases run against RevenueCat's Test Store in Expo Go. - State & Persistence:
AsyncStoragehandles session lifecycle, immutable locking before mutation, and integrity signals (like leaving the app).
Challenges we ran into
- Dependency Hell: Expo SDK 57 pins React 19.2.3, but a stray
[email protected]peer dependency caused endlessERESOLVEcrashes. We had to surgically remove web dependencies and use--legacy-peer-depsfor RevenueCat. - The Generator Bug: Early on, 70% of random variants broke the scenario's physics constraints (e.g., voltage unbalance dropping below 2.8%). We increased the constraint-satisfaction loop from 25 to 5,000 attempts to guarantee valid variants.
- Hotspot Networking: Running the dev server over a mobile hotspot blocked local IPs, forcing us to configure
@expo/ngroktunnels so the physical phone could load the bundle.
Accomplishments that we're proud of
- End-to-End RevenueCat Flow: Successfully wired the Test Store paywall, displaying live products ($9.99/mo, $79.99/yr) and executing a test purchase that instantly flips the entitlement to unlock Pro features.
- Honest Limitations: Built the "auto-checked, not verified" disclaimer and help-disclosure directly into the core UX. We didn't fake a backend or human review.
- Zero-Backend Architecture: The entire grading logic, variant generation, and state machine run locally on the device.
What we learned
I learned that building an assessment tool requires extreme honesty about its limits. Keyword matching can be fooled, and a self-run app can't prove who did the work. By leaning into those limitations—displaying them plainly on the proof card—we built something more trustworthy than a fake "certificate." I also learned how deeply integrated RevenueCat's Test Store is; getting live offerings and test purchases working in Expo Go was a massive win.
What's next
- A second challenge domain (buck-converter ripple) to prove the JSON engine is truly generic.
- Reviewer-style PDF/Markdown export of the proof packet.
- Mentor/Employer dashboard tiers.