OmarBasem/Clothly

eCommerce React Native App

★ 0Forks 0TypeScriptGitHub ↗Compare

README

Clothly React Native App

Build Status

This is a demo eCommerce mobile app that I have built in 3 days.

Technologies Used

  • Framework: React Native
  • Programming Language: TypeScript
  • React Style: Functional Components + Hooks
  • State Management: RTK (Redux Toolkit) + Redux-Saga
  • Unit & Integration Testing: Jest
  • End-to-End Testing: Detox
  • CI/CD: Bitrise

The following steps show the build process of the app.

STEP 1

  • Created multiple tabs, screens and components for the app to be functional.
  • Created the ProductScreen as the UI in ./ProductScreen.png.
  • The needed data is stored in a variable in /app/data.json without the use of redux or API request as required for step 1.
  • Also created a HomeScreen to display the list of product items.

STEP 2

  • The app now has a state management library (redux) and is reading the data from the redux store instead of the local JSON file.

STEP 3

  • The data now comes from a JSON file stored in AWS S3.
  • As soon as the app starts it makes an API request to download the JSON file, and then dispatch the data in the redux store.
  • An ActivityIndicator is displayed while the data is downloading.

STEP 4

  • Created profile screen
  • User data is fetched from the Rick and Morty API, and is persisted in the redux store
  • Now all elements of the layout in ./ProductScreen.png are functional
  • The user can change the category (MEN, WOMEN)
  • As the process of creating JSON files is repetitive, for the other categories a message will be displayed to the user saying "We ran out of {category} products"
  • Added functionality to filter items on the HomeScreen by typing into the search bar
  • The product image can be viewed in full screen
  • The user can change the selected size and color

STEP 5

  • Carried out unit testing using Jest for the different components, screens, actions and reducers. Jest tests can be found under the '__ tests __' directory.
  • Carried out end-to-end testing using Detox for all the implemented functionalities in the app. Detox tests can be found under the 'e2e' directory.

STEP 6

STEP 7

  • Rewrote the app from JavaScript to TypeScript
  • Migrated from Redux to the new Redux Toolkit
  • Migrated from Redux-Thunk to Redux-Saga
  • Added integration tests of Sagas and Reducers

INSTALLATION

  • run git clone https://github.com/OmarBasem/Clothly.git
  • run cd Clothly && npm install

iOS

  • run cd ios && pod install && cd ..
  • run react-native run-ios

Android

  • Open Android studio and make sure JDK 11 or higher is set for the project
  • Start an emulator
  • run react-native run-android

Running tests

Jest tests: run npm test

Detox tests:

  • Make sure Detox is set up on your machine

---> iOS

  • Start a simulator (iPhone 13 Pro) and run the app on it
  • Build iOS detox tests: detox build --configuration ios.sim.debug
  • Run iOS detox tests: detox test --configuration ios.sim.debug

---> Android

  • Start an emulator (Pixel 4 API 30) and run the app on it
  • Build Android detox tests: detox build --configuration android.emu.debug
  • Run Android detox tests: detox test --configuration android.emu.debug

Contributors

OmarBasem

Issues