/optic-expo

Secure 2FA OTP via Mobile Push Notifications

Primary LanguageTypeScript

Optic Expo

ci cd

Optic is an app that helps you securely generate OTP tokens for 2FA protected npm accounts. It allows auto-publish npm packages using CI.

Get it on Google Play Download on the App Store

Documentation

The Optic documentation is available on the website

To get started, visit the Getting Started page for a brief overview.

Requirements

  • Node LTS
  • yarn
  • expo go app (on your ios/android phone or you can use the ios simulator)

Setup

  1. yarn
  2. yarn start

Development

In order to successfully run the Optic-expo app locally you will need the following:

  1. Expo user account. You can sign up here.
  2. Once you have an Expo account, your account needs to be added to the NearForm organization (ask @simoneb to do that for you).
  3. Scan the QR code on your terminal or go to exp://172.22.22.56:19000
  4. Once the app loads, if you get the signin screen, in your terminal run expo login -u <username> -p <password> and reload the app

Running on a iOS device

  1. Create an issue in this repo asking for apple connect developer access for the app (see section: Providing Apple Developer Access)
  2. Install expo-cli globally: npm i -g expo-cli
  3. Run in the simulator first: npm run ios
  4. Install expo go on your device
  5. Connect the ios device to your mac and select trust computer when prompted.
  6. Confirm your device is in developer mode
  7. Setup code signing certificates in xcode for developement
  8. In Xcode select your device as deployment target and select the development certificate (you may need to connect the device to your account if it was not done before) select device
  9. Run: expo run:ios --device
  10. Select your device from the list

Setup Android Studio (MacOS)

  1. Running yarn android will help you throughout the process.
  2. Follow the expo tutorial.
  3. Java Runtime will be necessary. OpenJDK version 11 worked. Homebrew
  4. Read the output of the installation and execute the suggested commands related to symlink and including in the PATH variable.

Setup Xcode/Simulator (MacOS)

  1. Running yarn ios will help you throughout the following steps;
  2. Create an Apple ID if you don't have one. If applicable, use your NearForm email.
  3. Download Xcode from the App Store.
  4. Open Xcode, navigate to "Preferences / Locations" and select the appropriate version in Command Line Tools.

Providing Apple Developer Access

  1. Login to Apple Developer using an account with "App Manager" role
  2. You might need to use the nearform root account to provide permission above 'developer'
  3. 'App Manager' role is needed if you want to give access to create new releases in play store
  4. Navigate to https://appstoreconnect.apple.com/access/users
  5. Click on the "+" button on the top left corner and add the user info (most of the time will be developer or app manager) and choose what apps they have access to

Notes

  • The app doesn't run on the web
  • yarn start:native is different from yarn start having the flag --dev-client you need to build a native version of the app as it generates a url like this: com.nearform.optic://expo-development-client/?url=http%3A%2F%2F192.168.5.92%3A8081 so you have to run expo run:android first. exp://192.168.5.92:19000

    As most things, it's a trade-off.Pp Without --dev-client it's faster to start working as you don't have to install native tools but it hides some problems that only occur in the native versions like the google login problem and the qr code scan.

Figma Design

The figma designs can be found here

Sequence diagram

Store release Guide

The Android app is published to the Play Store once the release workflow is run.

For the iOS version, please follow this guide