eventbox is a small sample app written in react-native, which uses EventBox's GraphQL API as a backend and performs some basic queries and mutations using apollo-client.
- ⚛️ react-native
- 🚀 apollo-client
- 💅 styled-components
- ✅ jest
- Support for building native code
- Styling using styled-components
- In-app navigation/routing handled via react-navigation
- creating a stack navigator
- navigation between screens, passing parameters to routes
- configuring the header bar
- Remote data managed using apollo-client
- queries: get first 10 repositiories by language
- mutations: star a repository
- Local data also managed by apollo-client using apollo-link-state
- store user language selection in Apollo cache
- Offline support using apollo-cache-persist
- language selection is persisted
- repositories list can be viewed while offline
- Unit tests with jest
This app was developed following the steps in the react-native docs - "Building projects with native code". Env setup:
Environment:
Node: 8.12.0
Yarn: 1.12.3
npm: 6.4.1
Watchman: 4.9.0
Xcode: 9.2/9C40b - /usr/bin/xcodebuild
Android Studio: 3.2 AI-181.5540.7.32.5056338
To communicate with the GraphQL server, follow the steps in "Creating a GraphQL Eventbox Server. After creating a server, follow these steps to start the app:
$ git clone https://github.com/legend1250/eventbox-mobile.git
$ cd eventbox && touch .env
$ echo "SERVER_URI_IOS=https://192.168.1.246:8000/graphql" > .env
$ echo "SERVER_URI_ANDROID=https://192.168.1.246:8000/graphql" > .env
$ yarn install
$ yarn ios OR yarn android
yarn ios
- start the app in the iOS simulatoryarn android
- start the app in the Android emulatoryarn lint
- runs eslint checks + fixesyarn test
- runs available unit tests