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.
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
- Mac or Linux
- Windows
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
- iOS
- Make sure XCode is installed
- run
react-native run-ios
- Android
- Use your Android device or run on an Android Emulator or run on Genymotion
- run
react-native run-android --variant=devDebug
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.
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
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 😖
If you see the error "Operation not permitted, lstat" then try the following:
- Start the React Native bundler inside a NEW terminal or command prompt
cd OttoDIYApp
npm cache clean
npm start -- --reset-cache
- Run the app in a different terminal or command prompt, see Step 7 above
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.
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.
Have a look at https://facebook.github.io/react-native/docs/running-on-device to get your device setup.
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.
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
- In a new terminal, run storybook
yarn storybook
- In a new terminal, run the app
react-native run-ios
orreact-native run-android --variant=devDebug
- Choose app stories from the Storybook navigator within the app or in the browser