Coder Social home page Coder Social logo

githubrepobrowserrn's Introduction

GithubRepoBrowserRN

sample app to browse a Github repo, in react Native

iOS Android
Browser App on iOS Browser App on Android

Inital steps to build a RN application

Create app

Create app with:

react-native init GithubRepoBrowserRN

Add eslint

You can't really work in Javascript without eslint so...:

yarn add --dev eslint babel-eslint eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-import

add .eslintrc.json with rules suitable for the project.

Add router

yarn add react-router-native

and then define routes is App.js

Main classes / files

  • src/index.js : entry point of the app - shared between iOS and Android as the design is the same. We instantiate App which is in:

  • src/App.js: actual entry point of the app. No visual component there, but the definition of the routes of the application with react-router-native. We have 4 routes (pages) in the app:

Route Path Page Name file quick description
/ Home src/pages/Home/Home.js The list of all the repos associated to a user (property githubRepoUser in app.json)
/repoDetail/:repoId RepoDetail src/pages/RepoDetail/RepoDetail.js Information about a given repository
/issues/:repoName IssuesList src/pages/IssuesList/IssuesList.js List of issues associated to a given repository
/issue/:repoName/:issueId IssueDetail src/pages/IssueDetail/IssueDetail.js Detail information about an issue
  • src/state/index.js: model/state for the app. This module is in charge of doing the Github API calls. In a real RN app, we would use a more sophisticated state management like redux or Mobx.
  • src/components/NavigationBar/NavigationBar.js: the only reusable components for that app: that's the header of the pages to allow the back navigation.

githubrepobrowserrn's People

Contributors

pcarion avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.