index.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title> Home</title>
  7. <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
  8. <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
  9. <script src="./build/entry.js"></script>
  10. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  11. <!--[if lt IE 9]>
  12. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  13. <![endif]-->
  14. <link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
  15. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
  16. <link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
  17. <link type="text/css" rel="stylesheet" href="styles/app.min.css">
  18. <link type="text/css" rel="stylesheet" href="styles/iframe.css">
  19. <link type="text/css" rel="stylesheet" href="">
  20. <script async defer src="https://buttons.github.io/buttons.js"></script>
  21. </head>
  22. <body class="layout small-header">
  23. <div id="stickyNavbarOverlay"></div>
  24. <div class="top-nav">
  25. <div class="inner">
  26. <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
  27. <span aria-hidden="true"></span>
  28. <span aria-hidden="true"></span>
  29. <span aria-hidden="true"></span>
  30. </a>
  31. <div class="logo">
  32. </div>
  33. <div class="menu">
  34. <div class="navigation">
  35. <a
  36. href="index.html"
  37. class="link"
  38. >
  39. API Documentation
  40. </a>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div id="main">
  46. <div
  47. class="sidebar "
  48. id="sidebarNav"
  49. >
  50. <nav>
  51. <h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Interfaces</h3><ul><li><a href="AddLandmarkProps.html">AddLandmarkProps</a></li><li><a href="CommentProps.html">CommentProps</a></li><li><a href="IdToken.html">IdToken</a></li><li><a href="IntroProps.html">IntroProps</a></li><li><a href="Landmark.html">Landmark</a></li><li><a href="LandmarkDetailsProps.html">LandmarkDetailsProps</a></li><li><a href="LandmarkPinProps.html">LandmarkPinProps</a></li><li><a href="LMComment.html">LMComment</a></li><li><a href="ProfileProps.html">ProfileProps</a></li><li><a href="RegisterProps.html">RegisterProps</a></li><li><a href="UserProfile.html">UserProfile</a></li></ul><h3>Components</h3><ul><li><a href="App.html">App</a></li><li><a href="Atlas.html">Atlas</a></li><li><a href="Comment.html">Comment</a></li><li><a href="PrimaryButton.html">PrimaryButton</a></li><li><a href="Profile.html">Profile</a></li><li><a href="SecondaryButton.html">SecondaryButton</a></li></ul><h3>Global</h3><ul><li><a href="global.html#IconStrings">IconStrings</a></li></ul></div><div class="category"><h2>Hooks</h2><h3>Namespaces</h3><ul><li><a href="useAuth.html">useAuth</a></li><li><a href="useLandmarks.html">useLandmarks</a></li><li><a href="useProfile.html">useProfile</a></li></ul></div><div class="category"><h2>Map</h2><h3>Interfaces</h3><ul><li><a href="UserLocation.html">UserLocation</a></li></ul><h3>Components</h3><ul><li><a href="AddLandmark.html">AddLandmark</a></li><li><a href="LandmarkDetails.html">LandmarkDetails</a></li><li><a href="LandmarkPin.html">LandmarkPin</a></li><li><a href="Map.html">Map</a></li></ul></div><div class="category"><h2>Navigation</h2><h3>Components</h3><ul><li><a href="AuthorizedNavigator.html">AuthorizedNavigator</a></li><li><a href="UnauthorizedNavigator.html">UnauthorizedNavigator</a></li></ul><h3><a href="global.html">Global</a></h3></div><div class="category"><h2>Stores</h2><h3>Classes</h3><ul><li><a href="AuthStore.html">AuthStore</a></li></ul></div><div class="category"><h2>Unauthorized</h2><h3>Components</h3><ul><li><a href="Intro.html">Intro</a></li><li><a href="UnauthorizedLayout.html">UnauthorizedLayout</a></li></ul><h3>Components / Registration</h3><ul><li><a href="RegisterMain.html">RegisterMain</a></li></ul></div>
  52. </nav>
  53. </div>
  54. <div class="core" id="main-content-wrapper">
  55. <div class="content">
  56. <header class="page-title">
  57. <p></p>
  58. <h1>Home</h1>
  59. </header>
  60. <h3> </h3>
  61. <section>
  62. <article><h2>Click &amp; Push Mobile</h2>
  63. <p>This the new repository for Click&amp;Push's mobile app, built in React Native. It has been remade and rewritten in Typescript and expo to allow for better debugging and more maintainable code.</p>
  64. <h3>Running the app</h3>
  65. <p>Reading the Expo CLI Quickstart guide on the official docs is highly recommended, however the process is very straight forward. https://reactnative.dev/docs/environment-setup</p>
  66. <ol>
  67. <li>Clone the repository</li>
  68. <li>Run <code>npm install -g expo-cli</code></li>
  69. <li>Install Expo Go on the mobile device you wish to run the app on (it must be on the same wifi network as the host machine)</li>
  70. <li>Run ```expo start`` in the app root folder</li>
  71. <li>Using the Expo Go QR scanner on an android device, or Camera app on an iOS device, scan the QR code produced on the terminal or inside the browser window opened by the expo start command.</li>
  72. <li>Expo Go will build and run the app on your phone!</li>
  73. </ol>
  74. <p>The app needs to connect to the server in order to login and access data. You must edit the <code>API_URL</code> value in the <code>globals.ts</code> file to be your private ip address. Ensure that the server repo is cloned and running on your machine before attempting to login. See the repo for instructions on how to do that. https://git.clicknpush.ca/apps/webapp/src/integrating-mobile-app/README.md</p>
  75. <h3>Technical details</h3>
  76. <p>The core libraries that this app are built with are:</p>
  77. <ul>
  78. <li><a href="https://github.com/react-native-maps/react-native-maps">react-native-maps</a> for Mapping</li>
  79. <li><a href="https://reactnavigation.org/">react navigation</a> for navigation</li>
  80. <li><a href="https://react-query.tanstack.com/">react-query</a> for managing state of remote data</li>
  81. <li><a href="https://mobx.js.org/README.html">mobx-react</a> for managing all other shared state</li>
  82. </ul>
  83. <h4>Overall project structure</h4>
  84. <h5>Folders</h5>
  85. <ul>
  86. <li>components -&gt; contains visual react components, including &quot;screen&quot; components</li>
  87. <li>navigation -&gt; contains components that act as react navigation navigator roots (e.g. call the create<navigator type>Navigator() function)</li>
  88. <li>hooks -&gt; contains custom hooks</li>
  89. <li>stores -&gt; contains mobx stores</li>
  90. </ul>
  91. <h5>Other</h5>
  92. <ul>
  93. <li>globals.ts -&gt; contains global constants, misc types, and helper functions</li>
  94. </ul>
  95. <h4>Visual components</h4>
  96. <p>The app component tree follows the following form:</p>
  97. <ul>
  98. <li>App.tsx -&gt; app root
  99. <ul>
  100. <li>Atlas.tsx -&gt; checks authentication state, directs user to appropriate screen
  101. <ul>
  102. <li>Auth -&gt; StackNavigator containing login and register functionality
  103. <ul>
  104. <li>Intro -&gt; Screen containing login and register buttons. Login will initiate a browser session through which the user will authenticate via oauth2-auth code flow. Register will initate the registration flow.</li>
  105. <li>RegisterMain -&gt; Container for registration flow components listed in order below
  106. <ul>
  107. <li>RegisterCredentials -&gt; Username and email</li>
  108. <li>RegisterPassword -&gt; Password</li>
  109. <li>RegisterMeasurements -&gt; Whether or not the user intends to use a sagitta right away, if yes then will ask user for height and weight</li>
  110. <li>RegisterImage -&gt; Profile pic upload and final submission</li>
  111. <li>RegistrationResult -&gt; Reports registration result</li>
  112. </ul>
  113. </li>
  114. </ul>
  115. </li>
  116. <li>Main -&gt; TabsNavigator containing screens that can be accessed by authenticated users
  117. <ul>
  118. <li>Map -&gt; Main map screen that allows users to interact with core mapping features (landmarks, places, routing)
  119. <ul>
  120. <li>AddLandmark -&gt; Component through which a user can add a landmark</li>
  121. <li>LandmarkDetails -&gt; Component through which a user can update and delete landmarks</li>
  122. </ul>
  123. </li>
  124. <li>Profile -&gt; Screen through which the user can manage their account information</li>
  125. </ul>
  126. </li>
  127. </ul>
  128. </li>
  129. </ul>
  130. </li>
  131. </ul>
  132. <p>Here is a flow diagram describing how the components interact with eachother:
  133. <img src="https://git.clicknpush.ca/apps/atlas-mobile-ts/raw/dev/design/UXFlow.png" alt="Flow diagram"></p>
  134. <h4>Hooks</h4>
  135. <p>This app almost exclusively uses functional components, therefore it makes use of hooks. Most of the hooks are bundles of react-query logic for an associated data model:</p>
  136. <ul>
  137. <li>useLandmarks -&gt; Contains queries and mutations for interacting with landmarks</li>
  138. <li>useProfile -&gt; * * * * * * * base user data</li>
  139. <li>useComments -&gt; * * * * * * * comments</li>
  140. <li>useComments -&gt; * * * * * * * places</li>
  141. </ul></article>
  142. </section>
  143. </div>
  144. <footer class="footer">
  145. <div class="content has-text-centered">
  146. <p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a></p>
  147. <p class="sidebar-created-by">
  148. <a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
  149. <a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
  150. </p>
  151. </div>
  152. </footer>
  153. </div>
  154. <div id="side-nav" class="side-nav">
  155. </div>
  156. </div>
  157. <script src="scripts/app.min.js"></script>
  158. <script>PR.prettyPrint();</script>
  159. <script src="scripts/linenumber.js"> </script>
  160. </body>
  161. </html>