How pacexy/flow works
Main Components
• Reader Application (apps/reader)
– This Next.js–based app is the core ePub reader. It contains components for annotations, text selection, custom typography, and other reader features.
– Include subcomponents like UI elements (components folder with buttons, layouts, annotation views, etc.), state and hooks (for remote sync, theming, text selection, etc.), and API endpoints (pages/api for callbacks, refresh, etc.).
• Marketing Website (apps/website)
– This app serves as the public-facing website with product info, screenshots, and static pages (e.g., privacy, terms) built with Next.js and MDX.
• ePub Engine (packages/epubjs)
– A dedicated package that contains core logic to parse, render, and manage ePub documents. It includes modules for annotations, spine, container, pagination, mapping, and various utility functions.
• Shared/Utility Packages
– Internal shared libraries (packages/internal) serve any additional common functionality required by the apps.
– A Tailwind package (packages/tailwind) for global styling, theming, and custom design tokens.
• Infrastructure & Tooling
– Configuration and deployment tools such as Dockerfile, docker-compose.yml, Turborepo (turbo.json), and pnpm setup ensure that the project can be built, run, and deployed consistently.
– Build and linting configuration files (.eslintrc.js, prettier.config.js, tsconfig, etc.) indicate a focus on code quality and a standardized development workflow.
Relationships and Interactions
• The UI components and hooks inside the reader interact with backend API endpoints (via Next.js pages/api) to manage annotations, search, share/download links, and integration with cloud storage.
• The website app is related but separate; it primarily serves marketing content and may link to the reader application.
• Shared packages such as internal utilities and Tailwind help maintain consistent styling and common functions across both apps.
Architectural Patterns and Design Principles
• API Integration: Highlight the REST or serverless endpoints under apps/reader/pages/api as a separate “backend” block within the reader module.
• Reusability & Modularity: Emphasize that packages like epubjs, internal, and tailwind are designed for reuse across different sub-apps.