How betomoedano/react-native-notion-clone works
Main Components
• Mobile Frontend – The core UI lives in the app/ directory. The “app” folder contains several screens (e.g., tabs, _layout.tsx, explore.tsx, new-notion.tsx) that represent different sections. Also, there’s a components/ directory for reusable UI components (like Collapsible, DraggableNotionList, NotionButton, etc.) and hooks (e.g., useColorScheme).
• Data Layer & Local Persistence – The project contains a Prisma schema (schema.prisma), migrations (in the migrations folder), and an SQLite database file (app.db). This indicates that the mobile app is using a local database solution managed by Prisma ORM.
• Assets & Constants – The assets (e.g., fonts, images) and constants folders hold design and styling elements, while additional libraries (such as navigation components inside components/navigation) support the UI.
• Build & Configuration – Files like app.json, babel.config.js, eas.json, package.json, and tsconfig.json show that the project is configured for Expo, TypeScript, and has rules for the build and deployment processes.
• Scripts & Queries – Additional support functions include scripts for project resetting and queries.sql for explicit SQL commands when needed.
Relationships and Interactions
• UI <-> Business Logic: The Expo/React-based UI layer (app/ and components/) drives user interactions via hooks and reusable components.
• Business Logic <-> Data Layer: The UI layer makes calls (possibly via direct Prisma Client usage) to the local SQLite database. This interaction is managed by Prisma (with its schema, migrations, and generated client).
• Data Persistence: The migrations folder shows version control for the database schema. The “app.db” file acts as the local database, ensuring data persistence in a “local-first” manner.
• Build/Configuration to All Layers: The configuration files ensure that the proper environment and build processes are applied to both UI and data layers.
Architectural Patterns and Key Technologies
• Separation of Concerns/MVC-ish Structure: Even though mobile apps don’t strictly follow MVC, you have a clear separation between presentational components (in app/ and components/), business logic (hooks, constants), and data persistence (Prisma schema and migrations).
• Mobile-First Design: Expo and React Native patterns are followed for a mobile experience. Notice the separation of screens (tabs, layouts) and a component-driven approach.
• Local-First and Offline Considerations: The usage of an SQLite database (app.db) with Prisma migrations indicates an emphasis on local storage and possibly offline-first capabilities.