A modern, modular EPUB book reader built with React and react-reader, featuring:
- EPUB reading with persistent location
- Light/Dark mode with theme persistence
- Custom font selection
- Text selection and multi-color highlights
- Highlight sidebar for managing highlights
- Sticky notes: draggable, editable, and persistent in the session
- Clean, modular code with isolated feature and style files
- EPUB Viewer: Reads local EPUB files using
react-reader. - Themes: Toggle between light and dark mode. Theme is saved per user.
- Fonts: Choose from several fonts for comfortable reading.
- Highlights: Select text and highlight in multiple colors. Manage all highlights in a sidebar.
- Sticky Notes: Add, move (drag-and-drop), edit, and delete sticky notes anywhere in the reading area.
- Responsive UI: Modern, clean, and easy to use.
- Node.js (v16+ recommended)
- npm
- Clone the repository:
git clone (https://github.com/MohammedAmr04/React-EPUB-Reader) cd Bookreading - Install dependencies:
npm install
npm run devOpen http://localhost:5173 in your browser.
Place your .epub file in the public/ folder and update the url prop in App.jsx if needed.
src/
App.jsx # Main app logic
App.css # Main app styles
BookReaderFeatures.jsx # Feature bar (theme, font, highlight color)
BookReaderFeatures.css # Feature bar styles
HighlightFeatures.jsx # Highlight sidebar & color picker
stickynotes/
StickyNote.jsx # Sticky note component (draggable)
StickyNote.css # Sticky note styles
...
- react-reader
- @dnd-kit/core (for sticky note drag-and-drop)
- React, Vite
- Highlight text: Select text in the book, then choose a highlight color.
- Manage highlights: Open the sidebar to view, jump to, or remove highlights.
- Sticky notes: Double-click anywhere or use the "+ Add Sticky Note" button to add a note. Drag to move, edit text, or delete.
- Change theme or font: Use the feature bar at the top right.
- Add more fonts or highlight colors in
App.jsx. - Adjust sticky note styles in
stickynotes/StickyNote.css.
This project includes a simple book-server (Node.js/Express) for serving EPUB files or handling downloads. Useful if you want to serve books dynamically or from a backend instead of the public/ folder.
- Go to the
book-serverdirectory:cd book-server - Install dependencies:
npm install
- Start the server:
node server.js
- Place your EPUB files in
book-server/downloads/.
You can then update the url prop in App.jsx to point to your backend, e.g.:
<ReactReader url="http://localhost:3000/downloads/book_76248.epub" ... />MIT "# React-EPUB-Reader"