/react-goku

Sudoku Solver App built using React Native and Golang

Primary LanguageJavaScriptMIT LicenseMIT

Go-ku: Mobile App built using React Native and Golang

Go-ku Banner

link to Google Play Store

Reason

Curious about an Architecture to rule all mobile platforms! using React Native and Golang!

Architecture

Screenshots

Logic: Using Golang to solve Sudoku Board

Go-ku Insert Go-ku Solved

Persistence: Using Realm DB to save boards to a ListView

Go-ku SavedOne Go-ku SavedTwo

Can go back to a previously saved board

Go-ku Selected Go-ku Loaded

Development Tips:

As of now only works for Android, have not tested on iOS

  • any one happy to contribute and build for iOS, I'm happy to receive Pull Request! :)

Run from source:

Dependencies: react-native for android

  1. clone this repo
  2. $ cd react-goku
  3. $ npm install
  4. $ react-native run-android

Using/Updating Golang:

Dependencies: gomobile

  1. clone goku package
  2. $ cd goku
  3. $ gomobile bind -target android -o bridge.aar -v ./bridge
  4. Import .aar file using Android Studio:
  5. Notice bridge.go, that's the proxy function used in order to communicate between Java and Go in Android.
    • Limited types are supported using gomobile

Into React Native World:

Using Go package:

  1. Create a class that extends ReactContextBaseJavaModule, and create a method using the ReactMethod annotation, you can use Bridge.java to call the Go proxy function check this
  2. Create a class that extends ReactPackage, check this
  3. Pass the class in the getPackage function inside your MainActivity class
  4. This allows you to expose that class using NativeModules
  5. Profit! use that function wherever you want!

TODO:

  • input from buttons, not OS keyboard
  • deleting sudoku boards
  • updating sudoku boards, need to introduce primaryKey
  • refactor to idiomatic react code : sorry came from Java and Go
  • Realm Results should "auto-update" the list? or is it only "auto-updated" if it is already in the list? so adding new models I have to manually update the list again?
  • Learn some integration testing for React Native
  • (∩`-´)⊃━☆゚.*・。゚ Animations! oooooooh!!!!