Most people learn about investing by reading. I wanted a product where you learn it by making decisions and living with the consequences.

Investník is a free, Czech-first platform for learning investing. It started as a side project called investi and grew into a full product with authored lessons, a paper-trading portfolio, a backtesting lab and saved progress. I design, build and ship it alone.

The learning loop

Every lesson follows the same rhythm: an interaction, an answer, feedback, a saved position, completion, a reward and the next step. Learners predict, test or reveal something, see what happened and understand why, then retry or continue. Lessons are grouped into modules, starting with Investing Foundations and Returns & Compounding.

The signed-in product has three places: Learn, Lab and Progress. For a returning learner, “Continue learning” is always the main action. Onboarding asks about preferences and runs a five-question diagnostic, then shows a saved plan. Personalization changes guidance and pacing, never access: it cannot skip lessons or hand out rewards.

Practice Capital, not points

Finishing lessons earns Practice Capital, virtual money the learner invests in the Portfolio Lab. Completing the Foundations module unlocks the lab with a one-time 5,000 Kč, and each later lesson adds 2,000 Kč. XP and streaks exist too, but capital is never derived from XP.

Capital is computed from immutable reward receipts written in the same database transaction that completes the lesson. If the reward policy changes, old receipts keep their original amounts, and the balance can always be recomputed from the records.

A paper portfolio with real accounting

The Portfolio Lab answers one question: what do I own? It is educational paper trading, but I treated the money logic as if it were real:

  • Amounts are integers in minor units, with rounding in one place. The server is the only authority on values.
  • Trades are append-only and long-only. A trade cannot create negative cash or sell more than the learner holds.
  • A reset starts a new generation instead of deleting anything, so receipts, progress and old trades stay auditable.
  • Retries and concurrent requests are safe, and dedicated database tests cover the races.

Market data comes from a provider behind a server-only abstraction, with exchange rates from Frankfurter. ETFs stay their own category. When a price or exchange rate is missing, the portfolio shows an explicit incomplete state instead of a zero or an invented number.

Next to it, the Backtesting Lab answers a different question: how would this idea have behaved? Keeping the two questions in separate tools stopped them from blurring into one confusing screen.

Architecture

Investník is a Next.js App Router application with PostgreSQL and Drizzle. Better Auth handles accounts, optional Google and Facebook sign-in, and isolated anonymous demo sessions, so anyone can try the product without signing up and later claim their progress into an account.

The code is split by feature: a typed lesson engine shared by all modules, progress and rewards, gamification derived from receipts, the portfolio, market data, personalization and the lab math. Production deploys on Vercel run pending migrations and an idempotent curriculum seed before the build, and the deploy fails if a lesson in the catalog has no row in the database. Preview deploys skip both, so an unmerged branch never changes the shared database.

Keeping it correct

Every pull request runs lint, type checks, unit tests and a build, plus a second job that migrates and seeds a disposable PostgreSQL database and runs the persistence, migration and concurrency suites. Playwright browser suites run nightly in four parallel jobs, each with its own database.

The product copy is Czech, addresses the learner informally and avoids grammatical gender. A test flags the common gendered patterns so they don’t creep back in. The interface has to reflow down to 320 px and at 200% text size.

What I learned

  • Educational software still deserves real accounting. Learners trust numbers that never contradict each other.
  • Deriving state from immutable records makes policy changes and bugs recoverable.
  • “Unknown” is a valid value. Showing missing data honestly beats a confident zero.
  • Separating the questions a tool answers is as important as the features inside it.

Next.js · TypeScript · PostgreSQL · Drizzle · Better Auth · Vercel · Playwright