Inspiration
Investment education usually fails in one of two ways: it is either a lecture that puts you to sleep, or a tip sheet that quietly becomes stock advice. I wanted a third way — a dojo, where you practice thinking. The curriculum reuses my own investment-teaching framework (Three Roads to Heaven: the index road of humility, the circle-of-competence road of skill, the partnership road of conviction) and a real case I studied in depth — Tesla's 2018 braking crisis, where an OTA software update cut emergency braking distance from 46.3m to 40.5m in nine days. A tutor that makes you answer first, before it explains, turns those stories into judgment you actually keep.
What it does
InvestDojo is a one-page web app where each investing lesson costs exactly $1, paid through PayPal. Pay, and the lesson unlocks: two lessons (Three Roads to Heaven, my investment-philosophy framework; Tesla 2018 Brake Crisis, a first-principles case study) plus free-form Q&A on investing basics; a Socratic AI tutor under every lesson that asks before it answers; questions outside the lesson's scope get an honest 'we haven't covered that yet' instead of a hallucinated lecture; a post-lesson check with quiz questions, a one-sentence takeaway, and progress stored locally in the browser. The $1 payment is not a paywall decoration — it is the business model. No payment, no lesson; payment unlocks the lesson. Roadmap: monthly subscriptions, tip-the-mentor, course-completion certificates. Every lesson opens with a disclaimer that this is investment literacy education, not investment advice. No stock picks, no individual-stock commentary, no return promises — pure education.
How we built it
Frontend is a single self-contained HTML file. Payments use PayPal Sandbox + Orders API, fixed $1 orders, create-order to capture flow; the whole demo runs in Sandbox, no real money moves. AI tutor uses an OpenRouter-compatible endpoint the browser calls directly; the system prompt reuses the knowledge base of my Investment & Startup Dual-Lens Advisor agent — Socratic style, the Three Roads framework, the Tesla case. The API key lives only in page memory and is wiped when the tab closes; without a key the lesson content still works and the tutor simply asks for one. Deployment is static hosting.
Challenges
PayPal risk controls soft-reject logins from fresh datacenter browsers with vague errors, so the human logged in on their own browser to create the Sandbox app instead. The checkout domain www.sandbox.paypal.com is flaky from mainland China networks while www.paypal.com renders fine; the page now fails loudly with a retry path instead of spinning forever, and the demo video was recorded where both domains are reachable.
Accomplishments
A working pay-per-lesson loop where payment is the product mechanic, which is exactly what the Best Use of PayPal + AI prize is about; a tutor with pedagogical discipline (Socratic questioning, scope honesty, zero stock advice); built as a minimal demo in days without crowding out the main competition entry.
What we learned
Payment UX is a networking problem as much as a code problem; and for AI tutors, the most valuable prompt engineering is teaching the model to say 'we haven't covered that yet.'
What's next
Monthly subscriptions and tip-the-mentor on top of per-lesson payments; course-completion certificates; more lessons from the same knowledge base and a Chinese-language edition.
Built With
- html5
- openrouter
- paypal-js-sdk
- paypal-orders-api
- vanilla-js