# Use and adapt 3nan

Use the documented interfaces and source layout for **3nan**. The sections below retain the README’s examples and configuration details.

## 🚀 Setup

- **Runtime:** Node 18+
- **Package manager:** [Bun](https://bun.sh)

```bash
bun install
bun run start
```

## 📜 Scripts

| Command        | Description              |
|----------------|--------------------------|
| `bun run start` | Start Expo dev server    |
| `bun run ios`   | Run on iOS simulator     |
| `bun run android` | Run on Android emulator |

## ✨ Features

- **i18n:** Arabic and English via `react-i18next`; translations in `src/locales/`
- **RTL/LTR:** Layout direction follows app language (Arabic = RTL). Use `useIsRTL()` or `useLayoutDirection()` in components
- **Language switch:** Stored in AsyncStorage; a native Alert prompts the user to restart the app when direction changes (required on iOS)
- **Auth:** Better Auth with Convex; email/password and optional social sign-in. Session-based routing: index redirects to (main) when signed in, (auth) when not; (main) is protected, (auth) is public
- **Navigation:** Expo Router with `Stack.Protected` for private/public screens and RTL-aware slide animations; see `.cursor/rules/performance.mdc` for patterns
- **Haptics:** `useHapticFeedback()` hook and Button `hapticType` for tap feedback (e.g. selection on iOS)
- **No toasts:** Auth errors shown as inline labels; language restart uses Alert
- **TOON:** `@toon-format/toon` is used for Token-Oriented Object Notation (TOON) encoding/decoding of LLM prompt responses into avatar motion timelines (token-efficient format)

## Commands in the root manifest

The captured [package.json](https://github.com/Up-to-code/3nan/blob/HEAD/package.json) declares the following scripts. Run them from the directory containing that manifest.

| Command | Script |
| --- | --- |
| `npm run start` | `expo start` |
| `npm run android` | `expo run:android` |
| `npm run ios` | `expo run:ios` |
| `npm run web` | `expo start --web` |

## Troubleshoot a local change

1. Reproduce the smallest example from the [quick-start guide](/docs/up-to-code-3nan/quick-start-guide).
2. Compare required configuration and dependency versions with the README.
3. Check the linked issue tracker for the same error. Include the command, runtime version, and relevant error when reporting a problem; omit credentials.

## Source and help

- [GitHub repository](https://github.com/Up-to-code/3nan)
- [Original README](https://github.com/Up-to-code/3nan/blob/main/README.md)
- [Issues and existing reports](https://github.com/Up-to-code/3nan/issues)
