Project structure
Fylepad follows Nuxt.js conventions with additional directories for TipTap extensions and Tauri integration:Core directories
components/
Vue components are auto-imported by Nuxt. The main components include:editor.vue- The primary TipTap editor component (61k+ lines)tabLinkMenu.vue- Tab navigation and linking interfaceui/- Reusable UI components (buttons, dialogs, menus, etc.)
extensions/
Custom TipTap extensions that enhance the editor’s functionality:Extensions are registered in the editor component and extend TipTap’s base functionality with Fylepad-specific features.
pages/
Nuxt’s file-based routing. Each.vue file becomes a route:
index.vue- Main application page- Other pages as needed for routing
app.vue and components.
utils/
Utility functions shared across the application:- Editor configuration helpers
- PDF generation from editor content
- File import/export functions
stores/
Pinia stores for state management. Stores handle:- Tab management and state persistence
- Editor settings and preferences
- Document state and auto-save
- Theme and UI preferences
useStoreName() composables.
src-tauri/
The Rust backend for the desktop application:- Native file system operations
- Window management
- Platform-specific integrations
Data flow
Editor state management
- User Input → TipTap editor receives user actions
- Editor State → TipTap manages document state internally
- Extensions → Custom extensions modify behavior and output
- Store Sync → Pinia stores persist state to localStorage (web) or file system (desktop)
- Auto-save → Changes are automatically saved on a debounced timer
Tab management
- Tabs are stored in a Pinia store
- Each tab maintains its own editor state
- Tab state is serialized and saved (JSON for metadata, HTML/Markdown for content)
- On app load, tabs are restored from saved state
File operations
Web version:- Uses browser File System Access API (where supported)
- Falls back to download/upload for browsers without support
- LocalStorage for tab persistence
- Tauri plugin-fs for native file system access
- Direct read/write to user’s file system
- Native file dialogs for open/save
Configuration files
nuxt.config.ts
Configures the Nuxt application:- SSR disabled for static generation
- Modules: Tailwind, Icon, Color Mode, PWA
- Vite settings for Tauri integration
- Development server configuration
tauri.conf.json
Configures the Tauri desktop application:- Build commands:
pnpm run generate(before build),pnpm run dev(before dev) - Frontend dist:
../dist - Bundle targets: DMG (macOS), DEB (Linux), MSI (Windows)
- Window settings: 800x600 default, 600x600 minimum
package.json
Defines all Node.js dependencies and scripts:- 100+ dependencies including TipTap extensions
- Build scripts for web and desktop
- Development tooling (TypeScript, Tailwind, etc.)
Key concepts
Platform detection
Fylepad detects the runtime environment to enable platform-specific features:Extension architecture
TipTap extensions follow a modular pattern:- Extend base TipTap extension classes
- Define custom commands and keyboard shortcuts
- Implement rendering logic (if custom nodes)
- Register with the editor in
components/editor.vue
State persistence
State is persisted differently based on platform:- Web: localStorage + IndexedDB
- Desktop: JSON files in app data directory via Tauri
Next steps
Setup
Set up your development environment
Building
Build production releases