NewCode with Beto MCP

Building a Notion Clone with React Native Expo & Prisma | Local-First Tutorial

Beto, July 15, 2024 · 21,970 views

Notion's magic is files inside files, forever. It turns out you can model that recursion with one Prisma schema and render it with a single component. I built a local-first Notion clone where everything lives in SQLite on the device, so queries are instant and the app works offline.

No state management juggling either: Prisma hooks like read straight from the database. Full build in the video.

What's inside

  • Define a recursive Prisma schema where files have parents and children
  • Use Prisma's Early Access hooks with Expo and SQLite
  • Edit markdown inline with a toolbar above the keyboard
  • Persist drag-and-drop order across reloads
  • Delete nested files recursively with no orphaned data
  • Dark mode, search, and recent files grouped by day

Resources

CourseReact Native course

Let's connect!

Had a win? Get featured on Code with Beto.Share your story