# Use and adapt anan-ai-1

Use the documented interfaces and source layout for **anan-ai-1**. The sections below retain the README’s examples and configuration details.

## Structure

| Folder    | App      | Tech               |
|-----------|----------|--------------------|
| `convex/` | Backend  | Convex, agents     |
| `web/`    | Consumer | Next.js, React     |
| `admin/`  | Admin    | Next.js            |
| `mobile/` | Mobile   | Expo, React Native |

## Environment

1. Copy the template and fill values:

```bash
cp .env.example .env.local
```

2. Run Convex and push env from `.env.local`:

```bash
npx convex dev
```

3. For production, set variables in Convex Dashboard → Settings → Environment Variables.

### Required for agent + web automation

- `OPENROUTER_API_KEY` (or `MODEL_API_KEY`)
- `BROWSERBASE_API_KEY`
- `BROWSERBASE_PROJECT_ID`

### Optional

- `SERPER_API_KEY` — web search fallback

## Deployment

- **Convex:** `npm run deploy:convex` (uses `.env.production`). Or deploy via GitHub Actions on push to `main` when `convex/` changes; set `CONVEX_DEPLOY_KEY` in repo secrets.
- **Web & Admin:** Deploy via Vercel. Create separate projects with root directories `web/` and `admin/`.
- **Mobile:** Build with EAS from `mobile/`. See `mobile/README.md`.

## Commands in the root manifest

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

| Command | Script |
| --- | --- |
| `npm run dev` | `npm-run-all --parallel dev:web dev:backend` |
| `npm run typecheck` | `tsc --noEmit` |
| `npm run lint` | `tsc --noEmit && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0` |
| `npm run test` | `vitest` |

## Troubleshoot a local change

1. Reproduce the smallest example from the [quick-start guide](/docs/up-to-code-anan-ai-1/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/anan-ai-1)
- [Original README](https://github.com/Up-to-code/anan-ai-1/blob/main/README.md)
- [Issues and existing reports](https://github.com/Up-to-code/anan-ai-1/issues)
