Giter Club home page Giter Club logo

blefebvre / react-native-sqlite-demo Goto Github PK

View Code? Open in Web Editor NEW
111.0 3.0 36.0 3.47 MB

An offline-first list app built with React Native, SQLite, TypeScript, and Cocoapods. Runs on iOS and macOS.

Home Page: https://brucelefebvre.com/blog/2020/05/03/react-native-offline-first-db-with-sqlite-hooks/

License: MIT License

TypeScript 73.46% Java 5.72% JavaScript 1.71% Ruby 10.91% Objective-C 6.25% Starlark 1.77% C 0.19%
react-native react-native-macos sqlite typescript

react-native-sqlite-demo's Introduction

React Native SQLite + Dropbox sync demo

This project is a basic List application that demonstrates building an offline first app with SQLite and React Native (featuring TypeScript and CocoaPods under the hood). Once authorized, the database can be synced between multiple iOS devices using Dropbox.

These instructions cover iOS and macOS usage at this time.

Install JS dependencies

npm install

Install iOS dependencies (requires Cocoapods)

pushd ios/
pod install
popd

Install macOS dependencies

pushd macos/
pod install
popd

Start the React Native Metro Bundler

npm run start:macos

Run (and debug) on the iOS simulator

With the "React Native Tools" VSCode extension installed, open the Debug tab and press the "Play" button with "Debug iOS" selected in the dropdown.

When the simulator opens, press Command-D to open the developer menu. Tap "Debug JS Remotely" to connect VSCode to the app and enable debugging.

Alternatively:

open ios/RNSQLiteDemo.xcworkspace

Select a simulator of your choice. Press the "run" button.

Run on the macOS simulator

Open the macOS Xcode project:

open macos/RNSQLiteDemo.xcworkspace/

Select My Mac as the "active scheme". Press the "Build and then run" (Play) button.

Types and testing

Compile TypeScript source in watch mode

npm run tsc -- -w

Run the Jest unit tests

npm test

E2E Testing with Detox on iOS

End-to-end testing happens from within the e2e/ directory:

cd e2e/
npm install

Build E2E tests

npm run test:e2e:build

Run E2E tests

npm run test:e2e

Run tests without reinstalling onto the Simulator

Details on this workflow can be found here:

npm run test:e2e:reuse

Troubleshooting

Run Metro Bundler and clear it's cache

npm start -- --reset-cache

react-native-sqlite-demo's People

Contributors

blefebvre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-sqlite-demo's Issues

TypeScript errors during compile

Running the TypeScript watch command (npm run tsc) results in a number of errors. 64 to be exact:

[8:56:30 p.m.] Found 64 errors. Watching for file changes.

This is an issue which has started since I began using a new machine.

Implementation on android

Hi sir, thank you the wonderful explanation and open source code, i am trying to implement this app on android. Modified OAUTH_REDIRECT_URI and client_id, but i think after authorization redirect from dropbox is failing and app is not linking to dropbox. Local DB is working fine.Please throw some light on selection of OAUTH_REDIRECT_URI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.