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-cliFor 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.localgit clone https://github.com/alizahid/acorn.git
cd acornbun iYou 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:siminsideapps/mobile - EAS Build will generate a compressed archive. Extract
Acorn.appfrom it - Drag and drop
Acorn.appinto your simulator - Run
bun devat 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:previewinsideapps/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.ipafile - You can now AirDrop the
build.ipato 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