├── .watchmanconfig ├── amplify ├── backend │ ├── api │ │ └── todoApi │ │ │ ├── schema.graphql │ │ │ └── build │ │ │ ├── parameters.json │ │ │ ├── schema.graphql │ │ │ └── cloudformation-template.json │ ├── backend-config.json │ ├── auth │ │ └── amplifyprojectb3fea6ea │ │ │ ├── parameters.json │ │ │ └── amplifyprojectb3fea6ea-cloudformation-template.yml │ ├── amplify-meta.json │ └── awscloudformation │ │ └── nested-cloudformation-stack.yml ├── #current-cloud-backend │ ├── api │ │ └── todoApi │ │ │ ├── schema.graphql │ │ │ └── build │ │ │ ├── parameters.json │ │ │ ├── schema.graphql │ │ │ └── cloudformation-template.json │ ├── backend-config.json │ └── amplify-meta.json └── team-provider-info.json ├── .expo-shared └── assets.json ├── .idea ├── misc.xml ├── vcs.xml ├── modules.xml └── amplifyProject.iml ├── .graphqlconfig.yml ├── src ├── components │ ├── filterReducer.js │ ├── OAuthButton.js │ ├── helpers.js │ ├── store.js │ ├── dialogReducer.js │ ├── Dialog.js │ ├── Bottom.js │ ├── reducers.js │ ├── signUp │ │ ├── SignUpConfirm.js │ │ └── SignUp.js │ ├── forgotPassword │ │ ├── ForgotPassword.js │ │ └── ForgotPasswordConfirm.js │ ├── Header.js │ ├── actions.js │ ├── Todos.js │ └── signIn │ │ └── SignIn.js ├── navigation │ ├── appFlowNav.js │ ├── index.js │ ├── forgotPassword.js │ └── authNavigation.js ├── screens │ └── HomeScreen.js └── graphql │ ├── queries.js │ ├── subscriptions.js │ ├── mutations.js │ └── schema.json ├── App.js ├── package.json └── aws-exports.js /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /amplify/backend/api/todoApi/schema.graphql: -------------------------------------------------------------------------------- 1 | type Todo @model { 2 | id: ID! 3 | name: String! 4 | description: String 5 | time: String 6 | completed: Boolean 7 | 8 | } -------------------------------------------------------------------------------- /.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true, 3 | "89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true 4 | } -------------------------------------------------------------------------------- /amplify/#current-cloud-backend/api/todoApi/schema.graphql: -------------------------------------------------------------------------------- 1 | type Todo @model { 2 | id: ID! 3 | name: String! 4 | description: String 5 | time: String 6 | completed: Boolean 7 | 8 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.graphqlconfig.yml: -------------------------------------------------------------------------------- 1 | projects: 2 | todoApi: 3 | schemaPath: src/graphql/schema.json 4 | includes: 5 | - src/graphql/**/*.js 6 | excludes: 7 | - ./amplify/** 8 | extensions: 9 | amplify: 10 | codeGenTarget: javascript 11 | generatedFileName: '' 12 | docsFilePath: src/graphql 13 | -------------------------------------------------------------------------------- /src/components/filterReducer.js: -------------------------------------------------------------------------------- 1 | import {SET_FILTER} from "./actions"; 2 | 3 | const INITIAL_VALUE = { 4 | filter: '' 5 | }; 6 | 7 | export const filterReducer = (state=INITIAL_VALUE, action) => { 8 | const {type, payload} = action; 9 | switch (type) { 10 | case SET_FILTER: return {...state, filter: payload.filter}; 11 | default: return state; 12 | } 13 | }; -------------------------------------------------------------------------------- /src/components/OAuthButton.js: -------------------------------------------------------------------------------- 1 | import { withOAuth } from 'aws-amplify-react-native'; 2 | import React, { Component } from 'react'; 3 | 4 | class OAuthButton extends Component { 5 | render() { 6 | return ( 7 | 10 | ) 11 | } 12 | } 13 | 14 | export default withOAuth(OAuthButton); -------------------------------------------------------------------------------- /amplify/backend/api/todoApi/build/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "CreateAPIKey": 1, 3 | "AppSyncApiName": "todoApi", 4 | "DynamoDBBillingMode": "PAY_PER_REQUEST", 5 | "DynamoDBEnableServerSideEncryption": "false", 6 | "S3DeploymentBucket": "amplifyproject-test-20190919143906-deployment", 7 | "S3DeploymentRootKey": "amplify-appsync-files/4b4b159fa3fedb4ab8ed48d581bcb35cf038c826" 8 | } -------------------------------------------------------------------------------- /amplify/#current-cloud-backend/api/todoApi/build/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "CreateAPIKey": 1, 3 | "AppSyncApiName": "todoApi", 4 | "DynamoDBBillingMode": "PAY_PER_REQUEST", 5 | "DynamoDBEnableServerSideEncryption": "false", 6 | "S3DeploymentBucket": "amplifyproject-test-20190919143906-deployment", 7 | "S3DeploymentRootKey": "amplify-appsync-files/4b4b159fa3fedb4ab8ed48d581bcb35cf038c826" 8 | } -------------------------------------------------------------------------------- /src/components/helpers.js: -------------------------------------------------------------------------------- 1 | import PubSub from '@aws-amplify/pubsub'; 2 | import config from "../../aws-exports"; 3 | import API, {graphqlOperation} from "@aws-amplify/api"; 4 | 5 | API.configure(config) ; // Configure Amplify 6 | PubSub.configure(config); 7 | 8 | export const graphQLOperation = (operation, payload) => { 9 | return API.graphql(graphqlOperation(operation, payload)); 10 | }; 11 | -------------------------------------------------------------------------------- /src/navigation/appFlowNav.js: -------------------------------------------------------------------------------- 1 | import {createStackNavigator} from "react-navigation-stack"; 2 | import HomeScreen from "../screens/HomeScreen"; 3 | 4 | const routeConfigs = { 5 | Home: { 6 | screen: HomeScreen 7 | }, 8 | }; 9 | 10 | const stackNavigatorConfig = { 11 | initialRouteName: 'Home', 12 | }; 13 | 14 | const appStackNavigator = createStackNavigator(routeConfigs, stackNavigatorConfig); 15 | 16 | export default appStackNavigator; -------------------------------------------------------------------------------- /.idea/amplifyProject.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/components/store.js: -------------------------------------------------------------------------------- 1 | import {createStore, applyMiddleware, combineReducers} from "redux"; 2 | import thunk from 'redux-thunk'; 3 | import {composeWithDevTools} from "redux-devtools-extension"; 4 | import queryReducer from './reducers'; 5 | import {filterReducer} from './filterReducer'; 6 | import dialog from './dialogReducer'; 7 | 8 | 9 | export const store = createStore(combineReducers({ 10 | queryReducer, 11 | filterReducer, 12 | dialog, 13 | }), 14 | composeWithDevTools(applyMiddleware(thunk)) 15 | ); -------------------------------------------------------------------------------- /src/screens/HomeScreen.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View} from 'react-native'; 3 | import Header from "../components/Header"; 4 | import Todos from "../components/Todos"; 5 | import Bottom from "../components/Bottom"; 6 | 7 | const HomeScreen = (props) => { 8 | return ( 9 | 10 |
11 | 12 | 13 | {console.log(props)} 14 | {console.log('HomeScreen 14')} 15 | 16 | ); 17 | }; 18 | 19 | export default HomeScreen; -------------------------------------------------------------------------------- /src/components/dialogReducer.js: -------------------------------------------------------------------------------- 1 | import {SET_DIALOG, QUERY } from './actions'; 2 | 3 | const initialState = { 4 | showDialog: false, 5 | title: '', 6 | message: '', 7 | }; 8 | 9 | const dialogReducer = (state=initialState, action) => { 10 | const {type, payload} = action; 11 | console.log(state); 12 | console.log('dialogreducer 18'); 13 | switch(type) { 14 | case SET_DIALOG: return {...state, showDialog: true, title: payload.title, message: payload.message}; 15 | default: return state; 16 | } 17 | }; 18 | 19 | export default dialogReducer; -------------------------------------------------------------------------------- /src/navigation/index.js: -------------------------------------------------------------------------------- 1 | import {createSwitchNavigator, createAppContainer} from "react-navigation"; 2 | import authNavigation from "./authNavigation"; 3 | import appFlowNav from "./appFlowNav"; 4 | 5 | 6 | const routeConfig = { 7 | Auth: { 8 | screen: authNavigation, 9 | }, 10 | App: { 11 | screen: appFlowNav 12 | } 13 | }; 14 | 15 | const switchNavigatorConfig = { 16 | initialRouteName: 'Auth', 17 | }; 18 | 19 | const switchNavigator = createSwitchNavigator(routeConfig, switchNavigatorConfig); 20 | 21 | export default createAppContainer(switchNavigator); -------------------------------------------------------------------------------- /amplify/backend/backend-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "api": { 3 | "todoApi": { 4 | "service": "AppSync", 5 | "providerPlugin": "awscloudformation", 6 | "output": { 7 | "authConfig": { 8 | "additionalAuthenticationProviders": [], 9 | "defaultAuthentication": { 10 | "authenticationType": "API_KEY", 11 | "apiKeyConfig": { 12 | "description": "API key desc", 13 | "apiKeyExpirationDays": 180 14 | } 15 | } 16 | } 17 | } 18 | } 19 | }, 20 | "auth": { 21 | "amplifyprojectb3fea6ea": { 22 | "service": "Cognito", 23 | "providerPlugin": "awscloudformation", 24 | "dependsOn": [] 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/graphql/queries.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // this is an auto generated file. This will be overwritten 3 | 4 | export const getTodo = `query GetTodo($id: ID!) { 5 | getTodo(id: $id) { 6 | id 7 | name 8 | description 9 | time 10 | completed 11 | } 12 | } 13 | `; 14 | export const listTodos = `query ListTodos( 15 | $filter: ModelTodoFilterInput 16 | $limit: Int 17 | $nextToken: String 18 | ) { 19 | listTodos(filter: $filter, limit: $limit, nextToken: $nextToken) { 20 | items { 21 | id 22 | name 23 | description 24 | time 25 | completed 26 | } 27 | nextToken 28 | } 29 | } 30 | `; 31 | -------------------------------------------------------------------------------- /amplify/#current-cloud-backend/backend-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "api": { 3 | "todoApi": { 4 | "service": "AppSync", 5 | "providerPlugin": "awscloudformation", 6 | "output": { 7 | "authConfig": { 8 | "additionalAuthenticationProviders": [], 9 | "defaultAuthentication": { 10 | "authenticationType": "API_KEY", 11 | "apiKeyConfig": { 12 | "description": "API key desc", 13 | "apiKeyExpirationDays": 180 14 | } 15 | } 16 | } 17 | } 18 | } 19 | }, 20 | "auth": { 21 | "amplifyprojectb3fea6ea": { 22 | "service": "Cognito", 23 | "providerPlugin": "awscloudformation", 24 | "dependsOn": [] 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/graphql/subscriptions.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // this is an auto generated file. This will be overwritten 3 | 4 | export const onCreateTodo = `subscription OnCreateTodo { 5 | onCreateTodo { 6 | id 7 | name 8 | description 9 | time 10 | completed 11 | } 12 | } 13 | `; 14 | export const onUpdateTodo = `subscription OnUpdateTodo { 15 | onUpdateTodo { 16 | id 17 | name 18 | description 19 | time 20 | completed 21 | } 22 | } 23 | `; 24 | export const onDeleteTodo = `subscription OnDeleteTodo { 25 | onDeleteTodo { 26 | id 27 | name 28 | description 29 | time 30 | completed 31 | } 32 | } 33 | `; 34 | -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Provider} from 'react-redux'; 3 | import {store} from './src/components/store'; 4 | import HomeScreen from "./src/screens/HomeScreen"; 5 | import Amplify from 'aws-amplify'; 6 | import Navigation from './src/navigation'; 7 | 8 | import awsconfig from './aws-exports'; 9 | import { withAuthenticator } from 'aws-amplify-react-native'; 10 | 11 | Amplify.configure(awsconfig); 12 | 13 | 14 | const App = () => { 15 | return ( 16 | 17 | {/**/} 18 | {/* */} 19 | {/**/} 20 | 21 | 22 | 23 | ); 24 | }; 25 | 26 | export default App; -------------------------------------------------------------------------------- /src/navigation/forgotPassword.js: -------------------------------------------------------------------------------- 1 | import {createStackNavigator} from "react-navigation-stack"; 2 | import {createSwitchNavigator} from "react-navigation"; 3 | import ForgotPassword from '../components/forgotPassword/ForgotPassword'; 4 | import ForgotPasswordConfirm from "../components/forgotPassword/ForgotPasswordConfirm"; 5 | 6 | const routeConfig = { 7 | ForgotPassword: { 8 | screen: ForgotPassword, 9 | }, 10 | ForgotPasswordConfirm: { 11 | screen: ForgotPasswordConfirm, 12 | } 13 | }; 14 | 15 | const navigatorConfig = { 16 | initialRouteName: 'ForgotPassword' 17 | }; 18 | 19 | const forgotPasswordNavigation = createSwitchNavigator(routeConfig, navigatorConfig); 20 | export default forgotPasswordNavigation; -------------------------------------------------------------------------------- /src/graphql/mutations.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // this is an auto generated file. This will be overwritten 3 | 4 | export const createTodo = `mutation CreateTodo($input: CreateTodoInput!) { 5 | createTodo(input: $input) { 6 | id 7 | name 8 | description 9 | time 10 | completed 11 | } 12 | } 13 | `; 14 | export const updateTodo = `mutation UpdateTodo($input: UpdateTodoInput!) { 15 | updateTodo(input: $input) { 16 | id 17 | name 18 | description 19 | time 20 | completed 21 | } 22 | } 23 | `; 24 | export const deleteTodo = `mutation DeleteTodo($input: DeleteTodoInput!) { 25 | deleteTodo(input: $input) { 26 | id 27 | name 28 | description 29 | time 30 | completed 31 | } 32 | } 33 | `; 34 | -------------------------------------------------------------------------------- /src/navigation/authNavigation.js: -------------------------------------------------------------------------------- 1 | import {createStackNavigator} from "react-navigation-stack"; 2 | import SignIn from "../components/signIn/SignIn"; 3 | import SignUp from '../components/signUp/SignUp'; 4 | import ForgotPassword from "../components/forgotPassword/ForgotPassword"; 5 | import ForgotPasswordConfirm from "../components/forgotPassword/ForgotPasswordConfirm"; 6 | 7 | const routeConfigs = { 8 | SignIn: { 9 | screen: SignIn 10 | }, 11 | SignUp: { 12 | screen: SignUp 13 | }, 14 | ForgotPassword: { 15 | screen: ForgotPassword, 16 | }, 17 | ForgotPasswordConfirm: { 18 | screen: ForgotPasswordConfirm, 19 | } 20 | }; 21 | 22 | const stackNavigatorConfig = { 23 | initialRouteName: 'SignIn', 24 | }; 25 | 26 | const authStackNavigator = createStackNavigator(routeConfigs, stackNavigatorConfig); 27 | 28 | export default authStackNavigator; -------------------------------------------------------------------------------- /src/components/Dialog.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import { View, Alert, StyleSheet, Button} from 'react-native'; 3 | import {connect} from "react-redux"; 4 | import {setDialog} from "./actions"; 5 | 6 | const Dialog = ({ title, message, setDialog }) => { 7 | return ( 8 | 9 | {Alert.alert( 10 | title, 11 | message, 12 | [ 13 | { 14 | text: 'Cancel', 15 | onPress: () => {setDialog(false, '', '')}, 16 | style: 'cancel', 17 | }, 18 | { text: 'OK', onPress: () => {setDialog(false, '', '')} }, 19 | ], 20 | { cancelable: false } 21 | )} 22 | 23 | 24 | ); 25 | }; 26 | 27 | const mapStateToProps = state => ({ 28 | title: state.dialog.title, 29 | message: state.dialog.message, 30 | }); 31 | 32 | const mapDispatchToProps = dispatch => { 33 | return { 34 | setDialog: (value, title, message) => dispatch(setDialog(value, title, message)), 35 | } 36 | } 37 | 38 | 39 | export default connect(null, mapDispatchToProps)(Dialog); -------------------------------------------------------------------------------- /src/components/Bottom.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Button, StyleSheet} from 'react-native'; 3 | import {connect} from 'react-redux'; 4 | import {setFilter} from "./actions"; 5 | 6 | const Bottom = ({setFilter}) => { 7 | return ( 8 | 9 | 10 |