Components
Components
App
Location: The UI can be found under
src/App.jsWorking: Configures Native base, Fonts, Push Notification, Apollo, Authentication and Navigation.
Result: Everything is configured loads the next view depending on if the user is authenticated or not. If the user is not authenticated will show tutorial screen first else it will show Menu Screen.
Register
Location: The UI can be found under
src/screens/Register/Register.jsIts mutation can be found undersrc/apollo/server.jswith constantcreateUserWorking: Registers User using Google, Facebook or Manual Registration
Result: Registers User if a user registers with Facebook or Google will get their picture too automatically. In any selected option an auth token is generated on backend and sent backend to frontend.
Login
Location: The UI can be found under
src/screens/Login/Login.jsIts mutation can be found undersrc/apollo/server.jswith constantloginWorking: Logins User using Google, Facebook or Manual Registration. A separate component for ForgotPassword is also present its component can be found
src/components/ForgotPasswordIts mutation can be found undersrc/apollo/server.jswith constantforgotPasswordResult: Logins User with validation. If a user uses forgotPassword an email will be sent to him with reset link for changing his/her password.
Menu
Location: The UI can be found under
src/screens/Menu/Menu.jsIts query can be found undersrc/apollo/server.jswith constantcategoriesResult: Fetches categories of the items
MenuItems
Location: The UI can be found under
src/screens/MenuItems/MenuItems.jsIts mutations and queries can be found undersrc/apollo/server.jswith constantfoodsandsrc/apollo/client.jswith constantsfoodItemandgetCartItemsWorking:
apollois divided into two main filesserver.jsandclient.jsThe first file is used to interact with the api server while the second is used for internal application level state management. ConstantsfoodsandgetCartItemsis a query whilefoodItemis a fragment.Result:
foodsis queried with the selected category in the previous screen. If a user clicks add button inside the MenuItems screenfoodItemfragment is executed which also updated querygetCartItemswhich updated the quantity inside cart item as well as the adds the food item if it exists previously will only update its quantity.
ItemDetail
Location: The UI can be found under
src/screens/ItemDetail/ItemDetail.jsIts mutations and queries can be found undersrc/apollo/server.jswith constantlikeandsrc/apollo/server.jswith constantfoodItemsandgetCartItemsWorking: Constants
foodItemsandgetCartItemshave been described abovelikeis a mutation which adds it to like food with parameter food id.
Cart
Location: The UI can be found under
src/screens/Cart/Cart.jsIt has Apollo constants ofgetCartItemsandgetProfile.getProfileis located atsrc/apollo/client.jsWorking: Constant
getProfileis a type of query that gets user details name, email, phone, location and picture.Result: The
getProfileis used to get the user delivery location.
Payment
Location: The UI can be found under
src/screens/Payment/Payment.jsIt has Apollo constantsplaceOrderandgetCartItems.placeOrderis located atsrc/apollo/server.jsIts a mutation.Working: Constant
placeOrdersend the details to the server with item delivery address payment status and user profile.Result: User payment is made by selecting either Paypal or Stripe. If the selected option is Cash on delivery payment is not made and the status of the payment is still pending. Its status is changed from the admin panel. An email is also sent to the user with the order detail information.
MyOrders
Location: The UI can be found under
src/screens/MyOrders/MyOrders.jsIt has Apollo constant ofmyOrderslocated atsrc/apollo/server.jsits of type queryResult: All the users orders are queried with an option to reorder it for the user.
RateAndReview
Location: The UI can be found under
src/screens/RateAndReview/RateAndReview.jsIt has Apollo constant ofreviewOrderits of type mutationResult: The user can give ratings with stars for his order made.
Profile
Location: The UI can be found under
src/screens/Settings/Settings.jsIt has Apollo constants ofupdateUser,profileandgetProfile. ConstantsupdateUserandprofileare located insrc/apollo/server.jswhile constantgetProfileis located atsrc/apollo/client.jsWorking:
updateUseris of type mutation where the user information is updated.profileis of type query where the user profile is queried.Result: User profile is updated. All the fields in settings are required to place order.
Addresses
Location: The UI can be found under
src/screens/Addresses/Addresses.jsIt has Apollo constants ofprofileits of type query located insrc/apollo/client.jsResults:
profile.addressesgets all the address that the user added in addresses list.
OrderDetail
Location: The UI can be found under
src/screens/PastOrderDetail/PastOrderDetail.jsIt has Apollo constants oforderItemits of type fragment located insrc/apollo/client.jsWorking:
orderItemhas all the details for item as well as the status of the order based on the status the timeline is rendered dynamically
Last updated
Was this helpful?