Reddit for mobile
Acorn is built using React Native, but it's only designed with iOS in mind. And thus, you'll need a Mac to run Acorn locally.
This guide should cover the basic setup for React Native development, which includes Xcode, Node.js, and Watchman.
Then you need these four dependencies;
You can install EAS CLI using NPM and the rest using Homebrew.
And finally, an Expo account.
Once you download Xcode from App Store, open Terminal and install the rest of the dependencies;
brew install fastlane cocoapods watchman node oven-sh/bun/bun
npm i -g eas-cli
For development / personal builds, you don't need any environment variables. But since the build scripts expect .env
files, you can create them by running these commands in the apps/mobile
directory;
touch .env.local
touch .env.production.local
git clone https://github.com/alizahid/acorn.git
cd acorn
bun i
You can either run bun dev
from the project root, which will spin up both the mobile and web apps.
Or you can navigate to apps/mobile
and run bun dev
there, which will only spin up the mobile app.
It's preferred to run bun dev
from from the project root so we can clear cache before spinning up the apps.
Here's how you can generate a build for simulator while developing;
- Run
bun build:sim
insideapps/mobile
- EAS Build will generate a compressed archive. Extract
Acorn.app
from it - Drag and drop
Acorn.app
into your simulator - Run
bun dev
at the root or insideapps/mobile
- Done
Building for production (for your own device) is pretty much the same as building for development;
- Run
bun build:preview
insideapps/mobile
- EAS CLI will guide you through setting up your Expo project and Apple developer account credentials. Make sure to register your devices with Apple through Expo
- EAS Build will generate a
build.ipa
file - You can now AirDrop the
build.ipa
to your devices, or use Xcode to install them - Done
Acorn uses Biome to lint and format code.
You can run the following command at the root of your repo to make sure things are how they should be;
bun lint; bun lint:types