Skip to main content
@kneeraazon
Live ProductWeb Apps & SaaSCase Study

Built for Interactive Learning · Next.js 16 · TypeScript · SVG Diagrams · Groq

Spinoza Ethics Interactive Visualisation

An interactive visual guide to Spinoza's Ethics. Six hand-built SVG diagrams (the hierarchy of being, the five parts, mind-body parallelism, the affects, power to virtue, and the complete system) show how the book's definitions and propositions connect. A summary view, light and dark themes, and a Geometric Advisor that answers a question in Spinoza's definition, axiom and proposition style through a server-side Groq call complete it.

OUTCOME.01147Automated tests passing
OUTCOME.0260 / 60Seeded bugs caught by the tests
OUTCOME.030npm audit advisories (was 10)
2D SYSTEM TOPOLOGY // END-TO-END REQUEST PIPELINE4-STAGE DATA FLOW

Summary JSON → SVG Diagrams → Explain API → Groq Model

FIG.01 // INTERFACE & SYSTEM CAPTURE1 / 10
Hierarchy view of Spinoza's Ethics: a Substance box (God or Nature) expressing two attributes, Thought and Extension, each with an infinite immediate mode, on a light grid background.
Hierarchy view of Spinoza's Ethics: a Substance box (God or Nature) expressing two attributes, Thought and Extension, each with an infinite immediate mode, on a light grid background.

Role

Full-Stack Developer

Duration

3 weeks

Tech Stack

Next.js 16React 19TypeScript 6Tailwind CSS 4SVGGroq API (openai/gpt-oss-120b)Vitest 5Vercel
SECTION 01 // PROBLEM STATEMENT

The Problem

Spinoza's Ethics is written in geometric form: definitions, axioms and propositions that each lean on earlier ones. That makes it precise and also very hard to read, because the structure that holds the argument together is spread across the whole book.

The goal was a companion that shows the structure first: where Substance, its attributes and its modes sit, how the five parts build on each other, and how the argument moves from bondage to freedom, so a reader can see the whole before studying a single proposition.

SECTION 02 // SYSTEM ARCHITECTURE & EXECUTION

My Approach

  1. Diagrams. Six views, each a hand-built SVG component: Hierarchy, Five Parts, Parallelism, Affects, Power to Virtue and Complete. There is no graph library; the layout lives in the components.
  2. Reading views. An About page and a Read Summary view with a long-form summary of the Ethics.
  3. Themes. Light and dark, following the operating system setting and remembered across reloads.
  4. Geometric Advisor. The visitor describes a burden or a question and the app answers in Spinoza's proposition, demonstration and scholium style. The browser calls the site's own /api/explain route. The route holds the Groq key, fixes the prompt, model and token cap, accepts only the 68 known diagram concepts for concept requests, passes the question to the model as escaped data, and limits each caller to 6 requests a minute and 40 an hour.
  5. A hardening pass. An early version sent the Groq key to every visitor and had an unused route that worked as a free proxy. Both were closed, a Content Security Policy and other security headers were added, and the dependencies were brought up to date.
SECTION 03 // VERIFIED OUTCOMES

Results & Impact

Measured on the current code on 2026-11-14 unless a date says otherwise: - 147 automated tests in 9 files pass (npm test, run again on that date). - Recorded on 2026-11-09 in the repository's work-done.md: coverage over the server code (src/lib and src/app/api) of 100% statements and 97.27% branches; a mutation check with 60 deliberate bugs, all 60 caught; npm audit at 0 advisories, down from 10; the API key absent from the built output; and, in a real browser, no request to the model provider leaving the visitor's browser. - The deployed site loaded all eight views and returned a complete advisor answer to one test question on 2026-11-14.

Not verified: which commit the deployed site is running; browsers other than Chromium; dark mode on any view except Hierarchy. Known issue: the advisor shows the model's Markdown markers (asterisks) as plain text.