Skip to content

This portfolio is created for learning and educational purpose with notJust․dev

Notifications You must be signed in to change notification settings

yacmov/React-Native-ProfitFirst

Repository files navigation

Profit First App

This portfolio is created for learning and educational purpose with notJust․dev

  1. 🎯 Purpose
  2. 📸 Screenshots
  3. 📚 What did I learn with this project?
  4. 💻 Used Programs
  5. 📁 Folder Structure
  6. ※ Reference

Back

Portfolio: Learning Backend Logics with WatermelonDB

This portfolio aims to deepen my understanding of backend logics using WatermelonDB, with the ultimate goal of successfully deploying a React Native app on Android and iOS devices, as well as learning about local DB and remote DB synchronization.



Back

Accounts New Allocation Allocation



Back

Setting up WatermelonDB with Expo

To get started with WatermelonDB in your Expo project, following these steps:

# Setup WatermelonDB: Install WatermelonDB by running
npm install @nozbe/watermelondb
npm install -D @babel/plugin-proposal-decorators
# Add ES6 decorators support to `.babelrc` file:
{
  "presets": ["module:metro-react-native-babel-preset"],
  "plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }]]
}
# Prebuild for iOS and Android: Prebuilding WatermelonDB for both iOS and Android is necessary before using it in Expo app. This can be done by running
npx expo prebuild

# run iOS
npm run iOS

# run Android
npm run android

Local First Design

To reduce traffic and enhance user experience, consider implementing a local first design:
  • Local Data Storage: Store data locally on the device to minimize request to the remote database.
  • Data Syncing: Set up data syncing with the remote database when necessary. This can be done using WatermelonDB's built-in syncing features.

Schema Design

Schema design is crucial for successful synchronization and foreign key management in relation databases:
  • Entity-Attribute-Value (EAV) Model: WatermelonDB uses an EAV model to store data, which allows for flexible schema design.

  • foreign Keys: use foreign keys to establish relationships between entities. This enables efficient data retrieval and updating.

Best Practices

For optimal performance and user experience:

  • Reduce Traffic: Minimize requests to the remote database by storing data locally where possible.
  • Optimize Schema Design: Ensure its schema design is optimized for data synchronization and querying.
  • Use foreign Keys: Establish foreign keys to maintain relationship between entitles.


Back

React Native (TypeScripts)

  • Overview: Used for building native mobile apps, with TypeScript for added type safety and maintainability. This enables developers to create robust, scalable, and performant mobile applications.
  • Libraries/ Frameworks used: react-native, typescript, react-navigation

TailwindCSS (NativewindCSS)

  • Overview: Utilized for styling the application, providing a utility-first approach to build fast, consistent, and customizable user interfaces. This enables developers to create visually appealing and responsive UI components.
  • Features: Customizable CSS classes, Pre-defined components, Responsive design

Expo

  • Overview: Employed as a framework for managing the application's state and lifecycle, allowing for efficient and easy-to-use development of cross-platform mobile apps. This enables developers to focus on building the app's logic without worrying about the underlying complexities.
  • Libraries/ Frameworks used: expo, expo-sdk

WatermelonDB

  • Overview: Used as an ORM (Object-Relational Mapping) library to interact with databases, simplifying the process of data storage and retrieval. This enables developers to focus on building business logic without worrying about database complexities.
  • Features: Automatic schema management, SQL support, Type-safe queries

Supabase

  • Overview: Used as a PostgreSQL database service that provides a simple, GraphQL-based API and a beautiful web interface for managing your schema and data. This enables developers to create scalable, performant, and secure databases.
  • Features: GraphQL-based API, Web interface, Automatic backups, Role-based access control


Back

alt text



Back

notJust.dev

React Native

Expo

WatermelonDB

Supabase

About

This portfolio is created for learning and educational purpose with notJust․dev

Resources

Stars

Watchers

Forks