App Requirements:
- Using these APIs you have to complete the following tasks in React Native.
- Create a search field, which queries on public repos.
- Fetch the data of the repos and create a card for each.
- Following are the details, the card needs to have:
- Avatar, Repo name, Stars, Description, language
- A Sort field with the following options- Stars, watchers count, score, name,created_at, updated_at.
Solution:
- Single Screen Application with a Search bar and List of Repositories.
- FlatList a better way to render list of data.
- Studied Search - GitHub Docs to learn about querying and OctoKit Client API library.
- Installed OctoKit from @OctoKit/REST - NPM.
- Created a TOKEN for usage of GitHub API.
- Separate buttons to choose "Sort by Parameter" and "Order by" to sort the repositories.
- Finally, cleaned the code with meaningful logs at each step.
Tech Stack:
- React
- React Native
- JavaScript/ES6
- CSS
- OctoKit
DiceRepo.App.webm
Clone down this repository. You will need node
and npm
installed globally on your machine.
-
Installation (In project root folder):
npm install
-
Prerequisites to Run:
-
Connect Physical Android/iOS device in USB debugging mode OR Launch Emulator using AVD Manager [Android Studio].
-
Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the
--reset-cache
flag to the start script:npm start -- --reset-cache # or yarn start -- --reset-cache
-
-
To Start Android Application:
-
For Android users:
npx react-native start
and then press a or i for respective OS -
For iOS users:
npx react-native run-ios
-
-
To Visit App:
App Launched in your Android/iOS Device
Unit tests: npm run mocha
Unit tests with coverage: npm run coverage
Linter: npm run lint