The Ultimate Offline-First Progressive Web App Framework
Rapid PWA development with multiple batteries for seamless offline experiences
Fluid PWA is a production-ready framework that makes building offline-first Progressive Web Apps effortless. It provides a robust, configurable, and developer-friendly solution for rapid PWA development with multiple batteries for offline data management and automatic synchronization status tracking.
- ๐ง Zero Configuration - Works out of the box with sensible defaults
- ๐ฃ React Hooks - Clean, composable API that feels natural
- ๐ฑ Offline-First - Designed to work seamlessly without internet
- ๐ Sync Management - Automatic tracking of pending changes
- ๐ช TypeScript - Full type safety with intelligent inference
- โก Performance - Optimized for speed and efficiency
Open Source: This project is created and maintained by @harshalmore31 as an open-source initiative to provide the ultimate offline-first PWA framework.
npm install fluid-pwa dexie dexie-react-hooks uuid
# or
yarn add fluid-pwa dexie dexie-react-hooks uuid
# or
pnpm add fluid-pwa dexie dexie-react-hooks uuidimport { FluidPWAProvider, FluidPWAConfig } from 'fluid-pwa'
// 1. Define your data schema
const schema = {
notes: '++localId, title, content, syncStatus, lastModifiedOffline, userId',
tasks: '++localId, title, completed, priority, syncStatus, lastModifiedOffline, userId'
}
// 2. Configure Fluid PWA
const config: FluidPWAConfig = {
databaseName: 'MyApp',
schema,
version: 1,
enableLogging: true
}
// 3. Wrap your app
export default function App() {
return (
<FluidPWAProvider config={config}>
<MyApp />
</FluidPWAProvider>
)
}import { useAddItem, useGetAllItems, useUpdateItem, useDeleteItem } from 'fluid-pwa'
function NotesApp() {
const addNote = useAddItem<Note>('notes')
const notes = useGetAllItems<Note>('notes')
const updateNote = useUpdateItem<Note>('notes')
const deleteNote = useDeleteItem('notes')
const handleAdd = async () => {
const result = await addNote({
title: 'My Note',
content: 'This works offline!'
})
if (result.success) {
console.log('โ
Note saved with ID:', result.data)
}
}
return (
<div>
<button onClick={handleAdd}>Add Note</button>
{notes?.map(note => (
<div key={note.localId}>
<h3>{note.title}</h3>
<span>{note.syncStatus}</span> {/* PENDING_CREATE, SYNCED, etc. */}
</div>
))}
</div>
)
}Every data change is automatically tracked with sync statuses like PENDING_CREATE, PENDING_UPDATE, SYNCED, making it easy to implement data synchronization.
useAddItem- Create new items with validation hooksuseGetAllItems- Reactive queries with filtering and sortinguseUpdateItem- Update with automatic sync status handlinguseDeleteItem- Smart deletion (hard/soft delete based on sync status)useGetPendingItems- Get items that need to be synceduseFluidPWAStats- Database statistics for monitoring
Built on Dexie's live queries - your UI automatically updates when data changes, even across browser tabs!
Full TypeScript support with intelligent type inference:
interface Note {
title: string
content: string
}
const notes = useGetAllItems<Note>('notes') // Fully typed!const addNote = useAddItem<Note>('notes', {
onBeforeAdd: async (note) => {
// Validation, transformation, etc.
return { ...note, slug: generateSlug(note.title) }
},
onAfterAdd: async (note, id) => {
// Analytics, notifications, etc.
analytics.track('Note Created', { id })
}
})Experience Fluid PWA in action:
๐ View the Demo
The demo showcases:
- โ Creating and managing notes offline
- โ Real-time sync status indicators
- โ Database statistics dashboard
- โ Works completely offline
- โ Multi-tab synchronization
Fluid PWA is built on a solid foundation:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React Components โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Fluid PWA Hooks โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Dexie.js Database โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ IndexedDB API โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Phase 1 (Current): Foundation & Core CRUD Operations
Phase 2 (Coming): Background Sync & Conflict Resolution
Phase 3 (Future): Real-time Collaboration & Advanced Sync
We welcome contributions! Fluid PWA is built by the community, for the community.
# 1. Fork & Clone
git clone https://github.com/YOUR_USERNAME/fluid-pwa.git
cd fluid-pwa
# 2. Install dependencies
npm install
# 3. Start development
npm run dev
# 4. Make your changes and test
npm run test
# 5. Submit a PR!- ๐ Bug Fixes - Help us squash bugs
- โจ New Features - Add hooks, utilities, or integrations
- ๐ Documentation - Improve guides and examples
- ๐งช Testing - Add test cases and improve coverage
- ๐จ Examples - Create real-world usage examples
- ๐ Performance - Optimize queries and operations
- Code Style: We use ESLint and Prettier
- Testing: Add tests for new features
- Documentation: Update docs for API changes
- TypeScript: Maintain strict type safety
- Commits: Use conventional commit messages
- Core Dexie.js integration
- React hooks for CRUD operations
- Automatic sync status tracking
- TypeScript support
- Provider pattern
- Comprehensive documentation
- Background sync with Service Workers
- Conflict resolution strategies
- Retry mechanisms with exponential backoff
- Batch operations optimization
- Advanced error handling
- Real-time collaboration
- Multi-device synchronization
- Encryption support
- Plugin architecture
- Cloud storage integrations
| Feature | Fluid PWA | Manual Setup | Other Solutions |
|---|---|---|---|
| Setup Time | 5 minutes | Days/Weeks | Hours |
| TypeScript | โ Built-in | ๐ง Manual | โ Limited |
| Sync Status | โ Automatic | ๐ง Manual | โ None |
| React Hooks | โ Optimized | ๐ง Build Your Own | โ Limited |
| Offline-First | โ By Design | ๐ง Complex Setup | โ Afterthought |
| Testing | โ Test Utils | ๐ง DIY | โ Difficult |
Join our growing community of developers building amazing offline-first apps!
- ๐ฌ GitHub Discussions - Get help and share ideas
- ๐ GitHub Issues - Report bugs and request features
Apache 2.0 License - see the LICENSE file for details.
Fluid PWA is open source and free. If you find it useful, consider sponsoring the project:
- Dexie.js - Excellent IndexedDB wrapper used for offline data management
- Next.js - The React framework that makes PWAs awesome
- Open Source Community - For the amazing tools and libraries that make this possible
๐ Repository โข ๐ Documentation โข ๐ Demo โข ๐ฌ Discussions
Built with โค๏ธ by Harshal More