Add it! is a simple math game where you need to find the set of numbers that sums to the target number displayed at the top of the screen but do it quickly as there is a time limit.
The project is powered by React Native. Currently only tested in Android.
- 3 Pre-set dificulties for a quick game.
- Custom game mode to personalice your own experience and progress at your own rithm.
- Supports English and Spanish.
The game "Add It!" was created as a personal project to familiarize with the React Native framework. Some features were built with the only purpose of learning. If you have any suggestion, feel free to open an issue.
To build for Android you need the following:
- Node 22.15.0 (provided
.nvmrcfile) - Java 21 (open-jdk/oracle-jdk) (
scoop install openjdk21) - Android SDK Platform 36 and Build Tools 36.0.0 (
scoop install android-sdk)- Expo SDK 57 / React Native 0.86 builds with
compileSdk36,targetSdk36 andminSdk24.
- Expo SDK 57 / React Native 0.86 builds with
- Gradle 9.3.1. Gradle does not need to be installed: it is downloaded by the Gradle wrapper (
gradlew) thatnpm run android:preparegenerates. Always use the wrapper, not a globally installedgradle.
- Clone the repository.
git clone https://github.com/DanSM-5/AddIt-
Run
npm cito install the dependencies. -
Create a
.env.localfile in the root of the project:
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=***
MYAPP_UPLOAD_KEY_PASSWORD=***-
Add
<my-upload-key.keystore>to the root of the project. -
Run the command
npm run android:prepareThe command will setup the required files for the android build process.
- Run the command
npm androidExecute the following commands to build
cd android
./gradlew assembleReleaseor in windows
cd android
.\gradlew.bat assembleReleaseGradle keeps its caches and daemons in a home directory (~/.gradle, or GRADLE_USER_HOME if set) that is
shared with every other Gradle project on the machine. If another project used a different Gradle version or
setup, the build can fail with errors that have nothing to do with this project, for example:
node_modules/@react-native/gradle-plugin/settings.gradle.kts: Unresolved reference 'plugins'.
To get a clean build, stop the running daemons, clean the project and build with a Gradle home that is only used by this project:
# bash/zsh
cd android
./gradlew --stop
export GRADLE_USER_HOME="$HOME/.gradle-addit"
./gradlew clean
./gradlew app:bundleRelease # or assembleRelease for an apk# powershell
cd android
.\gradlew.bat --stop
$env:GRADLE_USER_HOME = "$HOME\.gradle-addit"
.\gradlew.bat clean
.\gradlew.bat app:bundleRelease # or assembleRelease for an apkThe first build with a new Gradle home takes longer because it downloads Gradle 9.3.1 and the dependencies again.
Warning
On Windows keep GRADLE_USER_HOME short (such as $HOME\.gradle-addit). The native (CMake/ninja) build uses
paths deep inside the Gradle home and fails with Filename longer than 260 characters if it is too long.
If the build still fails, regenerate the native project from scratch (the android folder is generated and ignored by git):
rm -rf android # powershell: Remove-Item -Recurse -Force android
npm run android:preparenpm run android:aabnpm run android:apkNote
Using expo cli requires to have a real device or emulator connected through adb.
npm test # run unit tests once (Vitest)
npm run test:watch # re-run tests on change
npm run lint:types # type-check with TypeScript 7 (native compiler)
npm run lint # ESLintTests run with Vitest in two projects (Vite is only used by the test runner; the app is still bundled by Metro):
unit—*.test.ts, plain TypeScript logic in Node.native—*.test.tsx, React Native components rendered with React Native Testing Library through vitest-native, on React Native's real JavaScript with native modules mocked. Setup lives intest/setup-native.ts.
Run a single project with npx vitest run --project native.
Important
vitest-native needs Node 22.22.3+ (or 24.12+). Use the version in .nvmrc
(nvm use).
Note
Reanimated's test mock finishes animations immediately, so tests check that
an animation starts (e.g. by spying on withRepeat) rather than its
intermediate frames. Animated colours are reported as rgba(r, g, b, 1).
Note
TypeScript 7 is installed under the typescript-7 alias and used only for
type-checking. typescript stays on 6.x because ESLint (typescript-eslint)
and other tooling still need its JavaScript API.
npm run lint:types:legacy type-checks with TypeScript 6.
You can install the dependencies in windows using scoop package manager.
Set environment variables dependencies as follows:
# bash/zsh
export ANDROID_HOME="$HOME/scoop/apps/android-sdk/current"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME:/platform-tools:$PATH"
export JAVA_HOME="$HOME/scoop/apps/openjdk21/current"# powershell
$env:ANDROID_HOME = "$HOME/scoop/apps/android-sdk/current"
$env:PATH = "$env:ANDROID_HOME/tools:$env:ANDROID_HOME/tools/bin:$env:ANDROID_HOME:/platform-tools:$env:PATH"
$env:JAVA_HOME = "$HOME/scoop/apps/openjdk21/current"You can get the current version of the game from the Play Store