How doosemavis/tailormytext works
TailorMyText turns uploaded or library documents into structured, customizable reading material, then presents it through an accessible reader with a word-paced mode. The main flow runs from the reader UI through document-state handling and format parsers, with saved documents and positions backed by cloud and browser storage. Separate product branches cover accounts, subscriptions and checkout, the book library, and administration/analytics. Some subsystems are represented by exact directory paths because their implementations were not sampled; unsampled links are omitted where their callers cannot be verified.
Main entry points: App.jsx Reader app · supabase.js Supabase client · parser.worker.js Parser worker · usePacer.js Word pacer
Components 24
Reading experience
- Reader app
src/App.jsx - Reader components
src/components/DocumentBody.jsx - Word pacer
src/hooks/usePacer.js - Word indexing
src/utils/pacer/wordIndex.js
Document processing
- Document state
src/hooks/useDocumentState.js - Format parsers
src/utils - Parser worker bridge
src/utils/parserWorker.js - Parser worker
src/workers/parser.worker.js - PDF analysis
src/workers/pdfAnalysis.js - Markdown parser
src/utils/parseMarkdownTokens.js - Text structure detection
src/utils/detectStructure.js
Accounts and plans
- Authentication context
src/contexts/AuthContext.jsx - Subscription state
src/hooks/useSubscription.js - Checkout sessions
supabase/functions/create-checkout-session/index.ts - Billing lifecycle
supabase/functions/stripe-webhook/index.ts
Persistence and services
- Cloud documents
src/utils/cloudDocs.js - Supabase client
src/utils/supabase.js - Browser storage
src/utils/storage.js
Library and operations
- Book library
src/hooks/useLibrary.js - Admin panel
src/pages/AdminPanel.jsx - Event tracking
src/utils/track.js
Other components
- Reader
- Supabase service
- Stripe
Connections 27
- Reader → Reader app: opens reader
- Reader app → Document state: manages documents
src/App.jsx - Document state → Format parsers: parses uploads
src/hooks/useDocumentState.js - Format parsers → Parser worker bridge: offloads parsing
src/utils/index.js - Parser worker bridge → Parser worker: dispatches jobs
src/utils/parserWorker.js - Parser worker → PDF analysis: analyzes PDFs
src/workers/parser.worker.js - Parser worker → Markdown parser: parses Markdown
src/workers/parser.worker.js - Parser worker → Text structure detection: structures text
src/workers/parser.worker.js - Reader app → Reader components: renders document
src/App.jsx - Reader app → Word pacer: controls pacing
src/App.jsx - Word pacer → Word indexing: indexes words
src/hooks/usePacer.js - Reader app → Cloud documents: loads positions
src/App.jsx - Document state → Cloud documents: opens library books
src/hooks/useDocumentState.js - Reader app → Authentication context: uses account state
src/App.jsx - Reader app → Subscription state: uses plan state
src/App.jsx - Authentication context → Supabase client: authenticates
src/contexts/AuthContext.jsx - Authentication context → Browser storage: sets user scope
src/contexts/AuthContext.jsx - Subscription state → Supabase client: reads plan data
src/hooks/useSubscription.js - Word pacer → Browser storage: saves settings
src/hooks/usePacer.js - Cloud documents → Supabase client: reads cloud documents
src/utils/cloudDocs.js - Reader app → Book library: uses library
src/App.jsx - Admin panel → Supabase client: manages profiles
src/pages/AdminPanel.jsx - Reader app → Event tracking: tracks events
src/App.jsx - Event tracking → Supabase client: writes events
src/utils/track.js - Checkout sessions → Stripe: creates sessions
README.md - Billing lifecycle → Stripe: handles lifecycle
README.md - Supabase client → Supabase service: connects to
src/utils/supabase.js