overview
Github: https://github.com/skyhitz/skyhitz-expo-next
This repository contains frontend code of the Skyhitz app. It's a monorepo that uses Solito to reuse code between Web and Mobile.
Project structure
- appsentry points for each app- expohere you can import all expo specific packages, or configure expo app (- app.jsonor- eas.json)
- nexthere you can import all next expecific packages and configure next app- pagesunder this directory you have to maintain navigation hierarchy according to next guidelines
- publichere you can put files that should be static served
 
 
- packagesshared packages across apps- appyou'll be importing most files from- app/- apidirectory for all graphql related code. Here you will add new queries or mutations (see more)
- assetsdirectory for assets like fonts or images
- configdirectory where we keep config depending on the current environment
- constantsdirectory for constants
- design-systemdirectory for all things related to design-system. it should be merged in the future with- uidirectory
- featurescomponents organized by feature
- hooksdirectory where we keep all our custom hooks
- navigation- mobileNext.js has a- pages/folder. React Native doesn't. This folder contains navigation-related code for RN. You may use it for any navigation code, such as custom links.
- webWe use it as a wrapper to for the dashboard navbar
 
- provider(all the providers that wrap the app, and some no-ops for Web.)
- stateall recoil related code
- stellarstellar related code (i.ex. creating transactions). Could be moved to utils
- typesdirectory where we keep global types (i.ex. user)
- uidirectory where we keep components that are reused by many features i.ex. buttons, inputs
- utilsself-explanatory
- validationcode for form validation. Could be moved to utils
 
 
🏁 Start the app
- Install dependencies: - yarn
- Next.js local dev: - yarn web- Runs yarn next
 
- Runs 
- Expo local dev: - yarn native- Runs expo start
 
- Runs 
🆕 Add new dependencies
Pure JS dependencies
If you're installing a JavaScript-only dependency that will be used across platforms, install it in packages/app:
cd packages/app
yarn add date-fns
cd ../..
yarn
Native dependencies
If you're installing a library with any native code, you must install it in apps/expo:
cd apps/expo
yarn add react-native-reanimated
cd ../..
yarn
You can also install the native library inside of packages/app if you want to get autoimport for that package inside of the app folder. However, you need to be careful and install the exact same version in both packages. If the versions mismatch at all, you'll potentially get terrible bugs. This is a classic monorepo issue. I use lerna-update-wizard to help with this (you don't need to use Lerna to use that lib).