How twillot-app/twillot works
Project type and purpose
• This is a pnpm-workspace monorepo containing multiple browser extensions (exporter, multi-publish, x-bookmarks, x-bookmarks-automation) plus a shared utils package.
• The primary product (“Twillot”) is an AI-powered Chrome extension for managing, searching, and exporting X/Twitter bookmarks without needing a Premium account.
File structure
• Top-level folders:
– exporter, multi-publish, x-bookmarks, x-bookmarks-automation: four separate Chrome extensions built with SolidJS + Vite + TypeScript + Tailwind.
– packages/utils: shared helper modules (API clients, storage adapters, hooks, utilities).
– scripts & submit: build/deployment automation and data submission scripts (Python + JS).
– docs: API request/response specs, error flows.
• Notice each extension has these subcomponents:
– src/background (background service worker)
– src/contentScript
– src/devtools
– src/options, src/popup, src/newtab, src/sidepanel, etc.
– manifest.ts for Chrome manifest generation
– packaging configs: vite.config.ts, tsconfig.json, tailwind.config.cjs
Pull in README insights
• Core features: folder management, local sync, keyword search, AI smart categorization, media export.
• Tech stack: SolidJS for UI, Flowbite for components, create-chrome-ext starter, Vite for bundling, pnpm workspaces.
• External dependencies: Twitter API, AI categorization service, browser storage (IndexedDB or chrome.storage), ZIP library for media export.
a. Main components
1. Browser Host (Chrome)
2. Extension “Core”:
– Background Service Worker (fetching/syncing, messaging hub)
– Content Script (inject into twitter.com pages)
– DevTools Panel
– UI Pages: Popup, Options, New Tab, Side Panel
3. Shared Utils Layer (packages/utils)
4. External Services:
– Twitter REST API (bookmarks, tweets, media)
– AI Categorization Service (smart tagging)
5. Local Data Store: chrome.storage.local / IndexedDB
6. Build & CI/CD Pipeline (pnpm, vite, vitest, GitHub Actions)
b. Relationships & data flow
• Background ↔ Content Script: chrome.runtime messaging
• Background ↔ UI Pages (Popup/Options/...): chrome.runtime messaging + storage reads/writes
• Background → Twitter API / AI Service: HTTP calls initiated from SW (with fetch or xfetch util)
• UI Pages → Shared Utils: import hooks, API clients, types for data display & actions
• Data persistence: SW writes to chrome.storage.local or IndexedDB via utils/db
• Build: Each extension imports from packages/utils and is bundled via Vite → outputs in dist/
c. Architectural patterns & principles
• Monorepo with PNPM workspace → code reuse & consistent versions
• Separation of concerns: SW handles data orchestration; UI pages focus on view & user interactions
• Message-driven architecture within the extension (pub/sub over chrome.runtime)
• Component-based UI with SolidJS
• Shared services in packages/utils follow a library-centric design
d. Key technologies & libraries
• SolidJS + JSX (UI components)
• Flowbite (UI kit)
• Vite (bundler) + Vitest (tests)
• TypeScript (types across repos)
• create-chrome-ext (starter)
• chrome.storage.local, chrome.runtime APIs
• ZIP.js (media export)
• PNPM workspaces