A PoC for local-first replicated tree synchronization using PowerSync and Supabase.
- Framework: Next.js 15
- Authentication: Supabase
- Sync Engine: PowerSync
- Database: Supabase (& PowerSync buckets for download)
- Styling: TailwindCSS
- State Management: MobX
- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.local-
Fill in the environment variables in
.env.local: -
Run the development server:
npm run watchsrc/app: Next.js app router pagessrc/components: Reusable React componentssrc/library: Core business logicauth: Authentication servicespowersync: Database and sync functionality
src/stores: MobX state management
npm run watch: Start development servernpm run build: Production buildnpm run start: Run production servernpm run lint: Run linting
src/
├── app/ # Next.js pages
├── components/
│ ├── Header.tsx # Main navigation
│ ├── TreeView/ # Tree visualization
│ └── providers/ # React context providers
├── library/
│ ├── auth/ # Authentication logic
│ └── powersync/ # Sync handling
└── stores/ # MobX state management