|
| 1 | +# create-react-native-go |
| 2 | + |
| 3 | +Scaffold a React Native + Go mobile app in seconds. Go runs as an embedded HTTP server providing JSON-RPC APIs, while React Native handles the UI with the New Architecture (Fabric + TurboModules). |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```bash |
| 8 | +npx create-react-native-go my-app --bundleId com.mycompany.myapp --goModule mycompany.com/my-app |
| 9 | +cd my-app |
| 10 | +make setup |
| 11 | +make ios # or: make android |
| 12 | +``` |
| 13 | + |
| 14 | +If you omit any flags, the CLI will prompt you interactively. |
| 15 | + |
| 16 | +## What You Get |
| 17 | + |
| 18 | +``` |
| 19 | +my-app/ |
| 20 | +├── Makefile # Root orchestrator |
| 21 | +├── backend/ |
| 22 | +│ ├── Makefile # Go build targets |
| 23 | +│ ├── mobile_api.go # Mobile API for server lifecycle |
| 24 | +│ └── http_server.go # JSON-RPC HTTP server |
| 25 | +└── mobile-app/ |
| 26 | + ├── Makefile # Mobile build targets |
| 27 | + ├── src/ |
| 28 | + │ ├── NativeGoServerBridge.ts # TurboModule spec |
| 29 | + │ ├── GoServerBridgeJSI.ts # JSI wrapper |
| 30 | + │ └── JsonRpcClient.ts # JSON-RPC client |
| 31 | + ├── android/ # Android native code |
| 32 | + └── ios/ # iOS native code |
| 33 | +``` |
| 34 | + |
| 35 | +## Prerequisites |
| 36 | + |
| 37 | +- Node.js 18+ |
| 38 | +- Go 1.25+ |
| 39 | +- iOS: Xcode 15+, CocoaPods |
| 40 | +- Android: Android Studio, JDK 17+ |
| 41 | + |
| 42 | +## Options |
| 43 | + |
| 44 | +| Flag | Description | Example | |
| 45 | +|------|-------------|---------| |
| 46 | +| `--bundleId` | App bundle identifier | `com.mycompany.myapp` | |
| 47 | +| `--goModule` | Go module path | `mycompany.com/my-app` | |
| 48 | + |
| 49 | +The first positional argument is the app name (e.g. `my-app`). |
| 50 | + |
| 51 | +## How It Works |
| 52 | + |
| 53 | +The CLI copies a pre-built template and replaces all identifiers (app name, bundle ID, Go module path, iOS project name, Android package directories) to match your configuration. It then initializes a fresh git repo. |
| 54 | + |
| 55 | +## Links |
| 56 | + |
| 57 | +- [GitHub Repository](https://github.com/siddarthkay/react-native-go) |
| 58 | +- [Issues](https://github.com/siddarthkay/react-native-go/issues) |
| 59 | + |
| 60 | +## License |
| 61 | + |
| 62 | +MIT |
0 commit comments