A modern, subscription-based document conversion platform that transforms documents (PDF, Word, OpenDocument) into HTML, HTL, and XML formats with advanced customization options.
- Multi-Format Support: Upload and convert
.docx,.doc,.pdf, and.odtfiles - Flexible Output Formats: Convert to HTML, HTL, or XML with preserved formatting
- Advanced Conversion Rules: Configure tag conversions, attribute rules, ignore/delete tags with conditional logic (AND/OR)
- Table of Contents Splitting: Automatically split documents by TOC into separate sections
- Preset Management: Save, load, export, and import conversion settings
- User Authentication: Secure login and sign-up with JWT-based authentication
- Subscription Tiers: Free tier (10 pages) and paid options for additional conversions
- Real-time Preview: Syntax-highlighted preview of converted content
- Drag-and-Drop Interface: Intuitive file upload with drag-and-drop support
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Framework: Next.js 14 (App Router)
- UI Library: React 18 with TypeScript
- Styling: Tailwind CSS with custom design system
- UI Components: Radix UI primitives
- State Management: TanStack Query (React Query) for server state
- Form Handling: React Hook Form with Zod validation
- Drag & Drop: react-beautiful-dnd
- Code Highlighting: react-syntax-highlighter with Prettier formatting
- Icons: Lucide React, React Icons
- API Client: Custom fetch wrappers for client and server-side requests
- Authentication: Cookie-based JWT authentication
- Middleware: Next.js middleware for route protection
- Type Safety: TypeScript with strict mode
- Code Quality: ESLint, Prettier
- Package Manager: npm
The application implements a sophisticated conversion engine that supports:
- Conditional tag transformations with property-based rules
- Multiple operators (contains, startsWith, endsWith, equals, matches, parent/child relationships)
- Complex logic operators (AND/OR) for combining conditions
- Nested rule validation and error handling
This required building a flexible state management system that maintains conversion settings, validates rules in real-time, and provides a user-friendly interface for configuring complex transformations.
The application uses react-beautiful-dnd for reordering conversion rules, which has known compatibility issues with React's Strict Mode. This was solved by implementing a custom StrictModeDroppable wrapper that uses requestAnimationFrame to defer component mounting until after the initial render cycle, ensuring proper initialization of the drag-and-drop context.
- Node.js 18+ and npm
- Access to the backend API (backend code not included in this repository)
-
Clone the repository
git clone https://github.com/yourusername/DocsConvert.git cd DocsConvert -
Install dependencies
npm install
-
Configure environment variables Create a
.env.localfile in the root directory:NEXT_PUBLIC_API_URL=your_backend_api_url
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
npm run build
npm startnpm run lint- Run ESLintnpm run type-check- Run TypeScript type checking
DocsConvert/
├── app/ # Next.js App Router pages
│ ├── auth/ # Authentication pages
│ ├── convert/ # Document conversion feature
│ │ ├── components/ # Conversion-specific components
│ │ ├── hooks/ # Custom React hooks
│ │ └── types/ # TypeScript type definitions
│ ├── legal/ # Legal pages (ToS, Privacy, etc.)
│ └── resources/ # Support and blog pages
├── components/ # Shared React components
│ └── ui/ # Reusable UI components (Radix UI)
├── lib/ # Utility functions and API clients
├── types/ # Global TypeScript types
└── public/ # Static assets
- Upload a file: Navigate to
/convertand drag-and-drop or select a document - Select output format: Choose HTML, XML, or HTL
- Configure conversion rules (optional):
- Add tag conversions (e.g.,
<p>→<div>) - Set attribute rules for specific tags
- Configure tags to ignore or delete
- Use conditional logic for complex transformations
- Add tag conversions (e.g.,
- Convert: Click "Convert File" to process the document
- Download or copy: Use the download button or copy to clipboard
- Select "Split by Table of Contents" view mode
- Upload and convert your document
- Browse sections in the sidebar
- Download individual sections or all sections as a ZIP file
Save frequently used conversion settings as presets for quick reuse:
- Configure your conversion rules
- Enter a preset name
- Click "Save Preset"
- Load saved presets from the dropdown menu
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
- Next.js - React framework
- Radix UI - Unstyled UI primitives
- Tailwind CSS - Utility-first CSS framework
- TanStack Query - Data fetching and state management
- Vercel - Deployment platform