Skip to content

OttoDIY/OttoDIYApp

Repository files navigation

Otto DIY

js-standard-style

Open Source

The Otto DIY App is completly FREE under the MIT license. You can even use it commercially and we welcome all contributions, see our contributing guide to get started.

🚀 How to setup and run the app

If you're new to mobile app development with React Native then here are some crash courses to bring you up to speed:

Step 1: Install and setup React Native

Step 2: git clone this repo

  • Mac or Linux
    • cd ~
    • git clone https://github.com/OttoDIY/OttoDIYApp.git
  • Windows
    • cd C:\Users\%username%
    • git clone https://github.com/OttoDIY/OttoDIYApp.git

Step 3: cd to the cloned repo

  • cd OttoDIYApp

Step 4: Install the Application with Yarn

  • yarn install --ignore-engines

Step 5: Copy .env.example to .env

  • Mac or Linux
    • cp .env.example .env
  • Windows
    • copy .env.example .env

Step 6: Update App Properties in .env if necessary

Step 7: Install and run the app

Troubleshooting

Activity class {com.ottodiy/com.ottodiy.MainActivity} does not exist

If you see the error "Activity class {com.ottodiy/com.ottodiy.MainActivity} does not exist" then all is OK but you have to find and launch the Code & Robots app manually from your device. This error occurs because react-native CLI doesn't work well yet with Android variants.

Device is UNAUTHORIZED

If you see the error "Device is UNAUTHORIZED", make sure to click OK when the popup "Allow USB debugging" shows on your device.

To check to see if your device is connected and authorized:

  • adb devices

Failed to create directory

If you see the error "Failed to create directory" then keep running react-native run-android --variant=devDebug until they stop happening, sometimes as much as 3 or 4 times 😖

Operation not permitted, lstat

If you see the error "Operation not permitted, lstat" then try the following:

  1. Start the React Native bundler inside a NEW terminal or command prompt
  • cd OttoDIYApp
  • npm cache clean
  • npm start -- --reset-cache
  1. Run the app in a different terminal or command prompt, see Step 7 above

Could not dispatch a message to the daemon

If you see the error "Could not dispatch a message to the daemon" then run adb devices and make sure that the daemon is running or starts successfully and also that your attached device is listed.

App Properties

When running the app locally, it will rely on the properties defined in your local .env file.

Have a look at .env.example for more information about app properties.

Running on a real device

Have a look at https://facebook.github.io/react-native/docs/running-on-device to get your device setup.

🚫 Standard Compliant

This project adheres to Standard.

Lint on Commit

This is implemented using husky. There is no additional setup needed.

Bypass Lint

If you have to bypass lint for a special commit that you will come back and clean (pushing something to a branch etc.) then you can bypass git hooks with adding --no-verify to your commit command.

Understanding Linting Errors

The linting rules are from JS Standard and React-Standard. Regular JS errors can be found with descriptions here, while React errors and descriptions can be found here.

Testing

Before running tests you will need to install Jest.

Unit and integration tests automatically run on every git commit and git push.

Unit and integration tests:

yarn test

View app stories in Storybook mode

  1. In a new terminal, run storybook yarn storybook
  2. In a new terminal, run the app react-native run-ios or react-native run-android --variant=devDebug
  3. Choose app stories from the Storybook navigator within the app or in the browser

About

Otto Mobile App built in React Native, to download and use just get it here:

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •