{"id":16213835,"url":"https://github.com/solygambas/react-native-shopping-app","last_synced_at":"2025-03-16T11:30:56.365Z","repository":{"id":36659039,"uuid":"211817268","full_name":"solygambas/react-native-shopping-app","owner":"solygambas","description":"A shopping app using React Navigation, Redux, Redux-Thunk and Firebase.","archived":false,"fork":false,"pushed_at":"2023-02-16T18:31:22.000Z","size":2404,"stargazers_count":108,"open_issues_count":49,"forks_count":25,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-27T08:19:46.630Z","etag":null,"topics":["expo","firebase","javascript","react","react-native","react-navigation","react-redux","reactjs","redux","redux-thunk"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solygambas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-30T08:52:31.000Z","updated_at":"2025-02-24T16:51:54.000Z","dependencies_parsed_at":"2023-01-17T04:00:43.390Z","dependency_job_id":null,"html_url":"https://github.com/solygambas/react-native-shopping-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solygambas%2Freact-native-shopping-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solygambas%2Freact-native-shopping-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solygambas%2Freact-native-shopping-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solygambas%2Freact-native-shopping-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solygambas","download_url":"https://codeload.github.com/solygambas/react-native-shopping-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814864,"owners_count":20352037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expo","firebase","javascript","react","react-native","react-navigation","react-redux","reactjs","redux","redux-thunk"],"created_at":"2024-10-10T11:08:44.592Z","updated_at":"2025-03-16T11:30:55.481Z","avatar_url":"https://github.com/solygambas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shopping App\nA shopping app using React Navigation, Redux, Redux-Thunk and Firebase.\n\n## Features\n- authentication screen to log in or sign up.\n- shop to see all products and product details.\n- cart to add/remove products and order them.\n- orders screen to retrieve orders.\n- user admin to create, update and delete products.\n\n## React Navigation\n- handling stack of screens for products, orders and user admin with createStackNavigator and createAppContainer.\n- using props.navigation to navigate between screens.\n- handling data from component to header with setParams and getParam.\n- custom header title with navigationOptions.\n- custom cart button in the header with react-navigation-header-buttons.\n- custom SideDrawer with react-navigation-drawer.\n- adding listener with props.navigation.addListener to reload data from server.\n- handling manual logout with SafeAreaView and DrawerNavigatorItems.\n- handling autologout and forced reload with a custom wrapper for the navigator thanks to useRef and NavigationActions.\n\n## Redux and React-Redux\n- using actions and reducers to authenticate and to store data (token and user ID, products, cart, orders).\n- using useSelector hook to get the state.\n- using props.navigation to pass data to the header without re-render.\n- using useDispatch hook to dispatch actions. \n- passing useDispatch to the header with useEffect and useCallback to limit re-render cycles.\n- handling logic for the cart (quantity, removing a product and clearing the cart).\n- debugging with redux-devtools-extension and React Native debugger.\n\n## React Native\n- using FlatList, ScrollView, TouchableOpacity, KeyboardAvoidingView, ActivityIndicator, Alert, AsyncStorage and SafeAreaView.\n- custom reusable components (Card, HeaderButton, Input).\n- custom fonts, color and environment constants.\n- using React hooks (useState, useEffect, useCallback, useReducer, useRef).\n- handling input validation with useReducer and custom TextInput component.\n- handling dates with Moment.js.\n- handling sessions with AsyncStorage, setItem and getItem.\n\n## Redux-Thunk and Firebase\n- using Redux-thunk as a middleware to add async code.\n- using Firebase as a database for products and orders with fetch (POST, PATCH, DELETE).\n- handling authentication with Firebase (email and password).\n- showing a loading spinner with ActivityIndicator and useState while fetching data/trying to authenticate.\n- handling errors with try/catch blocks and throwing Alerts. \n- using getState from Redux-thunk to send http requests with a token.\n\n## Usage\n\nAdd your Firebase url and key in [constants/Environment.js](constants/Environment.js).\n\nBased on [React Native - The Practical Guide](https://www.udemy.com/react-native-the-practical-guide/) by Maximilian Schwarzmüller.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolygambas%2Freact-native-shopping-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolygambas%2Freact-native-shopping-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolygambas%2Freact-native-shopping-app/lists"}