How jawhawk/anichinu works
Project type & purpose (what you’re diagramming)
This repo is a Chrome extension (Manifest-based) built with React + Webpack. It provides at least two user-facing extension “surfaces”:
• New Tab override (a custom Newtab page with anime content and links)
• Popup UI (the small extension popup)
There are effectively two generations of code in the repo:
• src/ = Anichinu v2.0 (React/Webpack; the active architecture per README)
• Anichinu1.0/ = a legacy v1.0 extension structure (static HTML/JS/CSS with popup.html, newtab.html, scripts/, styles/, and data JSONs)
Runtime (what runs in the browser)
Extension surfaces (UIs)
• New Tab app
• Entry/host: src/pages/Newtab/index.html, index.jsx, Newtab.tsx
• Components:
• components/AnimeBox.tsx
• components/LinkSection.tsx
• components/SettingsDrawer.tsx
• Utilities (important for behavior/data flow):
• util/fetchImage.ts (external image retrieval or local asset fetch)
• util/saveLocalstorage.ts (persistence layer)
• util/includesString.ts (filter/search helper)
• Data bundled with the extension:
• src/pages/Newtab/assets/aniwatchData.json
• src/pages/Newtab/assets/gogoanimeData.json
• Popup app
• Entry/host: src/pages/Popup/index.html, index.jsx, Popup.jsx
Extension manifest
Persistence
• The v2 code explicitly references local persistence via saveLocalstorage.ts, so the minimal accurate “storage” component is Web Storage (localStorage). (If manifest.json includes chrome.storage, show that too; but from the file tree alone, localStorage is the confirmed persistence mechanism.)
External resources
• Since there’s fetchImage.ts and JSON lists of content providers, the runtime likely reads local JSON and may fetch remote images/content. Represent this as:
• “External Anime Providers / Image Hosts (HTTP)” (generic cloud)
Build/Tooling (what produces the extension)
• Webpack build pipeline:
• webpack.config.js
• utils/build.js, utils/env.js, utils/webserver.js
• TypeScript config: tsconfig.json
• Package/deps/scripts: package.json, package-lock.json
• Output: build/ (implied by README) and packaged zip in zip/Anichinu-2.0.zip
User opens a new tab
• Chrome → loads extension New Tab Page (as configured by manifest.json)
• New Tab React app:
• reads bundled JSON (aniwatchData.json, gogoanimeData.json)
• reads/writes localStorage (settings/preferences via saveLocalstorage.ts)
• optionally calls External Image Hosts / Providers via fetchImage.ts
• renders UI components (AnimeBox, LinkSection, SettingsDrawer)
• Chrome → loads extension Popup Page
Build flows (how code becomes an extension)
• Developer → npm start:
• Webserver/dev tooling serves + watches
• Webpack bundles Newtab + Popup entrypoints + assets
• Developer → npm run build (implied; or equivalent):
• Webpack creates build/ folder
• Developer → Chrome “Load unpacked extension” uses build/
Architectural patterns/design principles visible from the repo
• Local-first data: content lists are shipped as JSON inside the extension; user preferences are persisted in localStorage.
• Build-time bundling: Webpack is essential; without it, the extension doesn’t exist in runnable form.
Following explicitly:
• Clear labels with file pointers where it matters:
• “Manifest: src/manifest.json”
• “Newtab: src/pages/Newtab/*”
• “Popup: src/pages/Popup/*”
• Blue rectangles: runtime UI containers (Newtab, Popup)
• Cloud: external providers/image hosts
• Orange gear: webpack/build tooling
Specific callouts for this repo (don’t miss these)
• Newtab is the “main app”: it has richer structure (TSX + components + utilities + assets), so allocate more detail there than Popup.