Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blefebvre/react-native-sqlite-demo
An offline-first list app built with React Native, SQLite, TypeScript, and Cocoapods. Runs on iOS and macOS.
https://github.com/blefebvre/react-native-sqlite-demo
react-native react-native-macos sqlite typescript
Last synced: 17 days ago
JSON representation
An offline-first list app built with React Native, SQLite, TypeScript, and Cocoapods. Runs on iOS and macOS.
- Host: GitHub
- URL: https://github.com/blefebvre/react-native-sqlite-demo
- Owner: blefebvre
- License: mit
- Created: 2018-09-30T19:45:08.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T01:36:31.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T02:32:58.328Z (3 months ago)
- Topics: react-native, react-native-macos, sqlite, typescript
- Language: TypeScript
- Homepage: https://brucelefebvre.com/blog/2020/05/03/react-native-offline-first-db-with-sqlite-hooks/
- Size: 3.39 MB
- Stars: 112
- Watchers: 3
- Forks: 38
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://cocoapods.org/))
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](https://github.com/wix/Detox/blob/master/docs/Guide.DevelopingWhileWritingTests.md):
npm run test:e2e:reuse
## Troubleshooting
#### Run Metro Bundler and clear it's cache
npm start -- --reset-cache