A MODERN FORM OF WIKIPEDIA
Read, beautifully. Chronos takes Wikipedia's content and re-renders it in a calm, typography-first interface built for focused reading on any screen.
Live demo: [ chronos.arnavmishra.in ]
Stack: Next.js 15 (App Router, React 19, TypeScript) · Tailwind CSS v4 · Wikipedia API · sanitize-html · html-react-parser · Google Analytics 4 · Vercel
Wikipedia has the best open knowledge on the web, but its default interface was not designed for reading on a phone: dense infoboxes, wide tables that break layouts, navboxes and maintenance banners that interrupt the text, and images that overflow their containers.
Chronos treats this as an architecture problem, not a styling problem. Instead of restyling Wikipedia's page with CSS, it fetches the raw article HTML from the Wikipedia API, cleans and restructures it on the server, and rebuilds the page as React components that I control. The result is a reader that keeps Wikipedia's real, live content but presents it the way a native reading app would.
Wikipedia API (action=parse + query)
│ raw HTML + metadata (cover image, short description, languages)
▼
Server: sanitize-html pipeline (lib/wikipedia.ts)
│ allow-listed tags/attributes, class filtering, media URL repair,
│ math → placeholders, section + TOC structuring
▼
Client: html-react-parser (ChronosArticleRenderer)
│ `replace` rules map raw nodes → Chronos components
▼
React UI: collapsible sections, "Quick facts", collapsible tables,
optimised images/video, pull quotes, KaTeX math
sanitize-html allow-list. Only approved tags, attributes and CSS properties survive, so injected markup or inline styles cannot leak into the page.sanitize-html skips its filter for tags outside the allow-list, I map those <div> elements to an allowed tag first so the filter can actually see and remove them.//upload.wikimedia.org/... URLs are upgraded to HTTPS, hosts are checked against an exact-hostname whitelist (a lookalike domain such as upload.wikimedia.org.evil.com is rejected), and srcset entries are rewritten.html-react-parser, whose replace hook swaps raw nodes for custom React components: images, video, galleries, math, tables, pull quotes and the infobox.<h2> into collapsible sections with a generated table of contents and scroll-spy.wikitable and similar) are intercepted in the parser and wrapped in a collapsible <details> / <summary> block. The table's <caption> becomes the button label (fallback: "View Table Data"), and the table itself scrolls sideways inside a rounded container, so wide data never breaks the mobile layout or overwhelms the reader.url() or var()), with a dark-text override so coloured cells stay readable in dark mode.NavigationTransitionProvider mounted in the root layout.next/link clicks, browser back/forward, and programmatic router.push calls, and ends when the new route commits.template.tsx), so the overlay and the new page cross-fade instead of animating twice.role="status"), and respects prefers-reduced-motion.@next/third-parties/google package in the root layout.next/script's afterInteractive strategy, meaning after hydration, so it stays out of the critical rendering path and does not interfere with the loading animation.NEXT_PUBLIC_GA_ID and is validated (G-XXXXXXXXXX format). If it is missing or malformed, no analytics code is rendered at all, which keeps local development and preview deployments clean.next/image.AI_HANDOFF.md, ARCHITECTURE.md) that records every change and the reasoning behind it.