This is a basic todo app built using React Native. The app uses Hasura for its backend, leveraging the following features of Hasura:
- Hasura Database
- GraphQL queries provided by Hasura
- Apollo Client
- React Native Auth Boilerplate for authentication.
- Ensure that you have the HasuraCLI installed on your local machine.
- Login into Hasura by running the following command on your command shell
hasura login
To get the project, run the following in your command shell:
hasura quickstart hasura/react-native-apollo-todo
- Add your cluster name to
react-native-app/Hasura.js
. (Runhasura cluster status
from the root directory to get your cluster name).
const clusterName = "comrade45" //Replace "comrade45" with your cluster name
git push
the project tohasura
remote to push the local configurations, migrations and deployments to the cluster.
$ git add .
$ git commit -m "First commit"
$ git push hasura master
cd
into thereact-native-app
directory and install the required node modules.
$ cd react-native-app
$ npm install
- Run the app
$ npm start
- On running the above command, a QR code will be generated in the terminal. Scan it from the Expo app on your phone to try out the app.
This app is built using Create React Native App. If you do not wish to use Expo for development, just run
npm run eject
from thereact-native-app
directory and you will get the app in the form of a rawreact-native
project.
The source code for the Todo App lies in the react-native-app directory.
The root component for the Todo App
is src/AppScreen.js
.
To explore the Hasura features and learn how to use them, checkout our 20 minute hello-react
guide here.