create-mobile-foundation
v0.0.6
Published
CLI to scaffold a modern bare React Native + Expo modules project with Firebase, Analytics, and more.
Maintainers
Readme
create-mobile-foundation
A CLI tool to scaffold a modern, bare React Native + Expo modules project with optional Firebase, Analytics, Crashlytics, Calendar, Expo Updates, and more.
Repository Layout
packages/cliis the npm package that should be packed and published- the repo root stays available for local app development and generator testing
Publishing
npm run cli:pack:dry-run
npm run cli:publishFeatures
- Bare React Native + Expo modules
- TypeScript or JavaScript
- Firebase, Analytics, Crashlytics (optional)
- Expo Calendar, Updates, NetInfo, Drawer, Material Top Tabs (optional)
- Google Fonts integration
- Responsive theme utilities
- Customizable splash, theme, and context providers
Usage
npx create-mobile-foundation init <app-name> [options]
# or
npx create-mobile-foundation <app-name> [options]Options
--jsConvert the generated project to JavaScript--tsKeep the generated project in TypeScript--firebaseInclude Firebase packages and native setup--no-firebaseSkip Firebase packages and native setup--analyticsInclude Analytics packages and native setup--no-analyticsSkip Analytics packages and native setup--crashlyticsInclude Crashlytics packages and native setup--no-crashlyticsSkip Crashlytics packages and native setup--calendarInclude Expo Calendar package and iOS usage descriptions--no-calendarSkip Expo Calendar package and iOS usage descriptions--expo-updatesInclude expo-updates package and update prompt UI--no-expo-updatesSkip expo-updates package and update prompt UI--netinfoInclude offline detector with network connectivity monitoring--no-netinfoSkip offline detector (connectivity monitoring)--drawerInclude @react-navigation/drawer--no-drawerSkip @react-navigation/drawer--material-top-tabsInclude @react-navigation/material-top-tabs with peers--no-material-top-tabsSkip @react-navigation/material-top-tabs with peers--expo-version <version>Expo version to target (default: latest)--design-width <number>Design width for responsive utilities (default: 393)--design-height <number>Design height for responsive utilities (default: 852)--google-font-family <name>Google font family to download (default: "Open Sans")--italic-fontsInclude italic variants for all selected font weights--no-italic-fontsSkip italic variants--dark-modeInclude dark mode support with distinct palettes--no-dark-modeKeep light and dark palettes identical--dry-runPrint commands without running them--helpShow help
Examples
npx create-mobile-foundation init MyApp --ts --firebase --calendar --expo-updates --drawer --material-top-tabs --google-font-family "Open Sans" --dark-mode
npx create-mobile-foundation MyApp --js --no-firebase --no-calendar --no-expo-updates --no-netinfo --no-drawer --no-material-top-tabs --no-dark-modeLicense
MIT
Thanks
This project is made possible by the awesome work of the open source community. Special thanks to:
- React Native
- Expo
- @react-native-community/cli
- @react-navigation
- @react-native-firebase
- Luxon
- Lodash
- Axios
- nanoid
- patch-package
- And many more contributors and library authors!
Getting Started
Note: Make sure you have completed the Set Up Your Environment guide before proceeding.
Step 1: Start Metro
First, you will need to run Metro, the JavaScript build tool for React Native.
To start the Metro dev server, run the following command from the root of your React Native project:
# Using npm
npm start
# OR using Yarn
yarn startStep 2: Build and run your app
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
Android
# Using npm
npm run android
# OR using Yarn
yarn androidiOS
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
bundle installThen, and every time you update your native dependencies, run:
bundle exec pod installFor more information, please visit CocoaPods Getting Started guide.
# Using npm
npm run ios
# OR using Yarn
yarn iosIf everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
Step 3: Modify your app
Now that you have successfully run the app, let's make changes!
Open App.tsx in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by Fast Refresh.
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
- Android: Press the R key twice or select "Reload" from the Dev Menu, accessed via Ctrl + M (Windows/Linux) or Cmd ⌘ + M (macOS).
- iOS: Press R in iOS Simulator.
Congratulations! :tada:
You've successfully run and modified your React Native App. :partying_face:
Now what?
- If you want to add this new React Native code to an existing application, check out the Integration guide.
- If you're curious to learn more about React Native, check out the docs.
Troubleshooting
If you're having issues getting the above steps to work, see the Troubleshooting page.
Learn More
To learn more about React Native, take a look at the following resources:
- React Native Website - learn more about React Native.
- Getting Started - an overview of React Native and how setup your environment.
- Learn the Basics - a guided tour of the React Native basics.
- Blog - read the latest official React Native Blog posts.
@facebook/react-native- the Open Source; GitHub repository for React Native.
